:root{
  --bg:#F6F8FB; --card:#FFFFFF; --navy:#0B1A2C; --navy-2:#13263D;
  --ink:#0B1A2C; --ink-2:#2E3D50; --muted:#5B6B7F; --line:#E3E8EF; --line-2:#D2DAE5;
  --brand:#1A56DB; --brand-600:#1546B3; --brand-50:#EBF1FE; --brand-100:#D6E3FD;
  --amber:#B86E00; --amber-50:#FFF4E0; --green:#0B8457; --green-50:#E6F6EF; --red:#C2362F; --red-50:#FDECEB; --grey-50:#F1F4F8;
  --shadow:0 1px 3px rgba(11,26,44,.06), 0 8px 24px rgba(11,26,44,.06);
  --font:system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}
*{ box-sizing:border-box; }
html, body{ height:100%; }
body{ margin:0; background:var(--bg); color:var(--ink); font-family:var(--font); font-size:15px; line-height:1.5; -webkit-font-smoothing:antialiased; }
h1,h2,h3{ margin:0; letter-spacing:-.015em; line-height:1.25; }
p{ margin:0; }
a{ color:var(--brand); }
button, input, select, textarea{ font:inherit; color:inherit; }
svg{ display:block; }
[hidden]{ display:none !important; }
:focus-visible{ outline:2px solid var(--brand); outline-offset:2px; border-radius:6px; }
.muted{ color:var(--muted); }
.fine{ font-size:13px; color:var(--muted); }

/* Buttons and inputs */
.btn{ display:inline-flex; align-items:center; justify-content:center; gap:8px; white-space:nowrap; font-weight:600; font-size:14px; padding:9px 15px; border-radius:8px; border:1px solid transparent; cursor:pointer; text-decoration:none; transition:background .15s, border-color .15s; }
.btn svg{ width:16px; height:16px; }
.btn-primary{ background:var(--brand); color:#fff; }
.btn-primary:hover:not(:disabled){ background:var(--brand-600); }
.btn-secondary{ background:#fff; border-color:var(--line-2); color:var(--ink); }
.btn-secondary:hover:not(:disabled){ border-color:var(--ink-2); }
.btn-danger{ background:#fff; border-color:var(--line-2); color:var(--red); }
.btn-danger:hover:not(:disabled){ border-color:var(--red); background:var(--red-50); }
.btn-ghost{ background:transparent; color:var(--muted); }
.btn-ghost:hover{ color:var(--ink); background:var(--grey-50); }
.btn-block{ width:100%; padding:11px 16px; }
.btn:disabled{ opacity:.5; cursor:not-allowed; }
.link-btn{ background:none; border:0; padding:4px 0; color:inherit; cursor:pointer; display:inline-flex; align-items:center; gap:6px; font-size:13px; }
.link-btn svg{ width:15px; height:15px; }
.input, .select{ width:100%; border:1px solid var(--line-2); border-radius:8px; padding:10px 12px; background:#fff; }
.input:focus, .select:focus{ outline:none; border-color:var(--brand); box-shadow:0 0 0 3px var(--brand-50); }
.field{ display:grid; gap:6px; font-size:13px; font-weight:600; color:var(--ink-2); }
.stack{ display:grid; gap:14px; }
.form-msg{ font-size:14px; margin-top:12px; min-height:20px; }
.form-msg.ok{ color:var(--green); }
.form-msg.err{ color:var(--red); }

/* Badges */
.badge{ display:inline-flex; align-items:center; gap:6px; font-size:12px; font-weight:600; padding:3px 10px; border-radius:999px; white-space:nowrap; }
.badge::before{ content:''; width:6px; height:6px; border-radius:50%; background:currentColor; }
.b-draft{ color:var(--amber); background:var(--amber-50); }
.b-approved{ color:var(--green); background:var(--green-50); }
.b-none{ color:var(--muted); background:var(--grey-50); }
.conf{ font-size:11.5px; font-weight:600; padding:2px 8px; border-radius:6px; white-space:nowrap; display:inline-block; text-transform:capitalize; }
.c-high{ color:var(--green); background:var(--green-50); }
.c-medium{ color:var(--amber); background:var(--amber-50); }
.c-low{ color:var(--red); background:var(--red-50); }

/* Boot and auth */
.boot{ min-height:100vh; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:14px; color:var(--muted); }
.boot-logo{ width:44px; height:44px; animation:pulse 1.4s ease-in-out infinite; }
@keyframes pulse{ 50%{ opacity:.45; } }
.auth{ min-height:100vh; display:grid; place-items:center; padding:24px 16px; background:linear-gradient(180deg, #EEF3FC, var(--bg) 60%); }
.auth-card{ width:100%; max-width:420px; background:var(--card); border:1px solid var(--line); border-radius:18px; box-shadow:var(--shadow); padding:32px; }
.auth-card h1{ font-size:24px; margin:22px 0 6px; }
.auth-card .muted{ margin-bottom:22px; }
.auth-card .fine{ margin-top:18px; }
.auth-card .btn-ghost{ margin-top:6px; }
.logo{ display:flex; align-items:center; gap:10px; font-weight:800; font-size:19px; letter-spacing:-.02em; color:var(--ink); text-decoration:none; }
.logo svg{ width:30px; height:30px; }
.logo .ai{ color:var(--brand); }

/* Shell */
.shell{ display:grid; grid-template-columns:248px 1fr; min-height:100vh; background:linear-gradient(90deg, var(--navy) 248px, transparent 248px); }
.side{ background:var(--navy); color:#C9D5E4; display:flex; flex-direction:column; padding:16px 12px 14px; position:sticky; top:0; height:100vh; height:100dvh; min-height:0; overflow:hidden; }
.side-logo{ color:#fff; padding:4px 8px; }
.side-logo .ai{ color:#8FB4FF; }
.org-name{ font-size:13px; color:#8C9DB2; padding:6px 8px 12px; border-bottom:1px solid rgba(255,255,255,.08); margin-bottom:6px; flex-shrink:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.modules{ display:flex; flex-direction:column; gap:1px; flex:1 1 auto; min-height:0; overflow-y:auto; overscroll-behavior:contain; margin:0 -6px; padding:0 6px 8px; scrollbar-width:thin; scrollbar-color:rgba(255,255,255,.18) transparent; -webkit-mask-image:linear-gradient(180deg, #000 calc(100% - 22px), transparent); mask-image:linear-gradient(180deg, #000 calc(100% - 22px), transparent); }
.modules::-webkit-scrollbar{ width:6px; }
.modules::-webkit-scrollbar-thumb{ background:rgba(255,255,255,.18); border-radius:99px; }
.mod{ display:flex; align-items:center; gap:10px; padding:7px 10px; border-radius:8px; font-size:13.5px; font-weight:500; color:#D3DDEA; text-decoration:none; flex-shrink:0; }
.mod:hover{ background:rgba(255,255,255,.06); color:#fff; }
.mod span{ white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.mod svg{ width:16px; height:16px; flex-shrink:0; opacity:.85; }
.mod.active{ background:rgba(143,180,255,.18); color:#fff; box-shadow:inset 3px 0 0 #8FB4FF; }
.mod.active svg{ opacity:1; }
.mod.off{ color:#6F8299; cursor:default; }
.mod em{ margin-left:auto; font-style:normal; font-size:10.5px; font-weight:600; text-transform:uppercase; letter-spacing:.05em; background:rgba(255,255,255,.06); padding:1px 7px; border-radius:99px; }
.nav-label{ font-size:10.5px; font-weight:700; text-transform:uppercase; letter-spacing:.08em; color:#8496AD; padding:12px 10px 4px; flex-shrink:0; }
.modules > .nav-label:first-of-type{ padding-top:6px; }
@media (max-width:900px){ .nav-label{ display:none; } }
.role{ font-size:12px; font-weight:600; padding:2px 9px; border-radius:6px; text-transform:capitalize; background:var(--grey-50); color:var(--ink-2); white-space:nowrap; }
.role.owner{ background:var(--brand-50); color:var(--brand); }
.role-select{ border:1px solid var(--line-2); border-radius:7px; padding:5px 8px; background:#fff; font-size:13px; }
.invite-form{ display:grid; grid-template-columns:2fr 1fr auto; gap:10px; align-items:end; }
@media (max-width:760px){ .invite-form{ grid-template-columns:1fr; } }
.note{ font-size:13.5px; color:var(--ink-2); background:var(--bg); border:1px solid var(--line); border-radius:10px; padding:12px 14px; }
.seats{ font-size:14px; color:var(--ink-2); font-weight:600; }
.seats .bar{ height:6px; width:160px; background:var(--grey-50); border-radius:99px; overflow:hidden; margin-top:6px; }
.seats .bar i{ display:block; height:100%; background:var(--brand); }
.you{ font-size:11px; font-weight:600; color:var(--muted); margin-left:6px; }
.name-form{ display:grid; grid-template-columns:1fr auto; gap:10px; align-items:end; max-width:520px; }
.lib-form{ display:grid; grid-template-columns:3fr 1fr 1.4fr 0.9fr 1fr 1.4fr; gap:10px; align-items:end; }
.lib-form .actions{ grid-column:1 / -1; display:flex; gap:10px; }
@media (max-width:1100px){ .lib-form{ grid-template-columns:1fr 1fr; } .lib-form .wide{ grid-column:1 / -1; } }
.toolbar{ display:flex; gap:10px; flex-wrap:wrap; align-items:center; }
.search{ position:relative; flex:1; min-width:200px; }
.search svg{ position:absolute; left:11px; top:50%; transform:translateY(-50%); width:16px; height:16px; color:var(--muted); }
.search .input{ padding-left:34px; }
.toolbar .select{ width:auto; min-width:160px; }
.trade{ font-size:12px; font-weight:600; color:var(--ink-2); background:var(--grey-50); padding:2px 8px; border-radius:6px; white-space:nowrap; }
.code{ font-size:12px; color:var(--muted); font-variant-numeric:tabular-nums; }
.icon-btn.edit:hover{ color:var(--brand); background:var(--brand-50); }
.import-box{ display:grid; gap:10px; }
.import-preview{ font-size:13.5px; color:var(--ink-2); }
.import-preview .err{ color:var(--red); }
.price-select{ width:230px; max-width:100%; border:1px solid var(--line-2); border-radius:7px; padding:6px 8px; background:#fff; font-size:13px; }
.price-select:disabled{ background:transparent; border-color:transparent; color:var(--ink); appearance:none; padding-left:0; }
.match-note{ display:flex; align-items:center; gap:6px; margin-top:4px; font-size:11.5px; color:var(--muted); }
.match-note .conf{ font-size:10.5px; padding:1px 6px; }
.unit-warn{ font-size:11.5px; color:var(--muted); margin-top:3px; }
.priced{ font-size:13.5px; color:var(--ink-2); }
.priced b{ font-size:16px; color:var(--ink); font-variant-numeric:tabular-nums; }
.takeoff .desc-basis{ display:block; font-size:12px; color:var(--muted); margin-top:3px; max-width:360px; }
.b-open{ color:var(--brand); background:var(--brand-50); }
.b-responded{ color:var(--amber); background:var(--amber-50); }
.b-closed{ color:var(--green); background:var(--green-50); }
.b-overdue{ color:var(--red); background:var(--red-50); }
.stats{ display:grid; grid-template-columns:repeat(4, 1fr); gap:12px; margin-bottom:20px; }
@media (max-width:760px){ .stats{ grid-template-columns:1fr 1fr; } }
.stat{ background:var(--card); border:1px solid var(--line); border-radius:12px; padding:14px 16px; cursor:pointer; text-align:left; }
.stat:hover{ border-color:var(--brand-100); }
.stat .k{ font-size:12.5px; color:var(--muted); font-weight:600; }
.stat .v{ font-size:26px; font-weight:800; letter-spacing:-.02em; margin-top:2px; font-variant-numeric:tabular-nums; }
.stat.red .v{ color:var(--red); }
.rfi-form{ display:grid; grid-template-columns:1fr 1fr 1fr; gap:12px; }
.rfi-form .full{ grid-column:1 / -1; }
@media (max-width:860px){ .rfi-form{ grid-template-columns:1fr; } }
textarea.input{ resize:vertical; min-height:90px; line-height:1.5; }
.draft-row{ display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.draft-row .hint{ font-size:12.5px; color:var(--muted); }
.overdue{ color:var(--red); font-weight:600; }
.rfi-num{ font-weight:700; white-space:nowrap; font-variant-numeric:tabular-nums; }
.rfi-link{ color:var(--ink); text-decoration:none; font-weight:600; }
.rfi-link:hover{ color:var(--brand); }
.qa{ white-space:pre-wrap; font-size:15px; line-height:1.6; color:var(--ink); }
.qa-label{ font-size:12px; font-weight:700; text-transform:uppercase; letter-spacing:.06em; color:var(--muted); margin-bottom:8px; }
.dl{ display:grid; grid-template-columns:repeat(auto-fill, minmax(180px, 1fr)); gap:14px 24px; }
.dl div b{ display:block; font-size:12px; color:var(--muted); font-weight:600; margin-bottom:2px; }
.upgrade{ text-align:center; padding:48px 24px; }
.upgrade h2{ font-size:20px; margin-bottom:8px; }
.upgrade p{ color:var(--muted); max-width:52ch; margin:0 auto 18px; }
.rfi-summary{ display:flex; justify-content:space-between; align-items:center; gap:12px; flex-wrap:wrap; padding:16px 20px; }
.rfi-summary span{ color:var(--ink-2); font-size:14px; }
.info-form{ display:grid; grid-template-columns:1.2fr 1fr 1fr 1fr; gap:12px; }
.info-form .full{ grid-column:1 / -1; }
@media (max-width:900px){ .info-form{ grid-template-columns:1fr; } }
.suggest{ display:grid; gap:8px; margin-top:14px; }
.suggest-row{ display:grid; grid-template-columns:28px 2.2fr 1.2fr 0.9fr 1fr; gap:10px; align-items:center; padding:10px 12px; border:1px solid var(--line); border-radius:10px; }
.suggest-row.off{ opacity:.5; }
.suggest-row input[type=checkbox]{ width:18px; height:18px; accent-color:var(--brand); }
.suggest-row .input, .suggest-row .select{ padding:7px 9px; font-size:13.5px; }
.suggest-row .note{ grid-column:2 / -1; font-size:12px; color:var(--muted); padding:0; background:none; border:0; }
@media (max-width:900px){ .suggest-row{ grid-template-columns:28px 1fr; } .suggest-row > *:not(:first-child){ grid-column:2; } }
.cat{ font-size:12px; color:var(--ink-2); white-space:nowrap; }
.b-due{ color:var(--brand); background:var(--brand-50); }
.b-received{ color:var(--green); background:var(--green-50); }
.summary-row{ display:flex; gap:12px; flex-wrap:wrap; margin-bottom:20px; }
.summary-row .rfi-summary{ flex:1; min-width:280px; }
.meet-form{ display:grid; grid-template-columns:1.3fr 1fr 0.8fr 1.3fr; gap:12px; }
.meet-form .full{ grid-column:1 / -1; }
@media (max-width:900px){ .meet-form{ grid-template-columns:1fr; } }
.summary-p{ font-size:15.5px; line-height:1.65; color:var(--ink); white-space:pre-wrap; }
.dec-list{ margin:0; padding-left:20px; display:grid; gap:6px; }
.dec-list li{ line-height:1.5; }
.act-done td{ color:var(--muted); }
.act-done td .act-text{ text-decoration:line-through; }
.q-row{ display:flex; justify-content:space-between; gap:16px; align-items:center; padding:12px 0; border-top:1px solid var(--line); flex-wrap:wrap; }
.q-row:first-child{ border-top:0; padding-top:0; }
.q-row p{ flex:1; min-width:240px; }
.q-row .sub{ display:block; }
.pro-note{ font-size:12.5px; color:var(--muted); }
.notes-raw{ white-space:pre-wrap; font-size:13.5px; color:var(--ink-2); max-height:360px; overflow:auto; background:var(--bg); border:1px solid var(--line); border-radius:10px; padding:14px; }
details.raw summary{ cursor:pointer; font-weight:600; color:var(--ink-2); padding:4px 0; }
.ask-form{ display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.ask-form .full{ grid-column:1 / -1; }
@media (max-width:760px){ .ask-form{ grid-template-columns:1fr; } }
.mode-pick{ display:flex; gap:10px; flex-wrap:wrap; }
.mode-pick label{ display:flex; gap:10px; align-items:flex-start; border:1px solid var(--line-2); border-radius:10px; padding:12px 14px; cursor:pointer; flex:1; min-width:240px; font-size:14px; }
.mode-pick label:has(input:checked){ border-color:var(--brand); box-shadow:0 0 0 3px var(--brand-50); }
.mode-pick input{ margin-top:3px; accent-color:var(--brand); }
.mode-pick b{ display:block; }
.mode-pick span{ color:var(--muted); font-size:13px; }
.doc-picks{ display:flex; flex-wrap:wrap; gap:8px; }
.doc-picks label{ display:inline-flex; gap:7px; align-items:center; font-size:13.5px; background:var(--bg); border:1px solid var(--line); border-radius:8px; padding:6px 10px; cursor:pointer; }
.doc-picks input{ accent-color:var(--brand); }
.answer-text{ white-space:pre-wrap; font-size:15.5px; line-height:1.65; color:var(--ink); }
.cite-list{ list-style:none; padding:0; margin:0; display:grid; gap:8px; }
.cite-list li{ border-left:3px solid var(--brand-100); background:var(--bg); padding:9px 12px; border-radius:0 8px 8px 0; font-size:14px; }
.cite-list li b{ display:block; font-size:12.5px; color:var(--ink-2); margin-bottom:2px; }
.plain-list{ margin:0; padding-left:20px; display:grid; gap:5px; font-size:14.5px; }
.answer-meta{ display:flex; gap:8px; flex-wrap:wrap; align-items:center; margin-bottom:16px; }
.b-docs{ color:var(--green); background:var(--green-50); }
.b-general{ color:var(--amber); background:var(--amber-50); }
.b-missing{ color:var(--red); background:var(--red-50); }
.history-item{ display:flex; justify-content:space-between; gap:12px; align-items:center; padding:12px 20px; border-top:1px solid var(--line); cursor:pointer; }
.history-item:hover{ background:var(--bg); }
.history-item.active{ background:var(--brand-50); }
.history-item p{ font-size:14px; color:var(--ink); }
.upload-progress{ font-size:13.5px; color:var(--brand); font-weight:600; display:flex; gap:10px; align-items:center; }
.mod em.beta, .mod:not(.off) em{ background:rgba(143,180,255,.16); color:#8FB4FF; }
.tabs-row{ display:flex; gap:4px; border-bottom:1px solid var(--line); padding:0 20px; }
.tab-btn{ background:none; border:0; padding:12px 14px; font-weight:600; color:var(--muted); cursor:pointer; border-bottom:2px solid transparent; margin-bottom:-1px; }
.tab-btn[aria-selected="true"]{ color:var(--brand); border-bottom-color:var(--brand); }
.cmp-form{ display:grid; grid-template-columns:1fr 1fr; gap:12px 20px; }
.cmp-form .full{ grid-column:1 / -1; }
.cmp-side{ border:1px solid var(--line); border-radius:12px; padding:14px; display:grid; gap:10px; background:var(--bg); }
.cmp-side h3{ font-size:14px; }
@media (max-width:860px){ .cmp-form{ grid-template-columns:1fr; } }
.viewer-bar{ display:flex; justify-content:space-between; align-items:center; gap:12px; flex-wrap:wrap; padding:12px 20px; border-bottom:1px solid var(--line); }
.seg{ display:inline-flex; border:1px solid var(--line-2); border-radius:9px; overflow:hidden; }
.seg button{ background:#fff; border:0; padding:7px 12px; font-size:13px; font-weight:600; color:var(--ink-2); cursor:pointer; border-right:1px solid var(--line-2); }
.seg button:last-child{ border-right:0; }
.seg button[aria-pressed="true"]{ background:var(--brand-50); color:var(--brand); }
.viewer{ overflow:auto; max-height:75vh; background:#E9EDF3; padding:12px; }
.viewer canvas{ display:block; background:#fff; box-shadow:var(--shadow); }
.viewer.fit canvas{ width:100%; height:auto; }
.viewer .pair{ display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.viewer .pair figure{ margin:0; }
.viewer .pair figcaption{ font-size:12px; font-weight:600; color:var(--ink-2); margin-bottom:6px; }
.legend-row{ display:flex; gap:14px; flex-wrap:wrap; font-size:12.5px; color:var(--ink-2); align-items:center; }
.legend-row i{ display:inline-block; width:12px; height:12px; border-radius:3px; margin-right:6px; vertical-align:-2px; }
.change-list{ display:grid; gap:10px; }
.change{ display:grid; grid-template-columns:34px 1fr auto; gap:12px; align-items:start; padding:12px 14px; border:1px solid var(--line); border-radius:12px; }
.change.done{ background:#F6FBF8; }
.change .num{ width:28px; height:28px; border-radius:50%; background:var(--navy); color:#fff; display:grid; place-items:center; font-weight:700; font-size:13px; }
.change .desc{ font-size:14.5px; color:var(--ink); }
.change .tags{ display:flex; gap:6px; flex-wrap:wrap; margin-top:6px; }
.change .note-in{ margin-top:8px; padding:7px 10px; font-size:13px; }
.tag{ font-size:11.5px; font-weight:600; padding:2px 8px; border-radius:6px; background:var(--grey-50); color:var(--ink-2); text-transform:capitalize; }
.tag.qty{ background:var(--amber-50); color:var(--amber); text-transform:none; }
.tag.major{ background:var(--red-50); color:var(--red); }
.tag.moderate{ background:var(--amber-50); color:var(--amber); }
.diff-doc{ font-size:14.5px; line-height:1.7; }
.diff-p{ padding:8px 12px; border-left:3px solid transparent; margin:0; white-space:pre-wrap; }
.diff-p.same{ color:var(--muted); }
.diff-p.add{ background:#EEF8F3; border-left-color:var(--green); }
.diff-p.del{ background:#FDF1F0; border-left-color:var(--red); text-decoration:line-through; color:#8F241F; }
.diff-p.chg{ background:#FFFBF2; border-left-color:#E9A23B; }
.diff-p .n{ display:inline-grid; place-items:center; min-width:22px; height:22px; border-radius:50%; background:var(--navy); color:#fff; font-size:11.5px; font-weight:700; margin-right:8px; text-decoration:none; vertical-align:1px; }
.diff-p ins{ background:#CDEFDD; color:#075E3E; text-decoration:none; border-radius:3px; padding:0 2px; }
.diff-p del{ background:#F9D3D0; color:#8F241F; border-radius:3px; padding:0 2px; }
.gap{ text-align:center; color:var(--muted); font-size:12.5px; padding:4px; }
.side-foot{ margin-top:auto; display:grid; gap:12px; padding-top:12px; flex-shrink:0; border-top:1px solid rgba(255,255,255,.08); }
.usage{ font-size:12.5px; padding:0 8px; }
.usage .bar{ height:6px; background:rgba(255,255,255,.1); border-radius:99px; overflow:hidden; margin-top:7px; }
.usage .bar i{ display:block; height:100%; background:#8FB4FF; border-radius:99px; }
.usage .bar i.full{ background:#F2994A; }
.me{ display:flex; justify-content:space-between; align-items:center; gap:8px; font-size:12.5px; padding:0 8px; color:#8C9DB2; }
.me span{ overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.main{ padding:32px 40px 64px; min-width:0; outline:none; }
@media (max-width:900px){
  .shell{ grid-template-columns:minmax(0, 1fr); grid-template-rows:auto 1fr; background:none; }
  .side, .modules{ min-width:0; }
  .side{ position:static; height:auto; padding:12px 14px; overflow:visible; }
  .org-name{ display:none; }
  .modules{ -webkit-mask-image:none; mask-image:none; flex:0 0 auto; align-items:center; flex-direction:row; overflow-x:auto; overflow-y:hidden; margin:10px 0 0; padding:0 0 6px; gap:2px; }
  .mod em{ display:none; }
  .side-foot{ grid-template-columns:minmax(0,1fr); gap:8px; margin-top:8px; padding-top:10px; }
  #usage{ display:flex; gap:16px; font-size:11.5px; }
  #usage > *{ flex:1; min-width:0; margin-top:0 !important; }
  #usage .bar{ margin-top:4px; height:4px; }
  .main{ padding:22px 16px 48px; }
}

/* Page parts */
.page-head{ display:flex; justify-content:space-between; align-items:flex-end; gap:16px; flex-wrap:wrap; margin-bottom:24px; }
.page-head h1{ font-size:26px; font-weight:800; }
.page-head p{ color:var(--muted); margin-top:4px; }
.crumb{ display:inline-flex; align-items:center; gap:6px; font-size:13.5px; color:var(--muted); text-decoration:none; margin-bottom:10px; }
.crumb:hover{ color:var(--ink); }
.crumb svg{ width:15px; height:15px; }
.card{ background:var(--card); border:1px solid var(--line); border-radius:14px; box-shadow:var(--shadow); }
.card + .card{ margin-top:20px; }
.card-head{ display:flex; justify-content:space-between; align-items:center; gap:12px; padding:16px 20px; border-bottom:1px solid var(--line); flex-wrap:wrap; }
.card-head h2{ font-size:16px; font-weight:700; }
.card-head p{ font-size:13px; color:var(--muted); margin-top:2px; }
.card-body{ padding:20px; }
.empty{ padding:40px 20px; text-align:center; color:var(--muted); }
.empty strong{ display:block; color:var(--ink); font-size:16px; margin-bottom:4px; }

.grid-projects{ display:grid; grid-template-columns:repeat(auto-fill, minmax(260px, 1fr)); gap:16px; }
.project{ display:block; background:var(--card); border:1px solid var(--line); border-radius:14px; padding:18px; text-decoration:none; color:inherit; transition:border-color .15s, box-shadow .15s; }
.project:hover{ border-color:var(--brand-100); box-shadow:var(--shadow); }
.project h3{ font-size:16px; font-weight:700; }
.project p{ font-size:13px; color:var(--muted); margin-top:4px; }
.new-project{ display:grid; grid-template-columns:2fr 1fr 1fr auto; gap:10px; align-items:end; }
@media (max-width:760px){ .new-project{ grid-template-columns:1fr; } }

.drop{ border:2px dashed var(--line-2); border-radius:12px; padding:26px; text-align:center; color:var(--muted); cursor:pointer; transition:border-color .15s, background .15s; display:block; }
.drop:hover, .drop.over{ border-color:var(--brand); background:var(--brand-50); }
.drop svg{ width:26px; height:26px; margin:0 auto 8px; color:var(--brand); }
.drop strong{ color:var(--ink); }
.drop input{ position:absolute; width:1px; height:1px; opacity:0; }

.table-wrap{ overflow-x:auto; }
table{ width:100%; border-collapse:collapse; font-size:14px; }
th{ text-align:left; font-size:11.5px; text-transform:uppercase; letter-spacing:.05em; color:var(--muted); font-weight:600; padding:10px 14px; background:var(--bg); border-bottom:1px solid var(--line); white-space:nowrap; }
td{ padding:11px 14px; border-bottom:1px solid var(--line); vertical-align:middle; }
tr:last-child td{ border-bottom:0; }
td.num, th.num{ text-align:right; font-variant-numeric:tabular-nums; white-space:nowrap; }
.file-cell{ display:flex; align-items:center; gap:10px; }
.file-cell svg{ width:18px; height:18px; color:var(--muted); flex-shrink:0; }
.sub{ display:block; font-size:12px; color:var(--muted); }
.row-actions{ display:flex; gap:8px; justify-content:flex-end; flex-wrap:wrap; }
.icon-btn{ background:none; border:0; color:var(--muted); cursor:pointer; padding:7px; border-radius:7px; }
.icon-btn:hover{ color:var(--red); background:var(--red-50); }
.icon-btn svg{ width:16px; height:16px; }

.running{ display:flex; align-items:center; gap:10px; font-size:13px; color:var(--brand); font-weight:600; }
.spinner{ width:16px; height:16px; border-radius:50%; border:2px solid var(--brand-100); border-top-color:var(--brand); animation:spin .8s linear infinite; flex-shrink:0; }
@keyframes spin{ to{ transform:rotate(360deg); } }

/* Take-off review */
.meta{ display:flex; flex-wrap:wrap; gap:8px 20px; font-size:13.5px; color:var(--ink-2); }
.meta b{ color:var(--muted); font-weight:600; margin-right:4px; }
.warnings{ background:var(--amber-50); border:1px solid #F4D9A8; color:#7A4A00; border-radius:10px; padding:12px 14px; margin-top:16px; font-size:14px; }
.warnings strong{ display:flex; align-items:center; gap:7px; margin-bottom:4px; }
.warnings svg{ width:16px; height:16px; }
.warnings ul{ margin:0; padding-left:20px; }
.summary-text{ margin-top:14px; color:var(--ink-2); }
.review-bar{ display:flex; justify-content:space-between; align-items:center; gap:12px; flex-wrap:wrap; padding:14px 20px; border-bottom:1px solid var(--line); background:var(--bg); }
.progress-text{ font-size:13.5px; color:var(--ink-2); font-weight:600; }
.progress{ height:6px; width:180px; background:var(--grey-50); border-radius:99px; overflow:hidden; margin-top:6px; }
.progress i{ display:block; height:100%; background:var(--green); }
.takeoff td .qty{ width:110px; text-align:right; border:1px solid var(--line-2); border-radius:7px; padding:6px 8px; font-variant-numeric:tabular-nums; }
.takeoff td .qty:disabled{ background:transparent; border-color:transparent; color:var(--ink); }
.takeoff .edited{ display:block; font-size:11.5px; color:var(--amber); margin-top:3px; text-align:right; }
.takeoff tr.low td{ background:#FFF8F7; }
.takeoff tr.medium td{ background:#FFFCF5; }
.takeoff tr.done td{ background:#F6FBF8; }
.takeoff .basis{ font-size:12.5px; color:var(--muted); max-width:340px; }
.check{ display:inline-flex; align-items:center; gap:8px; cursor:pointer; font-size:13px; font-weight:600; color:var(--muted); white-space:nowrap; }
.check input{ width:18px; height:18px; accent-color:var(--green); cursor:pointer; }
.saved{ font-size:12.5px; color:var(--muted); }
.disclaimer{ font-size:12.5px; color:var(--muted); padding:14px 20px; border-top:1px solid var(--line); }

.toast{ position:fixed; bottom:22px; left:50%; transform:translateX(-50%) translateY(16px); background:var(--navy); color:#fff; padding:11px 18px; border-radius:10px; font-size:14px; opacity:0; transition:all .25s; pointer-events:none; z-index:100; max-width:calc(100vw - 32px); }
.toast.show{ opacity:1; transform:translateX(-50%) translateY(0); }
.toast.err{ background:var(--red); }

/* Document control (v1.1) */
.b-wip{ color:var(--muted); background:var(--grey-50); }
.b-shared{ color:var(--amber); background:var(--amber-50); }
.b-published{ color:var(--green); background:var(--green-50); }
.b-archived{ color:#6B7A8C; background:#EEF1F5; }
.b-archived::before{ background:transparent; border:1.5px solid currentColor; width:4px; height:4px; }
.chip{ font-size:11.5px; font-weight:600; padding:3px 9px; border-radius:6px; background:var(--grey-50); color:var(--ink-2); white-space:nowrap; }
.chip.ok{ background:var(--brand-50); color:var(--brand); }
.btn-sm{ padding:6px 10px; font-size:12.5px; border-radius:8px; }
.muted-row td{ color:var(--muted); background:#FBFCFD; }
.dl-btn{ color:var(--brand) !important; font-weight:600; display:inline-flex; gap:6px; align-items:center; text-align:left; word-break:break-all; }
.dl-btn svg{ width:14px; height:14px; flex-shrink:0; }
.action-panel{ border-top:1px solid var(--line); background:var(--bg); }
.action-panel h3{ font-size:15px; }
.hint{ font-size:12.5px; color:var(--muted); }
.ok-text{ color:var(--green); font-weight:600; display:inline-flex; align-items:center; gap:4px; }
.ok-text svg, .ai-tag svg{ width:13px; height:13px; }
.ai-tag{ color:var(--brand); font-weight:600; display:inline-flex; align-items:center; gap:4px; }
.doc-queue{ display:grid; gap:8px; margin-top:16px; }
.dq-row{ display:grid; grid-template-columns:1.3fr 1.5fr 1.6fr .55fr 1.35fr 34px; gap:8px; align-items:center; padding:10px 12px; border:1px solid var(--line); border-radius:10px; }
.dq-row.done{ background:#F6FBF8; }
.dq-row.reading, .dq-row.saving{ background:var(--brand-50); }
.dq-head{ border:0; padding:0 12px; font-size:11.5px; text-transform:uppercase; letter-spacing:.05em; color:var(--muted); font-weight:600; }
.dq-row .input, .dq-row .select{ padding:7px 9px; font-size:13px; min-width:0; }
.dq-file{ display:flex; gap:8px; align-items:center; min-width:0; }
.dq-file svg{ width:18px; height:18px; color:var(--muted); flex-shrink:0; }
.dq-file b{ display:block; font-size:13px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.dq-file > span{ min-width:0; }
.dq-note{ grid-column:2 / -1; font-size:12.5px; color:var(--muted); }
.dq-foot{ display:flex; gap:12px; align-items:flex-end; flex-wrap:wrap; margin-top:14px; }
@media (max-width:900px){ .dq-row{ grid-template-columns:1fr 1fr; } .dq-head{ display:none; } .dq-file, .dq-note{ grid-column:1 / -1; } }
.audit{ max-height:420px; overflow:auto; }
.audit-row{ display:grid; grid-template-columns:150px 1fr auto; gap:14px; padding:10px 20px; border-bottom:1px solid var(--line); font-size:13.5px; }
.audit-row:last-child{ border-bottom:0; }
.audit-row .when{ color:var(--muted); font-variant-numeric:tabular-nums; }
.audit-row .who{ color:var(--muted); font-size:12.5px; }
@media (max-width:700px){ .audit-row{ grid-template-columns:1fr; gap:2px; } }

/* Transmittals (v1.2) */
.b-issued{ color:var(--brand); background:var(--brand-50); }
.b-void{ color:var(--red); background:var(--red-50); }
.code{ display:inline-grid; place-items:center; width:26px; height:26px; border-radius:7px; font-weight:800; font-size:13px; }
.code-A{ background:var(--green-50); color:var(--green); }
.code-B{ background:var(--amber-50); color:var(--amber); }
.code-C{ background:var(--red-50); color:var(--red); }
.code-none{ background:var(--grey-50); color:var(--muted); font-weight:600; }
.code-late{ background:var(--red-50); color:var(--red); font-weight:600; font-size:11px; width:auto; padding:0 7px; }
.matrix td.cell{ text-align:center; }
.matrix td.cell button{ background:none; border:0; cursor:pointer; padding:2px; border-radius:8px; }
.matrix td.cell button:hover{ outline:2px solid var(--brand-100); }
.matrix th.rc{ text-align:center; white-space:normal; min-width:110px; }
.picker{ max-height:340px; overflow:auto; border:1px solid var(--line); border-radius:10px; margin-top:10px; }
.pick-row{ display:grid; grid-template-columns:1fr 150px auto; gap:10px; align-items:center; padding:9px 12px; border-bottom:1px solid var(--line); font-size:13.5px; }
.pick-row:last-child{ border-bottom:0; }
.pick-row .select{ padding:6px 8px; font-size:13px; }
.rcp-add{ display:grid; grid-template-columns:1fr 1fr 1fr auto; gap:10px; align-items:end; }
@media (max-width:860px){ .rcp-add, .pick-row{ grid-template-columns:1fr; } }
.sel-bar{ display:flex; justify-content:space-between; align-items:center; gap:12px; padding:10px 20px; background:var(--brand-50); border-bottom:1px solid var(--line); font-size:14px; font-weight:600; color:var(--brand); }
td.sel, th.sel{ width:36px; padding-right:0; }
td.sel input, th.sel input{ width:17px; height:17px; accent-color:var(--brand); }
.sheet h2{ font-size:18px; }
.sheet .sheet-grid{ display:grid; grid-template-columns:repeat(auto-fill, minmax(200px, 1fr)); gap:10px 24px; margin:14px 0 18px; font-size:14px; }
.sheet .sheet-grid b{ display:block; font-size:12px; color:var(--muted); font-weight:600; }
.sheet table{ margin-top:8px; }
.sheet .sheet-msg{ white-space:pre-wrap; margin-top:14px; font-size:14px; }
@media print{
  body *{ visibility:hidden; }
  #tr-sheet, #tr-sheet *{ visibility:visible; }
  #tr-sheet{ position:absolute; left:0; top:0; width:100%; border:0; box-shadow:none; }
  #tr-sheet .no-print{ display:none; }
  #tr-sheet .table-wrap{ overflow:visible; }
}
/* Recipient page */
body.public{ background:var(--bg); }
.pub-wrap{ max-width:920px; margin:0 auto; padding:0 20px; }
.pub-head{ background:var(--navy); color:#fff; padding:14px 0; }
.pub-head .pub-wrap{ display:flex; justify-content:space-between; align-items:center; }
.pub-head .logo{ color:#fff; }
.pub-tag{ font-size:13px; color:#8FB4FF; font-weight:600; }
.pub-from{ font-size:13px; font-weight:700; text-transform:uppercase; letter-spacing:.06em; color:var(--brand) !important; margin:0 0 4px !important; }
.pub-docs{ display:grid; }
.pub-doc{ padding:14px 20px; border-top:1px solid var(--line); display:grid; gap:12px; }
.pub-doc-main{ display:flex; justify-content:space-between; align-items:center; gap:12px; }
.pub-resp{ display:grid; grid-template-columns:260px 1fr auto auto; gap:10px; align-items:end; }
.pub-saved{ color:var(--green); font-weight:600; font-size:13px; display:inline-flex; gap:4px; align-items:center; padding-bottom:9px; }
.pub-saved svg, .badge svg{ width:13px; height:13px; }
.pub-foot{ color:var(--muted); font-size:12.5px; padding-top:20px; padding-bottom:40px; }
@media (max-width:700px){ .pub-resp{ grid-template-columns:1fr; } .pub-doc-main{ flex-direction:column; align-items:flex-start; } }

/* Markup & review (v1.3) */
.mk-shell{ display:grid; grid-template-columns:minmax(0, 1fr) 340px; gap:16px; align-items:start; }
@media (max-width:1100px){ .mk-shell{ grid-template-columns:minmax(0, 1fr); } }
.mk-main{ margin:0; overflow:hidden; }
.mk-bar{ display:flex; flex-wrap:wrap; gap:10px 16px; align-items:center; padding:10px 14px; border-bottom:1px solid var(--line); background:var(--bg); }
.mk-tools{ display:flex; gap:4px; }
.mk-tool{ width:36px; height:36px; border:1px solid var(--line-2); background:#fff; border-radius:8px; display:grid; place-items:center; cursor:pointer; color:var(--ink-2); }
.mk-tool svg{ width:18px; height:18px; }
.mk-tool.on{ background:var(--brand); border-color:var(--brand); color:#fff; }
.mk-tool:disabled{ opacity:.4; cursor:not-allowed; }
.mk-colours{ display:flex; gap:6px; }
.mk-colour{ width:22px; height:22px; border-radius:50%; background:var(--c); border:2px solid #fff; box-shadow:0 0 0 1px var(--line-2); cursor:pointer; }
.mk-colour.on{ box-shadow:0 0 0 2px var(--ink); }
.mk-nav{ display:flex; gap:4px; align-items:center; margin-left:auto; }
.mk-nav .btn{ min-width:32px; justify-content:center; font-size:16px; }
.mk-sep{ width:1px; height:20px; background:var(--line-2); margin:0 6px; }
.mk-stage{ overflow:auto; max-height:calc(100vh - 230px); min-height:420px; background:#E9EDF2; padding:0; }
.mk-canvas-wrap{ position:relative; margin:0 auto; background:#fff; }
.mk-base{ display:block; }
.mk-svg{ position:absolute; left:0; top:0; touch-action:none; }
.mk-svg.drawing{ cursor:crosshair; }
.mk-side{ margin:0; position:sticky; top:16px; max-height:calc(100vh - 32px); overflow:auto; }
.mk-new, .mk-thread{ padding:14px 16px; border-bottom:1px solid var(--line); background:var(--brand-50); }
.mk-thread{ background:#fff; }
.mk-new h3{ font-size:14px; margin-bottom:8px; }
.mk-thread-head{ display:flex; align-items:center; gap:8px; margin-bottom:8px; }
.mk-comment{ white-space:pre-wrap; font-size:14.5px; margin-bottom:4px; }
.mk-num{ display:inline-grid; place-items:center; min-width:24px; height:24px; border-radius:50%; background:var(--c); color:#fff; font-weight:700; font-size:12px; flex-shrink:0; }
.mk-replies{ display:grid; gap:8px; margin-top:10px; }
.mk-reply{ background:var(--bg); border-radius:8px; padding:8px 10px; font-size:13.5px; }
.mk-reply-form{ display:flex; gap:6px; margin-top:10px; }
.mk-reply-form .input{ padding:7px 9px; font-size:13.5px; }
.mk-list-head{ display:flex; align-items:center; gap:8px; flex-wrap:wrap; padding:12px 16px; border-bottom:1px solid var(--line); font-size:13.5px; }
.mk-list{ display:grid; }
.mk-item{ display:flex; gap:10px; align-items:flex-start; text-align:left; background:#fff; border:0; border-bottom:1px solid var(--line); padding:10px 16px; cursor:pointer; font-size:13.5px; color:var(--ink); }
.mk-item:hover{ background:var(--bg); }
.mk-item.on{ background:var(--brand-50); }
.mk-item.resolved{ opacity:.6; }
.mk-item-text{ display:grid; gap:2px; min-width:0; }
.mk-item-text > span:first-child{ overflow:hidden; text-overflow:ellipsis; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; }
.mk-report{ display:none; }
@media print{
  body *{ visibility:hidden; }
  .mk-report, .mk-report *{ visibility:visible; }
  .mk-report{ display:block; position:absolute; left:0; top:0; width:100%; font-size:12px; }
  .mk-report img{ width:100%; border:1px solid #ccc; margin:10px 0; }
  .mk-report table{ font-size:11px; }
}

/* Change control, site diary, tasks (v1.4) */
.ct-bar{ margin-bottom:16px; }
.periods > div{ display:grid; gap:8px; }
.period{ display:grid; grid-template-columns:minmax(0,1fr) 90px 50px; gap:10px; align-items:center; font-size:13.5px; color:var(--ink-2); }
.period .input{ padding:7px 9px; }
.period em{ font-style:normal; color:var(--muted); font-size:12.5px; }
@media (max-width:700px){ .period{ grid-template-columns:minmax(0,1fr) 80px 44px; } }
.task-list{ display:grid; }
.task-row{ display:flex; gap:12px; align-items:flex-start; padding:11px 20px; border-bottom:1px solid var(--line); }
.task-row:last-child{ border-bottom:0; }
.task-row.done .task-title{ text-decoration:line-through; color:var(--muted); }
.task-done{ width:18px; height:18px; accent-color:var(--green); margin-top:2px; flex-shrink:0; }
.task-main{ display:grid; gap:2px; flex:1; min-width:0; }
.task-title{ font-weight:600; font-size:14.5px; }
.task-add{ display:flex; gap:8px; flex-wrap:wrap; align-items:center; }
.task-add .input[name=title], .task-add .input[name=body], .task-add .input[name=caption]{ flex:1 1 220px; min-width:0; }
.task-add .select, .task-add .input[type=date]{ width:auto; flex:0 1 auto; }
.dy-rows{ display:grid; gap:6px; margin:6px 0; }
.dy-row{ display:grid; grid-template-columns:minmax(0,1.2fr) minmax(0,1.2fr) 90px 34px; gap:6px; align-items:center; }
.dy-row .input{ padding:7px 9px; font-size:13.5px; }
@media (max-width:700px){ .dy-row{ grid-template-columns:minmax(0,1fr) minmax(0,1fr); } }
.dy-block{ margin-top:16px; }
.dy-block table{ max-width:560px; }
.dy-photos{ display:grid; grid-template-columns:repeat(auto-fill, minmax(180px, 1fr)); gap:12px; }
.dy-photo{ margin:0; border:1px solid var(--line); border-radius:10px; overflow:hidden; background:var(--bg); }
.dy-photo img{ display:block; width:100%; aspect-ratio:4 / 3; object-fit:cover; }
.dy-photo figcaption{ padding:7px 9px; font-size:12.5px; color:var(--ink-2); }

/* Register import (v1.5) */
.imp-map{ display:grid; gap:8px; margin-top:8px; max-width:900px; }
.imp-map-row{ display:grid; grid-template-columns:minmax(0, 220px) minmax(0, 300px) minmax(0, 1fr); gap:12px; align-items:center; font-size:14px; color:var(--ink-2); }
.imp-map-row .select{ padding:7px 9px; font-size:13.5px; }
.imp-map-row em{ font-style:normal; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
@media (max-width:760px){ .imp-map-row{ grid-template-columns:minmax(0,1fr); gap:4px; } }
.imp-summary{ margin-top:18px; padding:14px 16px; border-radius:10px; background:var(--brand-50); color:var(--ink); font-size:14px; }
.imp-summary.bad{ background:var(--amber-50); }
.imp-summary details{ margin-top:8px; }
.imp-summary summary{ cursor:pointer; font-weight:600; color:var(--brand); }
.imp-summary ul{ margin:6px 0 0; padding-left:20px; font-size:13px; color:var(--ink-2); max-height:220px; overflow:auto; }

/* ---------- v1.6 AI drafting ---------- */
.ai-draft > summary{ cursor:pointer; list-style:none; }
.ai-draft > summary::-webkit-details-marker{ display:none; }
.ai-draft > summary h2{ display:flex; align-items:center; gap:8px; }
.ai-draft > summary h2 svg{ width:16px; height:16px; color:var(--brand); }
.ai-draft > summary::after{ content:"Show"; margin-left:auto; font-size:13px; color:var(--muted); align-self:center; }
.ai-draft[open] > summary::after{ content:"Hide"; }
.ai-draft:not([open]) > summary{ border-bottom:0; }
#ad-out .field, #ad-out textarea{ width:100%; }
#ad-missing{ margin-bottom:12px; }

/* ---------- v1.7 programme ---------- */
.slip-late{ color:var(--red); font-weight:600; }
.slip-early{ color:var(--green, #0e9f6e); }
.crit-dot{ display:inline-block; width:8px; height:8px; border-radius:50%; background:var(--red); margin-right:6px; vertical-align:middle; }
.map-grid{ display:grid; grid-template-columns:repeat(auto-fill, minmax(180px, 1fr)); gap:10px; margin-bottom:8px; }
.sub-h{ font-size:14px; font-weight:700; margin:14px 0 6px; }
.pg-filters{ display:flex; gap:14px; align-items:center; flex-wrap:wrap; border-bottom:1px solid var(--line); }
.pg-filters .input{ max-width:280px; }
.pg-panel{ margin:12px 16px; border-color:var(--brand-100); box-shadow:none; }
.gantt-wrap{ overflow:auto; max-height:72vh; }
.gantt{ --gl:560px; position:relative; min-width:calc(var(--gl) + var(--gw)); font-size:12.5px; }
.gt-row{ display:flex; height:28px; border-bottom:1px solid var(--line); }
.gt-body .gt-row{ cursor:pointer; }
.gt-body .gt-row:hover .gt-left, .gt-body .gt-row.sel .gt-left{ background:var(--brand-50); }
.gt-body .gt-row:hover, .gt-body .gt-row.sel{ background:var(--brand-50); }
.gt-left{ position:sticky; left:0; z-index:2; width:var(--gl); flex:none; display:flex; align-items:center; gap:8px; padding:0 10px; background:var(--card); border-right:1px solid var(--line); }
.gt-left > span{ white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.gt-id{ width:56px; color:var(--muted); flex:none; }
.gt-name{ flex:1; min-width:0; }
.gt-d{ width:82px; flex:none; color:var(--muted); }
.gt-n{ width:40px; flex:none; text-align:right; color:var(--muted); }
.gt-s{ width:62px; flex:none; text-align:right; }
.is-sum .gt-name{ font-weight:700; }
.gt-right{ position:relative; width:var(--gw); flex:none; }
.gt-head{ position:sticky; top:0; z-index:3; background:var(--card); font-weight:600; }
.gt-head .gt-left{ z-index:4; }
.gt-month{ position:absolute; top:6px; padding-left:4px; border-left:1px solid var(--line); color:var(--muted); font-weight:500; white-space:nowrap; }
.gt-grid{ position:absolute; top:0; bottom:0; border-left:1px solid var(--line); opacity:.6; }
.gt-today{ position:absolute; top:0; bottom:0; width:0; border-left:2px solid var(--amber, #d97706); z-index:1; pointer-events:none; }
.gt-body{ position:relative; }
.gt-bar{ position:absolute; top:8px; height:12px; border-radius:3px; background:var(--brand); overflow:hidden; }
.gt-bar b{ position:absolute; left:0; top:0; bottom:0; background:rgba(0,0,0,.28); }
.gt-bar.crit{ background:var(--red); }
.gt-bar.sum{ top:11px; height:6px; background:#1f2937; border-radius:1px; }
.gt-ghost{ position:absolute; top:21px; height:4px; border-radius:2px; background:#9ca3af; opacity:.8; }
.gt-ms{ position:absolute; top:8px; width:12px; height:12px; background:#1f2937; transform:rotate(45deg); }
.gt-ms.crit{ background:var(--red); }
.gt-new{ font-style:normal; font-size:10.5px; font-weight:700; color:var(--brand); background:var(--brand-50); border-radius:4px; padding:1px 4px; margin-right:6px; }
.gt-link{ font-style:normal; font-size:10.5px; font-weight:700; color:#fff; background:var(--brand); border-radius:8px; padding:0 6px; margin-left:4px; }
@media (max-width: 760px){
  .gantt{ --gl:190px; }
  .gt-d, .gt-n, .gt-id{ display:none; }
  .gt-s{ width:44px; }
  .pg-panel{ margin:10px; }
}
.pg-stats .stat{ cursor:default; }
.pg-stats .stat > span{ display:block; font-size:12.5px; color:var(--muted); font-weight:600; }
.pg-stats .stat > b{ display:block; font-size:22px; font-weight:800; letter-spacing:-.02em; margin-top:2px; }
.pg-stats .stat > em{ display:block; font-style:normal; font-size:12.5px; color:var(--muted); margin-top:2px; }
.pg-stats .stat > em.slip-late, .pg-stats .stat > b.slip-late{ color:var(--red); }
.audit-row.two{ grid-template-columns:1fr auto; }
@media (max-width: 760px){ .pg-stats{ grid-template-columns:1fr 1fr; } }

/* ---------- v1.8 payments ---------- */
.py-grid{ display:grid; grid-template-columns:minmax(0, 1fr) 360px; gap:16px; align-items:start; margin-top:16px; }
.py-grid > div > .card{ margin-bottom:16px; }
.py-side{ position:sticky; top:16px; }
.py-sum{ width:100%; border-collapse:collapse; font-size:13.5px; }
.py-sum td{ padding:7px 0; border-bottom:1px solid var(--line); vertical-align:top; }
.py-sum td.num{ text-align:right; white-space:nowrap; padding-left:10px; }
.py-sum .input{ padding:6px 8px; }
.py-sum td.num .input{ width:130px; text-align:right; }
.py-sum .total-row td{ border-top:2px solid var(--ink, #0B1A2C); }
.py-sum .big td{ font-size:15px; }
.py-lines .input.pct{ width:86px; text-align:right; padding:5px 8px; }
.input.num{ text-align:right; }
.sec-row td{ background:var(--grey-50); font-weight:700; font-size:12.5px; color:var(--muted); }
.total-row td{ border-top:2px solid var(--line-2, #cfd6e0); }
.py-break .input{ padding:6px 8px; }
.py-dates{ grid-template-columns:repeat(auto-fill, minmax(170px, 1fr)); }
.pay-report{ display:none; }
@media (max-width: 1100px){ .py-grid{ grid-template-columns:minmax(0, 1fr); } .py-side{ position:static; } }
@media print{
  .pay-report, .pay-report *{ visibility:visible; }
  .pay-report{ display:block; position:absolute; left:0; top:0; width:100%; font-size:12px; }
  .pay-report table{ width:100%; border-collapse:collapse; margin:10px 0; font-size:11px; }
  .pay-report th, .pay-report td{ border-bottom:1px solid #ddd; padding:4px 6px; text-align:left; }
  .pay-report .num{ text-align:right; }
}

/* ---------- v1.9 meeting note taker ---------- */
.bot-card .card-head h2{ display:flex; align-items:center; gap:8px; }
.bot-card .card-head h2 svg{ width:18px; height:18px; color:var(--brand); }
.bot-usage{ min-width:200px; font-size:13px; color:var(--muted); }
.bot-usage .bar{ height:6px; background:var(--grey-50); border-radius:4px; margin-top:6px; overflow:hidden; }
.bot-usage .bar i{ display:block; height:100%; background:var(--brand); }
.bot-usage .bar i.full{ background:var(--red); }
.bot-consent{ align-items:flex-start; line-height:1.4; white-space:normal; display:flex; gap:8px; }
.bot-card .rfi-form > *{ min-width:0; }
.bot-card .input, .bot-card .select{ min-width:0; width:100%; }
@media (max-width: 760px){ .bot-card .rfi-form{ grid-template-columns:minmax(0, 1fr); } .bot-usage{ min-width:0; width:100%; } }

/* ---------- v1.10 commissioning ---------- */
.mini-bar{ height:6px; width:120px; max-width:100%; background:var(--grey-50); border-radius:4px; overflow:hidden; }
.mini-bar i{ display:block; height:100%; background:var(--green); }
.comm-steps{ list-style:none; margin:0; padding:0; display:grid; grid-template-columns:repeat(4, minmax(0, 1fr)); gap:10px; counter-reset:st; }
.comm-steps li{ border:1px solid var(--line); border-radius:10px; padding:10px 12px; position:relative; background:var(--card); }
.comm-steps li b{ display:block; font-size:13.5px; }
.comm-steps li span{ font-size:12.5px; color:var(--muted); }
.comm-steps li.done{ border-color:var(--green); background:var(--green-50); }
.comm-steps li.done b::before{ content:"✓ "; color:var(--green); }
.comm-items td{ vertical-align:top; }
.comm-acts{ flex-wrap:wrap; justify-content:flex-end; gap:4px; }
.comm-acts .btn-sm{ padding:4px 8px; }
@media (max-width: 760px){ .comm-steps{ grid-template-columns:1fr 1fr; } }

/* ---------- v1.11 building control ---------- */
.bc-tabs{ margin-bottom:16px; }
.bc-tabs .tab-btn{ text-decoration:none; display:inline-flex; align-items:center; }
.bc-preview{ margin:8px 0 12px 18px; font-size:13px; color:var(--ink-2); columns:2; column-gap:28px; }
.bc-preview li{ break-inside:avoid; margin-bottom:4px; }
.bc-edit td{ background:var(--grey-50); }
@media (max-width: 760px){ .bc-preview{ columns:1; } .bc-tabs{ overflow-x:auto; flex-wrap:nowrap; } }
.bc-tabs .tab-btn.active{ color:var(--brand); border-bottom-color:var(--brand); }
.comm-items td.comm-acts{ min-width:210px; }

/* ---------- v1.12 snagging ---------- */
.trade-chips{ display:flex; flex-wrap:wrap; gap:8px; }
.snag-list{ display:grid; }
.snag-row{ display:grid; grid-template-columns:64px minmax(0, 1fr) auto; gap:14px; align-items:center; padding:12px 20px; border-top:1px solid var(--line); color:inherit; text-decoration:none; }
.snag-row:hover{ background:var(--grey-50); }
.snag-thumb{ width:64px; height:64px; border-radius:8px; background:var(--grey-50); display:grid; place-items:center; overflow:hidden; color:var(--muted); }
.snag-thumb img{ width:100%; height:100%; object-fit:cover; }
.snag-thumb svg{ width:22px; height:22px; }
.snag-main{ min-width:0; font-size:14px; }
.snag-desc{ display:block; margin:2px 0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.snag-side{ display:flex; flex-direction:column; align-items:flex-end; gap:4px; }
.snag-photos{ display:grid; grid-template-columns:1fr 1fr; gap:16px; margin-bottom:16px; }
.snag-photos figure{ margin:0; padding:14px; }
.snag-photos figcaption{ font-weight:700; margin-bottom:8px; }
.snag-photos img{ width:100%; max-height:420px; object-fit:contain; border-radius:8px; background:var(--grey-50); }
.snag-photos p{ margin:8px 0 0; }
.photo-pick{ display:flex; align-items:center; justify-content:center; gap:10px; border:2px dashed var(--line-2, #cfd6e0); border-radius:12px; padding:18px; cursor:pointer; font-weight:600; color:var(--brand); background:var(--brand-50); }
.photo-pick svg{ width:24px; height:24px; }
.photo-preview{ max-width:100%; max-height:280px; border-radius:10px; margin-top:10px; }
.room-head h1{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.room-num{ background:var(--navy); color:#fff; border-radius:8px; padding:2px 10px; font-size:.85em; }
.sp-bar{ display:flex; gap:14px; align-items:flex-end; flex-wrap:wrap; border-bottom:1px solid var(--line); }
.sp-pages{ margin-left:auto; display:flex; gap:6px; align-items:center; font-size:13px; }
.sp-stage{ overflow:auto; max-height:78vh; padding:0; background:var(--grey-50); }
.sp-wrap{ position:relative; margin:0 auto; }
.sp-layer{ position:absolute; inset:0; cursor:crosshair; }
.sp-pin{ position:absolute; transform:translate(-50%, -50%); min-width:30px; height:30px; padding:0 7px; border-radius:15px; border:2px solid #fff; background:#C2362F; color:#fff; font:700 12px/26px system-ui, sans-serif; box-shadow:0 1px 4px rgba(0,0,0,.35); cursor:pointer; white-space:nowrap; }
.sp-pin.sel{ background:var(--brand); outline:3px solid rgba(26,86,219,.35); }
.sp-pin.pending{ background:#B86E00; pointer-events:none; }
.modal-back{ position:fixed; inset:0; background:rgba(11,26,44,.45); display:grid; place-items:center; z-index:60; padding:16px; }
.modal-back[hidden]{ display:none; }
.modal{ width:min(560px, 100%); max-height:90vh; overflow:auto; margin:0; }
.share-row{ display:flex; flex-wrap:wrap; gap:8px; }
.ok-box{ display:flex; gap:8px; align-items:center; background:var(--green-50); color:var(--green); border-radius:10px; padding:10px 12px; font-weight:600; margin-bottom:12px; }
.ok-box svg{ width:18px; height:18px; }
.qr-print{ display:none; }
@media print{
  body.printing-qr *{ visibility:hidden; }
  body.printing-qr .qr-print, body.printing-qr .qr-print *{ visibility:visible; }
  body.printing-qr .qr-print{ display:grid; position:absolute; left:0; top:0; width:190mm; grid-template-columns:1fr 1fr; gap:6mm; }
  .qr-label{ height:62mm; border:1px dashed #999; border-radius:3mm; display:flex; align-items:center; gap:4mm; padding:4mm; break-inside:avoid; page-break-inside:avoid; }
  .qr-label svg{ width:44mm; height:44mm; flex:none; }
  .qr-num{ font:800 22pt/1 system-ui, sans-serif; }
  .qr-name{ font:700 12pt/1.2 system-ui, sans-serif; margin-top:2mm; }
  .qr-level, .qr-proj{ font:9pt/1.3 system-ui, sans-serif; color:#333; }
  .qr-hint{ font:8pt/1.3 system-ui, sans-serif; color:#555; margin-top:2mm; }
  .sp-stage{ max-height:none; }
}
@media (max-width: 760px){
  .snag-photos{ grid-template-columns:1fr; }
  .snag-row{ grid-template-columns:52px minmax(0, 1fr); padding:10px 14px; }
  .snag-thumb{ width:52px; height:52px; }
  .snag-side{ grid-column:2; flex-direction:row; align-items:center; justify-content:flex-start; }
}
.pub-snag-grid{ display:grid; grid-template-columns:200px minmax(0, 1fr); gap:16px; }
.pub-snag-grid > a img, .pub-snag-grid > .snag-thumb{ width:200px; height:200px; object-fit:cover; border-radius:10px; }
.pub-fix{ display:grid; gap:8px; margin-top:12px; max-width:420px; }
@media (max-width: 640px){ .pub-snag-grid{ grid-template-columns:1fr; } .pub-snag-grid > a img, .pub-snag-grid > .snag-thumb{ width:100%; height:220px; } }
.sp-panel{ position:fixed; bottom:16px; left:50%; transform:translateX(-50%); width:min(760px, calc(100% - 32px)); z-index:40; background:var(--card); border:1px solid var(--line); border-radius:14px; box-shadow:0 10px 30px rgba(11,26,44,.25); }
@media (min-width: 900px){ .sp-panel{ left:calc(50% + 120px); } }

/* ---------- v1.13 project guests ---------- */
body:not(.guest-mode) [data-guest]{ display:none !important; }
body.guest-mode .modules .mod:not([data-guest]), body.guest-mode .nav-label, body.guest-mode #usage{ display:none !important; }
.chip-guest{ background:#fff4e0; color:#8a5300; margin-left:6px; }
.role.guest{ background:#fff4e0; color:#8a5300; }
.select-sm{ padding:4px 8px; font-size:13px; min-height:0; height:auto; }
.folder-list{ display:grid; gap:8px; }
.folder-row{ display:grid; grid-template-columns:auto minmax(0,1fr) auto auto; gap:10px; align-items:center; }
.folder-ic svg{ width:18px; height:18px; color:var(--brand); }
.guest-explain .ge-grid{ display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; }
.guest-explain .ge-grid b{ display:block; margin-bottom:4px; }
.guest-explain .ge-grid span{ font-size:13.5px; color:var(--ink-2); }
.gu-mods{ border:0; padding:0; margin:0; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px 16px; }
.gu-mods legend{ font-weight:600; margin-bottom:8px; font-size:13px; }
.gu-mods .check, .gu-mod-grid .check{ white-space:normal; align-items:flex-start; }
.gu-mod-grid{ display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px 16px; }
.gu-h3{ font-size:14px; margin:16px 0 8px; }
.gu-folders svg{ width:16px; height:16px; vertical-align:-3px; color:var(--brand); }
.guest-projects{ display:grid; grid-template-columns:repeat(auto-fill,minmax(260px,1fr)); gap:16px; }
.guest-project{ text-decoration:none; color:inherit; display:block; }
.guest-project:hover{ border-color:var(--brand); }
.guest-project h2{ font-size:17px; margin:0 0 4px; }
.gp-chips{ display:flex; flex-wrap:wrap; gap:6px; margin-top:10px; }
.gp-tabs{ margin-bottom:16px; }
.g-rfi{ padding:14px 20px; border-top:1px solid var(--line, #e6e8ec); }
.g-rfi-h{ display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.g-q{ margin:8px 0; white-space:pre-wrap; }
.g-a{ background:var(--grey-50); border-radius:8px; padding:10px 12px; margin:8px 0; white-space:pre-wrap; }
.g-a b{ display:block; margin-bottom:4px; font-size:13px; }
.g-snag-h{ display:flex; gap:8px; align-items:center; flex-wrap:wrap; margin-bottom:8px; }
.g-photos{ display:flex; gap:8px; flex-wrap:wrap; margin:8px 0; }
.g-photos img{ width:140px; height:105px; object-fit:cover; border-radius:8px; border:1px solid var(--line, #e6e8ec); }
.g-fix{ display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr) auto; gap:10px; align-items:end; margin-top:8px; }
.g-snag.closed{ opacity:.7; }
.g-cert{ display:flex; gap:6px; align-items:center; flex-wrap:wrap; }
.g-cert .input{ max-width:170px; padding:5px 8px; font-size:13px; }
.g-meet summary{ cursor:pointer; list-style:none; }
.g-meet summary::-webkit-details-marker{ display:none; }
@media (max-width:760px){
  .guest-explain .ge-grid, .gu-mods{ grid-template-columns:1fr; }
  .gu-mod-grid{ grid-template-columns:repeat(2,minmax(0,1fr)); }
  .g-fix{ grid-template-columns:1fr; }
  .folder-row{ grid-template-columns:auto minmax(0,1fr) auto; }
  .folder-row .sub{ display:none !important; }
}
.card-head h2 > svg{ width:18px; height:18px; display:inline-block; vertical-align:-3px; color:var(--brand); }
.gu-folders td svg{ display:inline-block; }

/* ---------- v1.14 project reports ---------- */
.rag{ display:inline-flex; align-items:center; gap:6px; font-weight:700; font-size:13px; padding:4px 10px; border-radius:999px; white-space:nowrap; }
.rag i{ width:10px; height:10px; border-radius:50%; background:currentColor; }
.rag-sm{ font-size:11.5px; padding:2px 8px; font-weight:600; }
.rag-green{ background:#e6f6ec; color:#137a3a; }
.rag-amber{ background:#fff4e0; color:#9a5b00; }
.rag-red{ background:#fdecec; color:#b42318; }
.rag-grey{ background:var(--grey-50); color:var(--muted); }
.rp-bar{ display:flex; justify-content:space-between; align-items:center; gap:12px; margin-bottom:16px; flex-wrap:wrap; }
.report-doc{ background:#fff; border:1px solid var(--line); border-radius:14px; padding:32px 36px; max-width:1100px; }
.rp-head{ display:flex; justify-content:space-between; gap:20px; align-items:flex-start; border-bottom:2px solid var(--ink, #111827); padding-bottom:16px; }
.rp-kind{ font-size:12px; font-weight:700; letter-spacing:.08em; text-transform:uppercase; color:var(--brand); }
.rp-head h1{ font-size:28px; font-weight:800; margin:4px 0; }
.rp-head p{ color:var(--muted); }
.rp-period{ font-size:13px; margin-top:4px; }
.rp-overall{ display:flex; flex-direction:column; align-items:flex-end; gap:6px; }
.rp-overall span{ font-size:12px; color:var(--muted); font-weight:600; text-transform:uppercase; letter-spacing:.06em; }
.rp-overall .rag{ font-size:16px; padding:8px 14px; }
.rp-headline{ font-size:17px; font-weight:600; margin:18px 0 6px; }
.rp-dq{ background:#fff8e6; border:1px solid #f3d38b; border-radius:10px; padding:12px 16px; margin:16px 0; font-size:14px; }
.rp-dq ul{ margin:6px 0 0 18px; }
.rp-sec{ margin-top:28px; break-inside:avoid-page; }
.rp-sec h2{ font-size:19px; font-weight:800; margin-bottom:10px; }
.rp-sec h3{ font-size:14px; font-weight:700; margin:16px 0 8px; }
.rp-sub{ color:var(--ink-2); font-size:14px; margin:-4px 0 10px; }
.rp-kv{ display:grid; grid-template-columns:repeat(auto-fill,minmax(180px,1fr)); gap:10px; }
.rp-kv > div{ border:1px solid var(--line); border-radius:10px; padding:10px 12px; }
.rp-kv span{ display:block; font-size:12px; color:var(--muted); }
.rp-kv b{ font-size:17px; }
.rp-kv .bad b{ color:#b42318; }
.rp-table td, .rp-table th{ font-size:13.5px; }
.rp-ai{ background:var(--grey-50); border-left:3px solid var(--brand); border-radius:8px; padding:10px 14px; margin-top:12px; }
.rp-ai-tag{ font-size:11px; font-weight:700; color:var(--brand); text-transform:uppercase; letter-spacing:.06em; }
.rp-ai p{ margin-top:4px; }
.rp-list{ margin:4px 0 0 18px; }
.rp-list li{ margin:3px 0; }
.rp-two{ display:grid; grid-template-columns:1fr 1fr; gap:24px; }
.rp-chart{ margin:16px 0 4px; }
.rp-chart svg{ width:100%; height:auto; max-width:760px; }
.rp-chart text{ font-size:11px; fill:var(--muted); }
.rp-chart .g{ stroke:var(--line); }
.rp-chart .td{ stroke:#b42318; stroke-dasharray:4 4; }
.rp-chart .pl{ fill:none; stroke:var(--brand); stroke-width:2.5; }
.rp-chart .ac{ fill:none; stroke:#137a3a; stroke-width:2; }
.rp-chart .acp{ fill:#137a3a; }
.rp-chart figcaption{ font-size:12px; color:var(--muted); display:flex; gap:8px; align-items:center; }
.rp-chart figcaption span{ display:inline-block; width:18px; height:3px; margin-left:8px; }
.k-pl{ background:var(--brand); } .k-ac{ background:#137a3a; }
.rp-foot{ margin-top:32px; border-top:1px solid var(--line); padding-top:14px; font-size:12.5px; color:var(--ink-2); }
.rp-foot h2{ font-size:14px; margin-bottom:6px; }
.rp-foot p{ margin:6px 0; }
@media (max-width:760px){
  .report-doc{ padding:18px 16px; }
  .rp-head{ flex-direction:column; }
  .rp-overall{ align-items:flex-start; }
  .rp-two{ grid-template-columns:1fr; }
  .rp-kv{ grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media print{
  .side, .no-print, .toast, .gp-tabs, .crumb, .page-head{ display:none !important; }
  .shell{ display:block !important; }
  body, .main, #view{ background:#fff !important; padding:0 !important; margin:0 !important; }
  .report-doc{ border:0; padding:0; max-width:none; }
  .rp-sec{ break-inside:avoid; }
  .rag, .rp-dq, .rp-ai{ -webkit-print-color-adjust:exact; print-color-adjust:exact; }
}

/* ---------- v1.15 project set-up plans ---------- */
.su-add-h{ display:flex; gap:12px; align-items:flex-end; flex-wrap:wrap; }
.su-doclist{ max-height:320px; overflow:auto; border:1px solid var(--line); border-radius:10px; padding:8px 12px; margin-top:10px; display:grid; gap:6px; }
.su-doclist .check{ white-space:normal; align-items:flex-start; }
.su-auto{ display:grid; gap:6px; font-size:14px; border-top:1px solid var(--line); }
.su-spin{ display:inline-block; width:12px; height:12px; border:2px solid var(--line); border-top-color:var(--brand); border-radius:50%; animation:suspin .8s linear infinite; margin-right:6px; vertical-align:-2px; }
@keyframes suspin{ to{ transform:rotate(360deg); } }
.su-facts{ border:1px solid var(--line); border-radius:10px; padding:8px 12px; margin-bottom:8px; }
.su-facts summary{ cursor:pointer; }
.su-facts ul{ list-style:none; margin:8px 0 0; padding:0; display:grid; gap:6px; }
.su-facts li{ display:grid; grid-template-columns:minmax(0,1fr) auto auto; gap:10px; align-items:start; font-size:14px; border-top:1px solid var(--line); padding-top:6px; }
.su-ref{ font-size:12px; color:var(--muted); }
.su-facts .su-ref{ white-space:nowrap; }
.su-bep{ border-top:1px solid var(--line); }
.su-bep h3{ font-size:15px; margin-bottom:6px; }
.su-bep-choice{ display:flex; gap:18px; align-items:center; flex-wrap:wrap; margin-top:10px; }
.su-plans{ display:grid; grid-template-columns:repeat(auto-fill,minmax(250px,1fr)); gap:14px; }
.su-plan{ margin:0; }
.su-plan-h{ display:flex; gap:8px; align-items:center; flex-wrap:wrap; margin-bottom:10px; }
.su-plan-a{ display:flex; gap:8px; flex-wrap:wrap; margin-bottom:8px; }
.su-gen{ display:flex; gap:6px; flex-wrap:wrap; align-items:center; }
.su-gen .select-sm{ max-width:100%; }
.su-locked{ opacity:.75; }
.setup-doc{ background:#fff; border:1px solid var(--line); border-radius:14px; padding:28px 32px; max-width:1000px; }
.sd-head{ border-bottom:2px solid var(--ink, #111827); padding-bottom:12px; margin-bottom:8px; }
.sd-head h1{ font-size:26px; font-weight:800; margin:4px 0; }
.sd-head p{ color:var(--muted); }
.sd-sec{ margin-top:22px; }
.sd-sec h2{ font-size:18px; font-weight:800; margin-bottom:6px; }
.sd-sec p{ margin:6px 0; }
.sd-sec ul{ margin:6px 0 6px 20px; }
.sd-edit{ width:100%; font-family:inherit; line-height:1.5; margin-top:6px; }
.sd-print-only{ display:none; }
.sd-flag{ background:#fff4e0; color:#8a5300; border-radius:8px; padding:6px 10px; font-size:13px; margin-top:6px; }
.sd-refs{ margin-top:8px; font-size:13px; }
.sd-refs summary{ cursor:pointer; color:var(--brand); font-weight:600; }
.sd-refs ul{ margin:6px 0 0 18px; color:var(--ink-2); }
.su-tbc{ background:#fff1c2; padding:0 3px; border-radius:3px; }
.drm-legend{ display:flex; gap:16px; flex-wrap:wrap; align-items:center; font-size:13px; }
.drm-wrap{ max-height:72vh; }
.drm th, .drm td{ font-size:12.5px; padding:6px 8px; }
.drm thead th{ position:sticky; top:0; background:#fff; z-index:1; }
.drm .drm-el{ min-width:220px; }
.drm .drm-p, .drm .drm-s{ min-width:90px; white-space:normal; line-height:1.2; }
.drm-cell{ text-align:center; }
.drm-code{ width:52px; padding:2px; border:1px solid var(--line); border-radius:6px; }
.drm-stage{ max-width:120px; padding:2px; border:1px solid var(--line); border-radius:6px; font-size:12px; }
.drm-in{ padding:3px 6px; font-size:12.5px; min-width:120px; }
.drm-g td{ background:var(--grey-50); font-weight:700; }
.drm-ai td:first-child{ box-shadow:inset 3px 0 0 var(--brand); }
.drm-c{ display:inline-block; min-width:22px; font-weight:800; border-radius:5px; padding:1px 5px; }
.drm-D{ background:#1f3b6e; color:#fff; } .drm-C{ background:#e7eef8; color:#1f3b6e; } .drm-R{ background:#fff4e0; color:#8a5300; } .drm-A{ background:#e6f6ec; color:#137a3a; } .drm-S{ background:#f1eafc; color:#5b3a9a; }
.drm-parties{ display:grid; grid-template-columns:repeat(auto-fill,minmax(200px,1fr)); gap:10px; align-items:end; }
.tp-list{ display:grid; gap:8px; margin-top:14px; }
.tp-row{ display:grid; grid-template-columns:28px minmax(0,1fr) minmax(0,1.5fr) auto; gap:8px; align-items:center; }
.tp-n{ color:var(--muted); font-weight:700; text-align:right; }
.tp-btns{ display:flex; gap:2px; }
.tp-new{ display:flex; gap:12px; align-items:flex-end; flex-wrap:wrap; }
.tp-std details{ margin-bottom:8px; }
.tp-std ol{ margin:6px 0 0 22px; font-size:14px; }
@media (max-width:760px){
  .setup-doc{ padding:18px 14px; }
  .tp-row{ grid-template-columns:22px minmax(0,1fr); }
  .tp-row input[data-tg], .tp-row .tp-btns{ grid-column:2; }
  .su-facts li{ grid-template-columns:minmax(0,1fr) auto; }
  .su-facts .su-ref{ grid-column:1; white-space:normal; }
}
@media print{
  .setup-doc{ border:0; padding:0; max-width:none; }
  .sd-print-only{ display:block !important; }
  .drm-wrap{ max-height:none; overflow:visible; }
}
.su-plans .card.su-plan{ margin:0; }

/* ---------- v1.16 O&M manuals ---------- */
.om-how{ display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:16px; }
.om-how b{ display:block; margin-bottom:4px; }
.om-how span{ font-size:13.5px; color:var(--ink-2); }
.om-key{ border-color:var(--brand); }
.om-progress{ display:flex; align-items:center; gap:8px; font-weight:600; }
.om-gaps{ margin:0 0 0 18px; display:grid; gap:4px; font-size:14px; }
.om-gaps .om-warn::marker{ color:#b42318; }
.om-items{ padding:0 20px 14px; display:grid; gap:10px; }
.om-item{ border:1px solid var(--line); border-radius:10px; padding:10px 12px; }
.om-item.om-out{ opacity:.55; }
.om-item-h{ display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.om-item-h > svg{ width:16px; height:16px; color:var(--brand); flex:none; }
.om-title{ flex:1 1 260px; padding:4px 8px; font-weight:600; }
.om-src{ display:inline; font-size:12px; }
.om-body{ width:100%; margin-top:8px; font-family:inherit; line-height:1.5; }
.om-text{ margin-top:6px; font-size:14px; }
.om-text p{ margin:4px 0; } .om-text ul{ margin:4px 0 4px 18px; }
.om-none{ margin:0; }
.om-add{ border-top:1px solid var(--line); }
@media (max-width:760px){ .om-how{ grid-template-columns:1fr 1fr; } .om-items{ padding:0 12px 12px; } }

/* v1.17 Planning */
tr.clickable{ cursor:pointer; }
tr.clickable:hover td{ background:var(--bg-soft, #F6F8FB); }
.pl-review{ display:grid; gap:8px; max-height:520px; overflow:auto; padding-right:4px; }
.pl-rv{ display:flex; gap:10px; align-items:flex-start; border:1px solid var(--line); border-radius:10px; padding:10px 12px; font-size:13.5px; cursor:pointer; }
.pl-rv input{ margin-top:3px; }
.pl-rv > span{ display:grid; gap:4px; min-width:0; }
.pl-body{ display:block; font-size:13px; color:var(--ink-2); white-space:pre-wrap; background:var(--bg-soft, #F6F8FB); border-radius:8px; padding:8px 10px; margin:6px 0; }
.pl-conds{ display:grid; }
.pl-cond{ padding:14px 20px; border-top:1px solid var(--line); }
.pl-cond-h{ display:flex; flex-wrap:wrap; gap:8px; align-items:center; }
.pl-cond-f{ display:flex; flex-wrap:wrap; gap:12px; align-items:flex-end; margin-top:8px; }
.pl-cond-f .field{ min-width:160px; }
@media (max-width:760px){ .pl-cond{ padding:12px 14px; } .pl-cond-f .field{ min-width:0; flex:1 1 140px; } }

/* ---------------- v1.19 Project folders ---------------- */
.page-head h1 > svg{ width:24px; height:24px; display:inline-block; vertical-align:-3px; margin-right:8px; color:var(--brand); }
.hub-grid{ display:grid; grid-template-columns:repeat(auto-fill, minmax(280px, 1fr)); gap:18px; }
.hub-folder{ position:relative; display:flex; flex-direction:column; gap:12px; background:var(--card); border:1px solid var(--line); border-radius:4px 14px 14px 14px; padding:18px; text-decoration:none; color:inherit; box-shadow:var(--shadow); transition:border-color .15s, transform .15s; margin-top:10px; }
.hub-folder:hover{ border-color:var(--brand-100); transform:translateY(-1px); }
.hub-tab{ position:absolute; top:-10px; left:-1px; width:96px; height:12px; background:var(--card); border:1px solid var(--line); border-bottom:0; border-radius:8px 10px 0 0; }
.hub-folder:hover .hub-tab{ border-color:var(--brand-100); }
.hub-top{ display:flex; gap:12px; align-items:flex-start; }
.hub-top > svg{ width:34px; height:34px; flex-shrink:0; color:var(--brand); background:var(--brand-50); border-radius:10px; padding:7px; }
.hub-top h3{ font-size:16px; font-weight:700; }
.hub-top p{ font-size:13px; color:var(--muted); margin-top:2px; }
.hub-meta{ display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.hub-chips{ display:flex; flex-wrap:wrap; gap:6px; }
.hub-chips span{ font-size:12px; font-weight:600; background:var(--grey-50); color:var(--ink-2); border-radius:999px; padding:3px 9px; }
.hub-chips span.bad{ background:var(--red-50); color:var(--red); }
.hub-layout{ display:grid; grid-template-columns:minmax(0, 1fr) 320px; gap:20px; align-items:start; }
.hub-group{ margin-bottom:22px; }
.hub-group h2{ display:flex; align-items:center; gap:8px; font-size:13px; text-transform:uppercase; letter-spacing:.06em; color:var(--muted); font-weight:700; margin-bottom:10px; }
.hub-group h2 svg{ width:16px; height:16px; }
.hub-tiles{ display:grid; grid-template-columns:repeat(auto-fill, minmax(220px, 1fr)); gap:10px; }
.hub-tile{ display:flex; gap:12px; align-items:flex-start; background:var(--card); border:1px solid var(--line); border-radius:12px; padding:13px 14px; text-decoration:none; color:inherit; transition:border-color .15s; }
.hub-tile:hover{ border-color:var(--brand); }
.hub-tile > svg{ width:20px; height:20px; color:var(--brand); flex-shrink:0; margin-top:2px; }
.hub-tile b{ display:block; font-size:14px; }
.hub-tile span{ display:block; font-size:12.5px; color:var(--muted); margin-top:2px; }
.hub-tile.warn{ border-color:#F3C4C1; }
.hub-tile.warn span{ color:var(--red); }
.hub-tile.locked{ opacity:.55; }
.hub-tile.locked > svg{ color:var(--muted); }
.hub-tree{ list-style:none; margin:0; padding:8px; }
.hub-tree a{ display:flex; align-items:center; gap:10px; padding:8px 10px; border-radius:8px; text-decoration:none; color:var(--ink); font-size:14px; }
.hub-tree a:hover{ background:var(--bg); }
.hub-tree svg{ width:17px; height:17px; color:var(--amber); flex-shrink:0; }
.hub-tree span{ flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.hub-tree em{ font-style:normal; font-size:12px; font-weight:700; color:var(--muted); background:var(--grey-50); border-radius:999px; padding:1px 8px; }
.hub-events{ list-style:none; margin:0; padding:6px 16px 12px; }
.hub-events li{ padding:9px 0; border-bottom:1px solid var(--line); font-size:13px; }
.hub-events li:last-child{ border-bottom:0; }
.hub-events b{ display:block; }
.hub-events span{ display:block; color:var(--ink-2); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.hub-events em{ font-style:normal; font-size:12px; color:var(--muted); }
@media (max-width: 980px){ .hub-layout{ grid-template-columns:1fr; } }

/* ---------------- v1.19 Integrations ---------------- */
.int-jump{ display:flex; gap:8px; flex-wrap:wrap; margin-bottom:16px; }
.int-jump a{ font-size:13px; font-weight:600; text-decoration:none; background:var(--card); border:1px solid var(--line); border-radius:999px; padding:6px 12px; color:var(--ink-2); }
.int-jump a:hover{ border-color:var(--brand); color:var(--brand); }
.int-card{ margin-bottom:18px; scroll-margin-top:16px; }
.int-form{ display:grid; gap:14px; }
.int-row{ display:grid; grid-template-columns:repeat(auto-fit, minmax(200px, 1fr)); gap:12px; }
.int-events{ border:1px solid var(--line); border-radius:10px; padding:12px 14px; margin:0; display:flex; flex-wrap:wrap; gap:8px 18px; }
.int-events legend{ font-size:13px; font-weight:700; padding:0 6px; }
.int-help summary{ cursor:pointer; font-weight:600; font-size:14px; }
.int-help p{ font-size:13.5px; color:var(--ink-2); margin-top:8px; }
.int-code{ background:var(--navy); color:#E6EEF8; border-radius:8px; padding:12px 14px; font-size:12.5px; overflow-x:auto; margin:10px 0 0; }
.int-banner{ display:flex; align-items:center; gap:10px; border-radius:10px; padding:12px 16px; margin-bottom:16px; font-weight:600; font-size:14px; }
.int-banner svg{ width:18px; height:18px; flex-shrink:0; }
.int-banner.ok{ background:var(--green-50); color:#0a5c3d; }
.int-banner.err{ background:var(--red-50); color:var(--red); }
.int-keyshow{ margin:16px 20px; flex-wrap:wrap; }
.int-keyshow > div{ flex:1; min-width:220px; }
.int-keyshow code{ display:block; font-size:13px; word-break:break-all; margin-top:4px; color:var(--ink); }
.int-url{ font-size:12.5px; min-width:260px; }
.int-off{ color:var(--amber); }
.int-err{ display:flex; gap:8px; align-items:flex-start; color:var(--red); font-size:13.5px; margin-top:6px; }
.int-err svg{ width:16px; height:16px; flex-shrink:0; margin-top:2px; }
.int-secret{ display:flex; gap:10px; align-items:center; flex-wrap:wrap; font-size:13px; }
.int-secret code{ word-break:break-all; }
.int-log > td{ background:var(--bg); }
.int-logt td{ padding:7px 10px; font-size:13px; }
.int-accts{ display:grid; grid-template-columns:repeat(auto-fit, minmax(300px, 1fr)); gap:16px; }
.int-acct{ border:1px solid var(--line); border-radius:12px; padding:16px; display:grid; gap:10px; align-content:start; }
.int-acct h3{ font-size:15px; display:flex; gap:8px; align-items:center; }
.int-acct .card-body{ padding:0; }
.int-sub{ font-size:15px; margin:22px 0 10px; }
@media (max-width: 720px){ .int-url{ min-width:180px; } .int-card .card-head .toolbar{ width:100%; } }
a.stat{ text-decoration:none; color:inherit; display:block; }

/* ---------------- v1.20 AI agent ---------------- */
.ag-tabs .tab-btn em{ font-style:normal; font-size:11.5px; font-weight:700; background:var(--brand-50); color:var(--brand); border-radius:999px; padding:1px 7px; margin-left:6px; }
.ag-tabs .tab-btn em.bad{ background:var(--red-50); color:var(--red); }
.ag-chat{ display:grid; grid-template-columns:260px minmax(0, 1fr); gap:16px; align-items:stretch; }
.ag-threads ul{ list-style:none; margin:0; padding:6px; max-height:62vh; overflow:auto; }
.ag-threads a{ display:block; padding:9px 10px; border-radius:8px; text-decoration:none; color:var(--ink); }
.ag-threads a:hover{ background:var(--bg); }
.ag-threads a.active{ background:var(--brand-50); }
.ag-threads a span{ display:block; font-size:13.5px; font-weight:600; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.ag-threads a em{ display:block; font-style:normal; font-size:12px; color:var(--muted); }
.ag-main{ display:flex; flex-direction:column; min-height:62vh; }
.ag-msgs{ flex:1; overflow:auto; padding:18px 20px; display:flex; flex-direction:column; gap:14px; max-height:62vh; }
.ag-msg{ display:flex; gap:10px; align-items:flex-start; max-width:100%; }
.ag-msg.me{ flex-direction:column; align-items:flex-end; }
.ag-msg.me .ag-bubble{ background:var(--brand); color:#fff; border-radius:14px 14px 4px 14px; max-width:80%; }
.ag-msg.bot .ag-bubble{ background:var(--bg); border:1px solid var(--line); border-radius:4px 14px 14px 14px; min-width:0; flex:1; }
.ag-bubble{ padding:10px 14px; font-size:14.5px; overflow-wrap:anywhere; }
.ag-bubble p{ margin:0 0 8px; } .ag-bubble p:last-child{ margin-bottom:0; }
.ag-bubble ul{ margin:4px 0 8px; padding-left:20px; } .ag-bubble li{ margin:3px 0; }
.ag-avatar{ width:30px; height:30px; border-radius:50%; background:var(--brand-50); color:var(--brand); display:grid; place-items:center; flex-shrink:0; }
.ag-avatar svg{ width:16px; height:16px; }
.ag-sources{ margin-top:10px; padding-top:8px; border-top:1px dashed var(--line-2); font-size:12.5px; display:flex; flex-wrap:wrap; gap:4px 12px; }
.ag-sources b{ width:100%; color:var(--muted); font-weight:600; }
.ag-steps{ margin-top:8px; font-size:12.5px; color:var(--muted); }
.ag-steps summary{ cursor:pointer; }
.ag-steps ul{ margin:6px 0 0; }
.ag-compose{ display:flex; gap:10px; padding:12px 16px; border-top:1px solid var(--line); align-items:flex-end; }
.ag-compose textarea{ resize:vertical; min-height:44px; }
.ag-foot{ padding:0 16px 12px; }
.ag-welcome{ margin:auto; text-align:center; max-width:620px; padding:20px 0; }
.ag-welcome > svg{ width:34px; height:34px; color:var(--brand); margin:0 auto 8px; }
.ag-welcome h3{ font-size:18px; margin-bottom:4px; }
.ag-suggest{ display:flex; flex-wrap:wrap; gap:8px; justify-content:center; margin-top:14px; }
.ag-suggest .btn{ white-space:normal; text-align:left; font-weight:500; }
.ag-dots{ display:inline-flex; gap:3px; margin-right:6px; vertical-align:middle; }
.ag-dots i{ width:6px; height:6px; border-radius:50%; background:var(--brand); animation:agdot 1s infinite ease-in-out; }
.ag-dots i:nth-child(2){ animation-delay:.15s; } .ag-dots i:nth-child(3){ animation-delay:.3s; }
@keyframes agdot{ 0%, 80%, 100%{ opacity:.25; transform:translateY(0); } 40%{ opacity:1; transform:translateY(-3px); } }
@media (prefers-reduced-motion: reduce){ .ag-dots i{ animation:none; } }
.ag-note{ display:flex; gap:8px; align-items:center; font-size:13.5px; background:var(--green-50); color:#0a5c3d; border-radius:10px; padding:8px 12px; }
.ag-note.err{ background:var(--red-50); color:var(--red); }
.ag-note svg{ width:16px; height:16px; flex-shrink:0; }
.ag-draft{ margin-bottom:14px; }
.ag-draft h2 .badge{ margin-right:6px; vertical-align:2px; }
.ag-fields{ display:grid; grid-template-columns:repeat(auto-fit, minmax(200px, 1fr)); gap:12px; }
.ag-fields .ag-wide{ grid-column:1 / -1; }
.ag-alerts{ list-style:none; margin:0; padding:0; }
.ag-alert{ display:flex; gap:12px; align-items:flex-start; padding:12px 20px; border-top:1px solid var(--line); }
.ag-alert > div{ flex:1; min-width:0; }
.ag-alert a{ color:var(--ink); text-decoration:none; } .ag-alert a:hover b{ color:var(--brand); }
.ag-alert.sev-high{ box-shadow:inset 3px 0 0 var(--red); }
.ag-md p{ margin:0 0 8px; } .ag-md ul{ margin:4px 0 8px; padding-left:20px; }
.ag-brief{ margin-top:14px; }
.ag-ch{ padding:14px 0; border-top:1px solid var(--line); } .ag-ch:first-child{ border-top:0; padding-top:0; }
.ag-ch h3{ display:flex; gap:8px; align-items:center; font-size:15px; margin-bottom:6px; }
.ag-ch h3 svg{ width:17px; height:17px; color:var(--brand); }
.ag-ch p{ font-size:14px; margin-top:4px; }
.ag-list{ list-style:none; margin:8px 0; padding:0; display:grid; gap:8px; }
.ag-step{ margin-top:6px; font-size:13px; display:grid; gap:6px; }
.ag-step code{ word-break:break-all; }
.ag-howto{ font-size:13.5px; margin:8px 0 12px; padding-left:20px; }
.ag-howto li{ margin:4px 0; }
.page-head h1 > svg{ width:24px; height:24px; display:inline-block; vertical-align:-3px; margin-right:8px; color:var(--brand); }
@media (max-width: 860px){
  .ag-chat{ grid-template-columns:1fr; }
  .ag-threads ul{ max-height:180px; }
  .ag-main{ min-height:0; }
  .ag-msgs{ max-height:none; min-height:320px; }
  .ag-msg.me .ag-bubble{ max-width:92%; }
}
/* v1.20 agent mascot */
img.ag-avatar{ width:34px; height:34px; border-radius:50%; object-fit:cover; flex-shrink:0; box-shadow:0 1px 3px rgba(11,26,44,.18); }
.page-head h1 > img.ag-h1{ width:40px; height:40px; border-radius:12px; object-fit:cover; display:inline-block; vertical-align:-9px; margin-right:10px; }
img.ag-cardimg{ width:40px; height:40px; border-radius:12px; object-fit:cover; flex-shrink:0; }
.ag-welcome img.ag-hero{ width:160px; height:160px; border-radius:28px; margin:0 auto 12px; display:block; box-shadow:0 10px 30px rgba(26,86,219,.25); }
@media (prefers-reduced-motion: no-preference){ .ag-welcome img.ag-hero{ animation:agbob 3.2s ease-in-out infinite; } @keyframes agbob{ 0%,100%{ transform:translateY(0); } 50%{ transform:translateY(-6px); } } }

/* ---------- v1.21 Utilities ---------- */
.sr-only{ position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }
.ut-grid{ display:grid; grid-template-columns:repeat(auto-fill, minmax(300px, 1fr)); gap:16px; }
.ut-util{ display:flex; flex-direction:column; gap:10px; border:1px solid var(--line); border-radius:12px; padding:16px; background:var(--card); }
.ut-util-head{ display:flex; justify-content:space-between; align-items:center; gap:8px; }
.ut-util-head h3{ font-size:16px; }
.ut-util .btn{ align-self:flex-start; }
.ut-op{ border:1px solid var(--line); border-radius:10px; padding:12px 14px; background:var(--bg); display:flex; flex-direction:column; gap:6px; }
.ut-op-head{ display:flex; flex-wrap:wrap; align-items:center; gap:8px; }
.ut-op-head .hint{ flex-basis:100%; }
.ut-dl{ display:grid; grid-template-columns:auto 1fr; gap:4px 12px; margin:2px 0; font-size:14px; }
.ut-dl dt{ color:var(--muted); }
.ut-dl dd{ margin:0; overflow-wrap:anywhere; }
.ut-dl a, .ut-src a{ color:var(--brand); }
.ut-list{ display:grid; grid-template-columns:repeat(auto-fill, minmax(320px, 1fr)); gap:14px; }
.ut-filters{ display:grid; grid-template-columns:2fr 1fr 1fr 1fr; gap:10px; padding-bottom:0; }
.ut-sub{ font-size:14px; text-transform:uppercase; letter-spacing:.05em; color:var(--muted); margin-top:6px; }
.ut-history{ list-style:none; margin:8px 0 12px; padding:0; display:grid; gap:6px; font-size:14px; }
.ut-note{ display:flex; gap:8px; }
.ut-note .input{ flex:1; }
.ut-regions{ display:flex; flex-wrap:wrap; gap:6px 16px; border:0; padding:0; margin:0; }
.ut-regions legend{ font-size:13px; color:var(--muted); margin-bottom:6px; }
tr.selected td{ background:var(--brand-50); }
@media (max-width:760px){ .ut-filters{ grid-template-columns:1fr; } .ut-note{ flex-direction:column; } }

/* ---------- v1.22 Measured take-off from PDF geometry ---------- */
.ms-layout{ display:grid; grid-template-columns:minmax(0, 1.35fr) minmax(360px, 1fr); gap:18px; align-items:start; }
.ms-sheet{ position:sticky; top:12px; }
.ms-tools{ display:flex; flex-wrap:wrap; gap:8px; align-items:center; padding:12px 14px; border-bottom:1px solid var(--line); }
.ms-tools .btn.active{ background:var(--brand-50); color:var(--brand); }
.ms-canvas{ position:relative; overflow:auto; max-height:78vh; background:#fff; }
.ms-canvas canvas{ display:block; width:100%; height:auto; }
.ms-canvas #ms-over{ position:absolute; left:0; top:0; touch-action:none; }
.ms-canvas.zoom canvas{ width:300%; }
.ms-side{ display:flex; flex-direction:column; gap:0; min-width:0; }
.ms-scale{ display:flex; gap:8px; align-items:flex-end; flex-wrap:wrap; margin-top:8px; }
.ms-inline{ display:flex; align-items:center; gap:6px; margin:0; }
.ms-inline .input, .ms-inline .select{ width:auto; min-width:90px; }
.ms-scale-now{ margin-top:10px; }
.ms-table td{ vertical-align:top; }
.ms-table tr[data-sel]{ cursor:pointer; }
.ms-sw{ display:inline-block; width:12px; height:12px; border-radius:3px; margin-right:6px; vertical-align:-1px; border:1px solid rgba(0,0,0,.15); }
.ms-as .input{ min-width:160px; }
.ms-allow{ display:flex; gap:10px; margin-top:6px; font-size:13px; color:var(--muted); }
.ms-allow label{ display:flex; align-items:center; gap:4px; }
.ms-allow .input{ width:64px; min-width:0; padding:4px 6px; }
@media (max-width:1100px){ .ms-layout{ grid-template-columns:minmax(0,1fr); } .ms-sheet{ position:static; } }
