:root {
  --ink: #16233a; --ink-2: #3c4a60; --muted: #6b778a; --line: #e2e5ea; --line-2: #eef0f3;
  --bg: #f5f6f8; --surface: #ffffff; --side: #16233a; --side-ink: #c9d2e0;
  --accent: #f2b705; --accent-ink: #16233a; --accent-soft: #fff6d6;
  --blue: #2457c5; --blue-soft: #e7eefc;
  --good: #16794a; --good-soft: #e3f4ea;
  --warn: #9a5b00; --warn-soft: #fff1d9;
  --bad: #c0362c; --bad-soft: #fde8e6;
  --gray-soft: #eceff3;
  --radius: 10px; --shadow: 0 1px 2px rgba(22,35,58,.06), 0 2px 8px rgba(22,35,58,.05);
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 14px/1.45 var(--font); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2 { margin: 0; letter-spacing: -.01em; }
h1 { font-size: 24px; font-weight: 700; }
h2 { font-size: 15px; font-weight: 650; }
hr { border: 0; border-top: 1px solid rgba(255,255,255,.1); margin: 8px 0; }
.ico { width: 18px; height: 18px; flex: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-size: 12.5px; white-space: nowrap; }
.strong { font-weight: 650; }
.bad { color: var(--bad); } .good { color: var(--good); } .warn { color: var(--warn); }
.r { text-align: right; } .nowrap { white-space: nowrap; }

/* shell */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.sidebar { background: var(--side); color: var(--side-ink); padding: 18px 14px; display: flex; flex-direction: column; gap: 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 750; font-size: 18px; letter-spacing: -.02em; padding: 2px 6px; }
.brand:hover { text-decoration: none; }
.brand .ico { width: 28px; height: 28px; }
.switcher select { width: 100%; background: rgba(255,255,255,.08); color: #fff; border: 1px solid rgba(255,255,255,.14); border-radius: 8px; padding: 8px 10px; font: inherit; }
.switcher option { color: var(--ink); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--side-ink); font-weight: 500; }
.nav-item:hover { background: rgba(255,255,255,.07); color: #fff; text-decoration: none; }
.nav-item.active { background: rgba(242,183,5,.16); color: #fff; box-shadow: inset 3px 0 0 var(--accent); }
.count { margin-left: auto; font-size: 11.5px; background: rgba(255,255,255,.12); padding: 1px 7px; border-radius: 99px; color: #fff; }
.count-hot { background: var(--bad); }
.reset { margin-top: auto; background: none; border: 1px solid rgba(255,255,255,.18); color: var(--side-ink); border-radius: 8px; padding: 7px; font: inherit; font-size: 12.5px; cursor: pointer; }
.reset:hover { color: #fff; border-color: rgba(255,255,255,.35); }
.main { padding: 28px 32px 48px; max-width: 1360px; width: 100%; outline: none; min-width: 0; }

/* header */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.crumb { font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
.crumb a { color: var(--muted); }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.lede { color: var(--ink-2); max-width: 760px; margin: -6px 0 18px; }
.lede.small { font-size: 12.5px; color: var(--muted); margin: -4px 0 12px; }
.back { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; margin: -10px 0 14px; color: var(--muted); }
.back .ico { transform: rotate(180deg); width: 14px; height: 14px; }

/* buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-weight: 600; font-size: 13px; border-radius: 8px; padding: 8px 13px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: #c8cdd5; background: #fafbfc; }
.btn .ico { width: 16px; height: 16px; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: #e3aa00; border-color: #e3aa00; }
.btn-danger { color: var(--bad); }
.btn-danger:hover { background: var(--bad-soft); border-color: #f2c2bd; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-xs { padding: 4px 9px; font-size: 12px; }
.btn-xs + .btn-xs { margin-left: 4px; }
.icon-btn { border: 0; background: none; font-size: 22px; line-height: 1; cursor: pointer; color: var(--muted); padding: 2px 6px; border-radius: 6px; }
.icon-btn:hover { background: var(--line-2); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* kpis & cards */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 20px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.kpi-label { font-size: 12px; color: var(--muted); font-weight: 550; text-transform: uppercase; letter-spacing: .04em; }
.kpi-value { font-size: 24px; font-weight: 700; margin-top: 4px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.kpi.bad .kpi-value { color: var(--bad); } .kpi.good .kpi-value { color: var(--good); } .kpi.warn .kpi-value { color: var(--warn); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 18px; box-shadow: var(--shadow); color: inherit; display: block; }
.project-card:hover { text-decoration: none; border-color: #c8cdd5; transform: translateY(-1px); transition: .15s; }
.project-card h2 { font-size: 17px; margin: 8px 0 2px; }
.project-card p { margin: 0 0 14px; font-size: 13px; }
.pc-top { display: flex; justify-content: space-between; align-items: center; }
.pc-meta { display: flex; justify-content: space-between; font-size: 12px; margin-top: 6px; }
.pc-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; margin: 16px 0 0; padding-top: 14px; border-top: 1px solid var(--line-2); }
.pc-stats dt, .facts dt { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.pc-stats dd, .facts dd { margin: 2px 0 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.meter { height: 8px; background: var(--line-2); border-radius: 99px; overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--ink); border-radius: 99px; }
.meter-sm { height: 6px; min-width: 70px; }
.meter-sm span { background: var(--blue); }

/* pills */
.pill { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: var(--gray-soft); color: var(--ink-2); white-space: nowrap; }
.pill-open, .pill-submitted, .pill-on-track, .pill-construction { background: var(--blue-soft); color: var(--blue); }
.pill-approved, .pill-closed, .pill-done, .pill-answered { background: var(--good-soft); color: var(--good); }
.pill-pending, .pill-revise, .pill-behind, .pill-medium, .pill-ready, .pill-preconstruction { background: var(--warn-soft); color: var(--warn); }
.pill-rejected, .pill-late, .pill-high { background: var(--bad-soft); color: var(--bad); }
.pill-draft, .pill-upcoming, .pill-low, .pill-closeout { background: var(--gray-soft); color: var(--ink-2); }

/* panels */
.split { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; align-items: start; }
.split-detail { grid-template-columns: 1.6fr 1fr; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 18px; box-shadow: var(--shadow); min-width: 0; }
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; gap: 8px; }
.panel-head:not(:first-child) { margin-top: 22px; }
.panel-head h2 { display: flex; align-items: center; gap: 8px; }
.panel-head a { font-size: 13px; }
.rows { list-style: none; margin: 0; padding: 0; }
.rows li { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line-2); font-size: 13.5px; }
.rows li:last-child { border-bottom: 0; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 18px; margin: 0; }
.facts-1 { grid-template-columns: 1fr; }
.insights { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ins a { display: grid; grid-template-columns: 68px 1fr 18px; gap: 12px; align-items: center; padding: 11px 12px; border-radius: 9px; border: 1px solid var(--line); color: inherit; border-left-width: 4px; }
.ins a:hover { text-decoration: none; background: #fafbfc; }
.ins p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.ins .ico { color: var(--muted); width: 16px; }
.sev { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; text-align: center; padding: 3px 0; border-radius: 6px; }
.ins-high a { border-left-color: var(--bad); } .ins-high .sev { background: var(--bad-soft); color: var(--bad); }
.ins-medium a { border-left-color: #e0a100; } .ins-medium .sev { background: var(--warn-soft); color: var(--warn); }
.ins-low a { border-left-color: #a9b2bf; } .ins-low .sev { background: var(--gray-soft); color: var(--ink-2); }

/* lists */
.toolbar { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; align-items: center; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { font: inherit; font-size: 12.5px; border: 1px solid var(--line); background: var(--surface); padding: 5px 11px; border-radius: 99px; cursor: pointer; color: var(--ink-2); }
.chip b { font-weight: 600; color: var(--muted); margin-left: 3px; }
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip.on b { color: var(--accent); }
.search { font: inherit; padding: 7px 12px; border: 1px solid var(--line); border-radius: 8px; min-width: 240px; background: var(--surface); }
.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow-x: auto; box-shadow: var(--shadow); }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.table th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; padding: 10px 14px; border-bottom: 1px solid var(--line); background: #fafbfc; white-space: nowrap; }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tbody tr { cursor: pointer; }
.table tbody tr:hover { background: #f8f9fb; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tfoot td { font-weight: 700; border-top: 2px solid var(--line); padding: 12px 14px; }
.table .clip { max-width: 280px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-bad td:first-child { box-shadow: inset 3px 0 0 var(--bad); }
.empty { text-align: center; padding: 36px 16px; }
.empty p { margin: 4px 0 0; }

/* rfi detail */
.question { font-size: 15px; margin: 0 0 6px; white-space: pre-wrap; }
.thread { list-style: none; padding: 0; margin: 0 0 16px; display: flex; flex-direction: column; gap: 10px; }
.thread li { border: 1px solid var(--line); border-radius: 9px; padding: 12px 14px; }
.thread li.official { border-color: #b7dfc7; background: #f5fbf7; }
.thread .who { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 13px; }
.thread p { margin: 6px 0 0; white-space: pre-wrap; }
.reply { display: flex; flex-direction: column; gap: 10px; border-top: 1px solid var(--line-2); padding-top: 14px; }
.reply .btn { align-self: flex-start; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: end; }
label { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
label.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; padding-bottom: 8px; }
input, select, textarea { font: inherit; font-size: 14px; font-weight: 400; color: var(--ink); padding: 8px 10px; border: 1px solid #d3d8df; border-radius: 8px; background: #fff; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--blue-soft); border-color: var(--blue); }
.req { color: var(--bad); }

/* modal */
.modal { border: 0; border-radius: 14px; padding: 0; width: min(640px, calc(100vw - 32px)); box-shadow: 0 20px 60px rgba(22,35,58,.3); color: var(--ink); }
.modal::backdrop { background: rgba(22,35,58,.45); }
.modal-form header, .modal-form footer { display: flex; align-items: center; gap: 8px; padding: 16px 20px; }
.modal-form header { justify-content: space-between; border-bottom: 1px solid var(--line-2); }
.modal-form footer { border-top: 1px solid var(--line-2); background: #fafbfc; }
.spacer { flex: 1; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 18px 20px; max-height: 65vh; overflow-y: auto; }
.form-grid .wide { grid-column: 1 / -1; }

/* gantt */
.gantt { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); overflow-x: auto; }
.g-row { display: grid; grid-template-columns: 260px minmax(520px, 1fr); border-bottom: 1px solid var(--line-2); cursor: pointer; }
.g-row:last-child { border-bottom: 0; }
.g-row:not(.g-head):hover { background: #f8f9fb; }
.g-head { cursor: default; background: #fafbfc; font-size: 11.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.g-name { padding: 10px 14px; display: flex; flex-direction: column; border-right: 1px solid var(--line-2); min-width: 0; }
.g-name span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 550; }
.g-name small { font-size: 11.5px; }
.g-head .g-name { padding: 10px 14px; }
.g-track { position: relative; min-height: 46px; margin: 0 12px; }
.g-month { position: absolute; top: 12px; white-space: nowrap; padding-left: 4px; border-left: 1px solid var(--line); }
.g-bar { position: absolute; top: 14px; height: 18px; border-radius: 5px; overflow: hidden; }
.g-bar em { display: block; height: 100%; background: rgba(0,0,0,.28); }
.g-group { cursor: default; background: var(--surface-2, #f4f6f9); }
.g-group:hover { background: var(--surface-2, #f4f6f9) !important; }
.g-group .g-name { padding: 6px 14px; font-size: 12.5px; }
.g-id { font-size: 11px; color: var(--muted, #667085); margin-right: 2px; }
.g-base { position: absolute; top: 34px; height: 4px; border-radius: 2px; background: #98a2b3; opacity: .7; }
.g-crit { box-shadow: 0 0 0 2px #d92d20; }
.import-summary { display: flex; gap: 18px; flex-wrap: wrap; list-style: none; padding: 0; margin: 8px 0; }
.g-ms { position: absolute; top: 15px; width: 16px; height: 16px; transform: translateX(-8px) rotate(45deg); border-radius: 2px; }
.g-today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--bad); opacity: .75; }
.g-done { background: #5fae84; } .g-on-track { background: #6b93e0; } .g-behind { background: #e6a91e; } .g-late { background: #d9584d; } .g-upcoming { background: #b9c2cf; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); margin-top: 12px; }
.legend span { display: flex; align-items: center; gap: 6px; }
.legend i { width: 14px; height: 10px; border-radius: 3px; display: inline-block; }
.g-today-key { background: var(--bad); width: 2px !important; height: 14px !important; }


/* signed-out shell + sign-in */
.shell.signed-out { grid-template-columns: 1fr; }
.shell.signed-out .sidebar { display: none; }
.shell.signed-out .main { max-width: none; padding: 0; }
.signin { min-height: 100vh; display: grid; grid-template-columns: minmax(320px, 460px) minmax(280px, 420px); justify-content: center; align-content: center; gap: 28px; padding: 32px 16px; background: radial-gradient(1200px 600px at 10% -10%, #fff6d6 0, transparent 60%), var(--bg); }
.signin:not(:has(.signin-demo)) { grid-template-columns: minmax(320px, 440px); }
.signin-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 32px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 16px; }
.signin-card h1 { font-size: 22px; }
.signin-card form { display: flex; flex-direction: column; gap: 14px; }
.signin-card .who { margin: -8px 0 0; }
.signin-card .fine { font-size: 12px; margin: 0; }
.signin-brand { display: flex; align-items: center; gap: 10px; font-weight: 750; font-size: 18px; color: var(--ink); }
.signin-brand .ico { width: 28px; height: 28px; }
.signin-brand:hover { text-decoration: none; }
.btn-block { width: 100%; justify-content: center; padding: 10px 14px; font-size: 14px; }
.btn[disabled] { opacity: .6; cursor: progress; }
.alert { background: var(--bad-soft); color: var(--bad); border: 1px solid #f2c2bd; border-radius: 8px; padding: 10px 12px; font-size: 13px; }
.signin-demo { background: var(--side); color: var(--side-ink); border-radius: 16px; padding: 24px; font-size: 13px; }
.signin-demo p { margin: 0 0 10px; }
.signin-demo code { background: rgba(255,255,255,.12); color: #fff; padding: 1px 6px; border-radius: 5px; }
.proto-badge { display: inline-block; background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; padding: 3px 8px; border-radius: 6px; margin-bottom: 12px; }
.demo-users { list-style: none; padding: 0; margin: 14px 0 0; display: flex; flex-direction: column; gap: 6px; }
.demo-users button { width: 100%; text-align: left; font: inherit; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); color: #fff; border-radius: 9px; padding: 9px 12px; cursor: pointer; display: flex; flex-direction: column; gap: 1px; }
.demo-users button:hover { background: rgba(255,255,255,.12); }
.demo-users span { color: var(--side-ink); font-size: 12px; }

/* signed-in user */
.me { display: flex; align-items: center; gap: 10px; margin-top: auto; padding: 10px 6px 0; border-top: 1px solid rgba(255,255,255,.1); }
.me-text { display: flex; flex-direction: column; min-width: 0; font-size: 12.5px; line-height: 1.3; }
.me-text strong { color: #fff; }
.me-text span { color: var(--side-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-out { margin-left: auto; color: var(--side-ink); }
.me-out:hover { background: rgba(255,255,255,.1); color: #fff; }
.me + .reset { margin-top: 0; }
.avatar { flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 12px; display: inline-grid; place-items: center; }
.avatar-sm { width: 26px; height: 26px; font-size: 10.5px; background: var(--blue-soft); color: var(--blue); }
.person { display: inline-flex; align-items: center; gap: 8px; }
.ro-badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: var(--muted); background: var(--gray-soft); padding: 6px 10px; border-radius: 8px; }
.ro-badge .ico { width: 14px; height: 14px; }
.small { font-size: 12px; }
.audit { margin: 16px 0 0; padding-top: 12px; border-top: 1px solid var(--line-2); }
.stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.activity { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; font-size: 13.5px; }
.activity li { display: flex; gap: 10px; align-items: flex-start; }
.table tr.static { cursor: default; }
.section-title { font-size: 16px; margin: 28px 0 10px; }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.section-head .section-title { margin-bottom: 10px; }
.page-head + .section-title, .catalog > div:first-child .section-title { margin-top: 0; }
code { font-family: var(--mono); font-size: 12px; background: var(--gray-soft); padding: 1px 5px; border-radius: 4px; }

/* permission matrix */
.matrix td, .matrix th { text-align: center; }
.matrix td:first-child, .matrix th:first-child { text-align: left; min-width: 220px; }
.lvl { font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 6px; white-space: nowrap; }
.lvl-none { color: #a3acb9; }
.lvl-read { background: var(--blue-soft); color: var(--blue); }
.lvl-standard { background: var(--good-soft); color: var(--good); }
.lvl-admin { background: var(--ink); color: #fff; }

/* integrations */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.cat { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; box-shadow: var(--shadow); }
.cat header { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.cat p { margin: 8px 0 0; font-size: 13px; }
.cat.server { background: #fafbfc; box-shadow: none; }

/* form additions */
.form-note { margin: 0; padding: 12px 20px; background: var(--accent-soft); font-size: 12.5px; color: var(--ink-2); border-bottom: 1px solid var(--line-2); }
.form-error { margin: 0 20px 12px; color: var(--bad); font-size: 13px; font-weight: 600; }
.form-body { padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; max-height: 65vh; overflow-y: auto; }
.form-body p { margin: 0; }
.errors { margin: 0; padding-left: 18px; color: var(--bad); font-size: 12.5px; }
fieldset.multi { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px 4px; margin: 0; display: flex; flex-wrap: wrap; gap: 0 18px; }
fieldset.multi legend { font-size: 12.5px; font-weight: 600; color: var(--ink-2); padding: 0 4px; }
fieldset.multi label.check { padding-bottom: 6px; }
input[disabled], select[disabled], textarea[disabled] { background: #f6f7f9; color: var(--ink-2); }
.modal-form header .ro-badge { margin-left: 8px; }

/* responsive */
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; grid-template-rows: auto 1fr; align-content: start; }
  .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 12px 16px; gap: 10px; }
  .switcher { flex: 1; min-width: 180px; }
  .nav { flex-direction: row; overflow-x: auto; width: 100%; padding-bottom: 2px; }
  .nav hr { display: none; }
  .nav-item { white-space: nowrap; }
  .nav-item.active { box-shadow: inset 0 -3px 0 var(--accent); }
  .reset { margin: 0; }
  .me { margin: 0; border: 0; padding: 0; order: 3; width: 100%; }
  .signin { grid-template-columns: 1fr; align-content: start; }
  .main { padding: 20px 16px 40px; }
  .split, .split-detail { grid-template-columns: 1fr; }
  .search { min-width: 0; width: 100%; }
  .g-row { grid-template-columns: 170px minmax(420px, 1fr); }
}
@media (max-width: 560px) {
  .form-grid, .grid2, .facts { grid-template-columns: 1fr; }
  .cards { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi-value { font-size: 20px; }
  h1 { font-size: 20px; }
}

/* ── Supabase-era additions ───────────────────────────── */
#toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 1000; max-width: min(420px, calc(100vw - 32px)); }
.toast { background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 10px; box-shadow: 0 8px 24px rgba(22,35,58,.25); font-size: 13.5px; animation: toast-in .18s ease-out; }
.toast-error { background: var(--bad); }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .toast { animation: none; } }
.loading { min-height: 100vh; display: grid; place-items: center; color: var(--muted); font-weight: 600; }
.note { background: var(--blue-soft); color: var(--blue); border-radius: 8px; padding: 10px 12px; font-size: 13px; margin-bottom: 12px; }
.signin-links { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.setup-note { background: var(--accent-soft); border-radius: 8px; padding: 8px 10px; font-size: 12.5px; }
.copybox { display: flex; gap: 8px; align-items: flex-start; background: var(--gray-soft); border-radius: 8px; padding: 8px 10px; }
.copybox code { background: none; padding: 0; word-break: break-all; flex: 1; font-size: 12px; }
.form-body h3, .attachments h3 { font-size: 13.5px; margin: 6px 0 0; }
.form-extra { padding: 0 20px 14px; }
.cat-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.cat.live { border-color: #b7dfc7; }
.runs { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.me-open { display: flex; align-items: center; gap: 10px; background: none; border: 0; padding: 4px; margin: -4px; border-radius: 8px; cursor: pointer; font: inherit; text-align: left; min-width: 0; color: inherit; }
.me-open:hover { background: rgba(255,255,255,.07); }
.attachments { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line-2); }
.att-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.att-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.att-actions label.btn { cursor: pointer; }
.att-list { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.att-list li { display: flex; align-items: center; gap: 8px; }
.att-name { background: none; border: 0; padding: 0; font: inherit; color: var(--blue); cursor: pointer; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60%; }
.att-name:hover { text-decoration: underline; }
.picker { width: min(640px, calc(100vw - 32px)); }
.pick-bar { display: flex; align-items: center; gap: 10px; padding: 10px 20px; border-bottom: 1px solid var(--line-2); }
.pick-bar form { margin-left: auto; }
.pick-bar input { padding: 6px 10px; font-size: 13px; }
.pick-list { max-height: 50vh; overflow-y: auto; }
.pick-list ul { list-style: none; margin: 0; padding: 6px 10px; }
.pick-list button { display: flex; width: 100%; gap: 10px; align-items: center; background: none; border: 0; padding: 8px 10px; border-radius: 8px; font: inherit; text-align: left; cursor: pointer; }
.pick-list button:hover { background: var(--gray-soft); }
.pick-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pad { padding: 16px 20px; }
.mfa-setup { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.mfa-setup img { background: #fff; border-radius: 8px; border: 1px solid var(--line); }
.mfa-setup div { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 10px; }

/* ── Estimation lane ─────────────────────────────────── */
.div-tag { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 6px; white-space: nowrap; }
.div-gc { background: #e8eefb; color: #24459a; }
.div-sr { background: #f3e9df; color: #7a4314; }
.div-ls { background: #e4f3e6; color: #22663a; }
.markups { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin: 12px 0 4px; font-size: 13px; color: var(--ink-2); }
.markups b { color: var(--ink); }
.table-wrap.flat { box-shadow: none; }
.table.totals td { padding: 7px 4px; }
.table.totals .strong-row td { font-weight: 650; border-top: 1px solid var(--line); }
.table.totals .total-row td { font-weight: 750; font-size: 15px; border-top: 2px solid var(--ink); }
.quotes { margin-bottom: 12px; }
.quotes h3 { font-size: 13px; margin: 0 0 6px; }
.quotes .table td { padding: 8px 10px; }
.row-used td { background: var(--good-soft); }
.rows li.clickable { cursor: pointer; }
.rows li.clickable:hover { background: #f8f9fb; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* ── Estimate depth: division groups, chart, history ─── */
.table tr.grp td { background: #f6f7f9; font-weight: 650; font-size: 12px; color: var(--ink-2); padding: 7px 14px; text-transform: none; }
.divchart { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.divchart li { display: grid; grid-template-columns: minmax(150px, 1.6fr) 2fr auto 48px 64px; gap: 10px; align-items: center; font-size: 12.5px; }
.dc-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dc-bar { height: 10px; background: var(--line-2); border-radius: 99px; overflow: hidden; }
.dc-bar i { display: block; height: 100%; background: var(--blue); border-radius: 99px; }
.dc-val { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.dc-pct, .dc-psf { text-align: right; font-variant-numeric: tabular-nums; }
.history { max-height: 420px; overflow-y: auto; padding-right: 4px; }
.head-actions { display: flex; gap: 6px; flex-wrap: wrap; }
@media (max-width: 700px) { .divchart li { grid-template-columns: 1fr auto; } .dc-bar, .dc-pct, .dc-psf { display: none; } }

/* ── Proposal ───────────────────────────────────────── */
.proposal-wrap { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 20px; align-items: start; }
.proposal-side { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 10px; }
.proposal-side .panel-head { margin-bottom: 0; }
.meter-good span { background: var(--good); }
.checks { list-style: none; margin: 4px 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.checks li { display: flex; gap: 8px; align-items: baseline; }
.checks li span { width: 14px; flex: none; font-weight: 700; }
.checks .ok span { color: var(--good); } .checks .todo { color: var(--ink-2); } .checks .todo span { color: var(--warn); }
.proposal-paper { background: #e9ebef; border-radius: 12px; padding: 28px; min-width: 0; }
.proposal-doc { background: #fff; max-width: 820px; margin: 0 auto; padding: 56px 60px; box-shadow: 0 2px 6px rgba(22,35,58,.08), 0 12px 32px rgba(22,35,58,.10); font-size: 13.5px; line-height: 1.55; color: #1b2433; }
.pd-head { display: flex; justify-content: space-between; align-items: flex-start; padding-bottom: 20px; border-bottom: 3px solid var(--ink); }
.pd-brand { display: flex; gap: 12px; align-items: center; }
.pd-brand .ico { width: 40px; height: 40px; }
.pd-brand strong { display: block; font-size: 19px; letter-spacing: -.01em; }
.pd-brand span { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.pd-meta { text-align: right; display: flex; flex-direction: column; font-size: 12.5px; color: var(--ink-2); }
.pd-meta b { font-size: 15px; color: var(--ink); text-transform: uppercase; letter-spacing: .1em; }
.pd-to { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin: 22px 0 8px; }
.pd-to h4, .pd-sign h4 { margin: 0 0 4px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.pd-to p { margin: 0; font-weight: 600; } .pd-to p span { font-weight: 400; color: var(--ink-2); }
.pd-cover { margin: 14px 0 20px; color: var(--ink-2); }
.pd-price { background: var(--ink); color: #fff; border-radius: 12px; padding: 22px 26px; margin-bottom: 26px; }
.pd-label { font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--accent); font-weight: 700; }
.pd-amount { font-size: 40px; font-weight: 750; letter-spacing: -.02em; line-height: 1.15; margin-top: 4px; font-variant-numeric: tabular-nums; }
.pd-words { color: #c9d2e0; font-size: 13px; margin-top: 2px; }
.pd-facts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.pd-facts span { background: rgba(255,255,255,.1); border-radius: 99px; padding: 3px 11px; font-size: 12px; }
.pd-facts small { font-size: 10px; }
.pd-sec { margin: 0 0 22px; break-inside: avoid; }
.pd-sec h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; margin: 0 0 8px; padding-bottom: 6px; border-bottom: 1px solid #dfe3e8; }
.pd-sec ul { margin: 0; padding-left: 18px; } .pd-sec li { margin: 3px 0; }
.pd-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; }
.pd-none { color: var(--muted); margin: 0; }
.pd-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.pd-table th { text-align: left; font-size: 11px; color: var(--muted); font-weight: 600; padding: 4px 0; }
.pd-table td { padding: 7px 0; border-bottom: 1px solid #eef0f3; vertical-align: top; }
.pd-table td + td, .pd-table th + th { padding-left: 16px; }
.pd-table .pd-total td { font-weight: 750; border-top: 2px solid var(--ink); border-bottom: 0; }
.pd-muted { color: var(--muted); font-size: 12.5px; }
.pd-incl { display: inline-block; margin-top: 3px; font-size: 11.5px; font-weight: 600; color: var(--good); }
.pd-sign { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 34px; break-inside: avoid; align-items: end; }
.pd-sign > div { display: flex; flex-direction: column; justify-content: flex-end; }
.pd-line { border-bottom: 1px solid #1b2433; height: 44px; margin-bottom: 6px; }
.pd-sign p { margin: 0; font-size: 12.5px; }
.pd-foot { margin-top: 36px; padding-top: 10px; border-top: 1px solid #dfe3e8; font-size: 11px; color: var(--muted); text-align: center; }
@media (max-width: 1100px) { .proposal-wrap { grid-template-columns: 1fr; } .proposal-side { position: static; } }
@media (max-width: 640px) {
  .proposal-paper { padding: 10px; } .proposal-doc { padding: 24px 18px; }
  .pd-to, .pd-cols, .pd-sign { grid-template-columns: 1fr; } .pd-amount { font-size: 30px; } .pd-head { flex-direction: column; gap: 12px; } .pd-meta { text-align: left; }
}
@media print {
  @page { margin: 14mm; }
  body { background: #fff; }
  .sidebar, .page-head, .back, .proposal-side, #toasts, .toolbar { display: none !important; }
  .shell { display: block; } .main { padding: 0; max-width: none; }
  .proposal-wrap { display: block; } .proposal-paper { background: none; padding: 0; }
  .proposal-doc { box-shadow: none; padding: 0; max-width: none; }
  .pd-price { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* Bid page: the estimate gets the room; facts sit in a fixed side column. */
.split-bid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.table.dense td { padding: 8px 8px; font-size: 13px; }
.table.dense th { padding: 9px 8px; }
.table.dense td:first-child, .table.dense th:first-child { padding-left: 12px; }
.q-mark { border-bottom: 2px solid #6b93e0; }
.est-lines tr:not(.grp) td:nth-child(2) { min-width: 180px; }
.est-lines .pill { font-size: 10.5px; padding: 1px 6px; }
.est-lines td.r, .est-lines th.r { white-space: nowrap; }
@media (max-width: 1100px) { .split-bid { grid-template-columns: 1fr; } }

/* ── Commitments & billing ─────────────────────────── */
.num-in { width: 110px; text-align: right; padding: 5px 8px; font-size: 13px; font-variant-numeric: tabular-nums; }
.pct-in { width: 72px; }
.wide-modal { width: min(860px, calc(100vw - 32px)); }
dialog.modal:has(.wide-modal) { width: min(860px, calc(100vw - 32px)); }
.inv-total { margin: 0; font-size: 13px; color: var(--ink-2); }
.callout { background: var(--accent-soft); border: 1px solid #f1d88a; border-radius: 10px; padding: 12px 14px; margin-bottom: 16px; font-size: 13.5px; }
.claim-doc { display: flex; flex-direction: column; gap: 4px; }
.claim-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; box-shadow: var(--shadow); }
.claim-head h2 { font-size: 17px; } .claim-head p { margin: 4px 0 0; font-size: 13px; }
.claim-status { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.claim-summary { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; margin-top: 12px; }
.claim-summary dl { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 8px 18px; box-shadow: var(--shadow); }
.claim-summary dl div { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line-2); font-size: 13.5px; font-variant-numeric: tabular-nums; }
.claim-summary dl div:last-child { border-bottom: 0; }
.claim-summary dt { color: var(--ink-2); } .claim-summary dd { margin: 0; font-weight: 600; }
.claim-summary .sum { border-top: 1px solid var(--line); } .claim-summary .sum dd { font-weight: 700; }
.claim-summary .due { background: var(--accent-soft); margin: 0 -18px; padding: 10px 18px; } .claim-summary .due dd, .claim-summary .due dt { font-weight: 750; color: var(--ink); font-size: 15px; }
.claim-dates { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; box-shadow: var(--shadow); }
.claim-dates h3 { font-size: 13px; margin: 0 0 8px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.claim-dates p { margin: 0 0 8px; font-size: 13.5px; }
.claim-save { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 10px; flex-wrap: wrap; }
.claim-lines td:first-child { min-width: 220px; }
@media (max-width: 900px) { .claim-summary { grid-template-columns: 1fr; } .claim-head { flex-direction: column; } .claim-status { align-items: flex-start; text-align: left; } }
@media print { .claim-save, .claim-lines input { display: none; } .claim-head, .claim-summary dl, .claim-dates { box-shadow: none; } }

/* ── Submittal review workflow ── */
.pill-noted { background: #e6f2ef; color: #1d6b5c; }
.pill-you { background: var(--accent); color: var(--accent-ink); }
.row-mine td { background: var(--accent-soft); }
.row-mine td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.queue { background: var(--side); color: #fff; border-radius: 12px; padding: 16px 18px; margin-bottom: 16px; }
.queue-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.queue-head h2 { display: flex; align-items: center; gap: 8px; font-size: 15px; margin: 0; color: #fff; }
.queue-head .ico { color: var(--accent); }
.queue-head .muted { color: var(--side-ink); }
.queue-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.queue-card { display: flex; flex-direction: column; gap: 4px; background: var(--surface); color: var(--ink); border-radius: 10px; padding: 12px 14px; border-left: 4px solid var(--accent); min-width: 0; }
.queue-card strong { font-size: 14px; line-height: 1.3; }
.queue-card .btn { align-self: flex-start; margin-top: 6px; }
.queue-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,.18); }
.sub-table td { vertical-align: top; }
.sub-hero { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin-bottom: 16px; box-shadow: var(--shadow); }
.sub-hero > div { background: var(--surface); padding: 12px 16px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.sub-hero strong { font-size: 15px; overflow-wrap: anywhere; }
.sub-hero.hero-mine > div:first-child { background: var(--accent-soft); box-shadow: inset 4px 0 0 var(--accent); }
.stepper { list-style: none; margin: 14px 0 0; padding: 0; }
.step { display: grid; grid-template-columns: 30px 1fr; gap: 12px; position: relative; padding-bottom: 16px; }
.step:not(:last-child)::before { content: ''; position: absolute; left: 14px; top: 30px; bottom: 0; width: 2px; background: var(--line); }
.step-dot { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 12.5px; font-weight: 700; background: var(--gray-soft); color: var(--ink-2); border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line); flex: none; }
.step-body { min-width: 0; padding-top: 4px; display: flex; flex-direction: column; gap: 3px; }
.step-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.step-status { font-size: 11.5px; font-weight: 600; color: var(--muted); }
.step-top .btn { margin-left: auto; }
.step-active .step-dot { background: var(--accent); color: var(--accent-ink); box-shadow: 0 0 0 4px var(--accent-soft); }
.step-active .step-status { color: var(--warn); }
.step-late .step-dot { background: var(--bad); color: #fff; box-shadow: 0 0 0 4px var(--bad-soft); }
.step-approved .step-dot, .step-approved_as_noted .step-dot { background: var(--good); color: #fff; }
.step-approved .step-status, .step-approved_as_noted .step-status { color: var(--good); }
.step-revise_resubmit .step-dot, .step-rejected .step-dot { background: var(--bad); color: #fff; }
.step-revise_resubmit .step-status, .step-rejected .step-status { color: var(--bad); }
.step-skipped { opacity: .55; }
.step-comments { margin: 6px 0 0; padding: 8px 12px; background: var(--line-2); border-left: 3px solid var(--line); border-radius: 0 8px 8px 0; font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; }
.step-revise_resubmit .step-comments, .step-rejected .step-comments { border-left-color: var(--bad); background: var(--bad-soft); }
.step-approved_as_noted .step-comments { border-left-color: #1d6b5c; background: #e6f2ef; }
.stepper-compact .step { padding-bottom: 10px; }
.rev-old { border-top: 1px solid var(--line-2); padding: 10px 0; }
.rev-old summary { cursor: pointer; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.respond { margin-top: 8px; padding: 16px; border: 2px solid var(--accent); border-radius: 12px; background: var(--accent-soft); display: flex; flex-direction: column; gap: 10px; }
.respond h3 { margin: 0; font-size: 15px; }
.respond textarea { width: 100%; background: var(--surface); }
.seg { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.seg-opt { position: relative; cursor: pointer; }
.seg-opt input { position: absolute; opacity: 0; pointer-events: none; }
.seg-opt span { display: flex; flex-direction: column; gap: 2px; height: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.seg-opt strong { font-size: 13px; }
.seg-opt em { font-style: normal; font-size: 11.5px; color: var(--muted); line-height: 1.3; }
.seg-opt input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 1px; }
.seg-approved input:checked + span { border-color: var(--good); background: var(--good-soft); box-shadow: inset 0 0 0 1px var(--good); }
.seg-approved_as_noted input:checked + span { border-color: #1d6b5c; background: #e6f2ef; box-shadow: inset 0 0 0 1px #1d6b5c; }
.seg-revise_resubmit input:checked + span { border-color: var(--warn); background: var(--warn-soft); box-shadow: inset 0 0 0 1px var(--warn); }
.seg-rejected input:checked + span { border-color: var(--bad); background: var(--bad-soft); box-shadow: inset 0 0 0 1px var(--bad); }
.respond-foot { display: flex; align-items: center; gap: 12px; justify-content: space-between; flex-wrap: wrap; }
.timeline { list-style: none; margin: 0 0 10px; padding: 0; }
.timeline li { display: grid; grid-template-columns: 1fr auto; gap: 0 10px; padding: 9px 0 9px 16px; border-left: 2px solid var(--line); position: relative; }
.timeline li::before { content: ''; position: absolute; left: -6px; top: 14px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--blue); }
.timeline li span { font-size: 13px; color: var(--ink-2); }
.timeline li strong { font-size: 13.5px; text-align: right; }
.timeline li em { grid-column: 1 / -1; font-style: normal; font-size: 12px; color: var(--muted); }
.timeline li.tl-bad::before { border-color: var(--bad); background: var(--bad-soft); }
.timeline li.tl-bad strong { color: var(--bad); }
.callout { background: var(--blue-soft); color: var(--ink); border-radius: 8px; padding: 10px 12px; }
.wf-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.wf-head h3 { margin: 0; font-size: 14px; }
.wf-rows { display: flex; flex-direction: column; gap: 8px; }
.wf-row { display: grid; grid-template-columns: 30px minmax(0, 1fr) minmax(0, 1.3fr) minmax(0, 1fr) auto auto; gap: 8px; align-items: center; }
.wf-row [data-f="ext"][hidden] + .wf-days { grid-column: 5; }
.wf-row input, .wf-row select { width: 100%; min-width: 0; }
.wf-days { display: flex; align-items: center; gap: 4px; }
.wf-days input { width: 64px; }
.wf-btns { display: flex; gap: 2px; }
.wf-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
@media (max-width: 900px) {
  .sub-hero { grid-template-columns: 1fr 1fr; }
  .seg { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .wf-row { grid-template-columns: 30px minmax(0, 1fr) auto; }
  .wf-row select, .wf-row [data-f="ext"] { grid-column: 2 / -1; }
  .wf-row .wf-days { grid-column: 2; }
  .wf-row .wf-btns { grid-column: 3; grid-row: 1; }
  .queue-cards { grid-template-columns: 1fr; }
}
/* Wide forms fill the dialog's content box (the dialog's own scrollbar must not push them into a horizontal scroll). */
dialog.modal .wide-modal { width: auto; }
.wf-days { flex-direction: row; }
.panel > .attachments:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.att-list .small { white-space: nowrap; }
@media (max-width: 560px) {
  .wf-row { grid-template-columns: 30px minmax(0, 1fr) auto; row-gap: 6px; }
  .wf-row > .step-dot { grid-row: 1; grid-column: 1; }
  .wf-row > [data-f="label"] { grid-row: 1; grid-column: 2; }
  .wf-row > .wf-btns { grid-row: 1; grid-column: 3; }
  .wf-row > select, .wf-row > [data-f="ext"], .wf-row > .wf-days, .wf-row [data-f="ext"][hidden] + .wf-days { grid-column: 2 / -1; grid-row: auto; }
  .wf-row { padding-bottom: 8px; border-bottom: 1px solid var(--line-2); }
}
/* ── People: deactivate / remove ── */
.section-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.section-row .section-title { margin-bottom: 10px; }
tr[data-inactive] td { color: var(--muted); }
.account-box { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line-2); display: flex; flex-direction: column; gap: 8px; }
.account-box h3 { margin: 0; font-size: 13.5px; }
.account-box p { margin: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.account-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.btn-danger-solid { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn-danger-solid:hover { filter: brightness(.95); }
.life-list { margin: 0 0 12px; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; }

/* ── Directory: contact cards (people, contacts, companies) ── */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 0 0 16px; overflow-x: auto; }
.tab { font: inherit; font-weight: 600; font-size: 13.5px; color: var(--muted); background: none; border: 0; border-bottom: 2px solid transparent; padding: 10px 14px; margin-bottom: -1px; cursor: pointer; white-space: nowrap; }
.tab b { font-weight: 600; color: var(--muted); margin-left: 4px; font-size: 12px; }
.tab:hover { color: var(--ink); }
.tab.on { color: var(--ink); border-bottom-color: var(--accent); }
.dir-filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.dir-filters .search, .toolbar select.search { min-width: 0; }
.dir-table td { vertical-align: middle; }
.dir-sub { display: block; font-weight: 400; }
.person strong { font-weight: 600; }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--blue); cursor: pointer; text-align: left; }
.linklike:hover { text-decoration: underline; }
.avatar-contact { background: var(--gray-soft); color: var(--ink-2); }
.avatar-lg { width: 56px; height: 56px; font-size: 19px; }
.avatar-co { border-radius: 14px; background: var(--ink); color: #fff; }
.trade-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.trade { font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 6px; background: var(--blue-soft); color: var(--blue); white-space: nowrap; }
.dir-alert { background: var(--warn-soft); border: 1px solid #f3d9a6; border-radius: 10px; padding: 10px 14px; font-size: 13px; margin-bottom: 12px; line-height: 1.6; }
.card-modal { width: min(560px, calc(100vw - 32px)); }
.cc { padding: 4px 22px 18px; display: flex; flex-direction: column; gap: 14px; max-height: 72vh; overflow-y: auto; }
.cc h3 { font-size: 13.5px; margin: 6px 0 0; }
.cc-head { display: flex; gap: 14px; align-items: center; }
.cc-head h2 { font-size: 19px; line-height: 1.25; }
.cc-quick { display: flex; flex-wrap: wrap; gap: 6px; }
.cc-quick .btn { text-decoration: none; }
.cc-quick .ico { width: 14px; height: 14px; }
.cc-comp { display: flex; flex-wrap: wrap; gap: 6px; }
.cc-list { margin: 0; display: grid; gap: 8px; border-top: 1px solid var(--line-2); padding-top: 12px; }
.cc-row { display: grid; grid-template-columns: 110px 1fr; gap: 10px; align-items: baseline; font-size: 13.5px; }
.cc-row dt { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.cc-row dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.cc-people { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; }
.cc-people li { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; }
.cc-people-contact { margin-left: auto; font-size: 12.5px; white-space: nowrap; }
.cc-work { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; }
.cc-work div { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; display: flex; flex-direction: column; }
.cc-work b { font-size: 18px; }
.cc-work span { font-size: 11.5px; color: var(--muted); }
.icon-btn.small { font-size: 13px; padding: 0 4px; }
tr[data-inactive] td { opacity: .6; }
@media (max-width: 560px) {
  .cc-row { grid-template-columns: 1fr; gap: 2px; }
  .cc-people-contact { margin-left: 0; width: 100%; }
  .dir-filters { width: 100%; }
  .dir-filters .search { flex: 1; }
}

/* ── Bid packages ── */
.bp-panel { margin-top: 16px; }
.bp-panel > p { margin: 0 0 10px; }
.bp-table td { vertical-align: top; }
.cov { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; }
.cov-bar { position: relative; display: inline-flex; width: 70px; height: 8px; background: var(--line-2); border-radius: 99px; overflow: hidden; }
.cov-bar > span:first-child { background: var(--good); }
.cov-bar > .cov-int { background: repeating-linear-gradient(45deg, #f5c96b, #f5c96b 3px, #fbe3ad 3px, #fbe3ad 6px); }
.bp-docs { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line-2); display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.bp-docs h3 { margin: 0; font-size: 13.5px; }
.bp-docs .att-list { width: 100%; }
.bidders { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.bidder { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-left-width: 4px; border-radius: 10px; }
.bidder-invited { border-left-color: var(--line); }
.bidder-viewed { border-left-color: var(--blue); }
.bidder-intending { border-left-color: var(--accent); }
.bidder-declined { border-left-color: var(--bad); background: #fffafa; }
.bidder-submitted { border-left-color: var(--good); }
.bidder-main { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.bidder-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.bidder-quote { font-size: 15px; margin-top: 4px; }
.bidder-actions { display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
.inv-pick { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-direction: column; gap: 2px; max-height: 300px; overflow: auto; border: 1px solid var(--line-2); border-radius: 8px; padding: 6px 10px; }
.inv-pick label.check { padding: 6px 0; font-weight: 500; align-items: flex-start; }
.inv-pick label.check > span { display: flex; flex-wrap: wrap; gap: 4px; align-items: baseline; }
.inv-extra { display: flex; flex-direction: column; gap: 6px; margin-bottom: 6px; }
.inv-row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1.2fr) auto; gap: 6px; align-items: center; }
.inv-row input { width: 100%; min-width: 0; }
.link-list { list-style: none; margin: 0; padding: 0; }
.link-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.link-actions { display: flex; gap: 6px; }
.pkg-link { font-weight: 500; margin-left: 6px; }
@media (max-width: 640px) {
  .bidder { grid-template-columns: 1fr; }
  .bidder-actions { flex-direction: row; flex-wrap: wrap; }
  .inv-row { grid-template-columns: 1fr auto; }
  .inv-row input:not(:first-child) { grid-column: 1; }
}
.w-full { width: 100%; min-width: 0; }
.bp-table .pill { margin-top: 4px; }

/* ── Drawings ── */
.dw-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.seg-toggle { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--surface); }
.seg-toggle button { font: inherit; font-size: 12.5px; border: 0; background: none; padding: 6px 12px; cursor: pointer; color: var(--ink-2); }
.seg-toggle button.on { background: var(--ink); color: #fff; }
.dw-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.dw-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; color: inherit; box-shadow: var(--shadow); }
.dw-card:hover { border-color: var(--blue); }
.dw-thumb { display: block; aspect-ratio: 3 / 2; background: #f8f9fb; border-bottom: 1px solid var(--line-2); overflow: hidden; }
.dw-thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.dw-nothumb { display: grid; place-items: center; height: 100%; font: 700 22px var(--mono); color: var(--muted); }
.dw-meta { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; min-width: 0; }
.dw-title { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dw-up .dw-drop { border: 2px dashed var(--line); border-radius: 10px; padding: 14px; cursor: pointer; flex-direction: row; align-items: center; gap: 12px; }
.dw-up .dw-drop input { max-width: 220px; }
.dw-up .dw-drop > span { display: flex; flex-direction: column; gap: 2px; }
.dw-pages { margin-top: 10px; }
.dw-pthumb { display: inline-block; width: 64px; height: 42px; border: 1px solid var(--line-2); border-radius: 4px; overflow: hidden; vertical-align: middle; margin-right: 6px; background: #fff; }
.dw-pthumb img { width: 100%; height: 100%; object-fit: contain; }
.w-num { width: 90px; } .w-rev { width: 56px; }
.row-off td { opacity: .45; }
.dw-banner { background: var(--warn-soft); color: var(--warn); border-radius: 10px; padding: 10px 14px; margin-bottom: 12px; font-size: 13.5px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.dw-legend { background: var(--surface); color: var(--ink-2); border: 1px solid var(--line); }
.dw-legend i { display: inline-block; width: 14px; height: 4px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.lg-add { background: #ff3b30; } .lg-del { background: #29a3ff; } .lg-same { background: #222; }
.dw-rev select { font: inherit; font-size: 13px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.dw-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.dw-main { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); }
.dw-bar { display: flex; align-items: center; gap: 4px; padding: 6px 8px; border-bottom: 1px solid var(--line); flex-wrap: wrap; background: var(--surface); }
.dw-tool { font: inherit; min-width: 34px; height: 32px; border: 1px solid transparent; border-radius: 7px; background: none; cursor: pointer; font-size: 15px; color: var(--ink); }
.dw-tool:hover { background: var(--line-2); }
.dw-tool.on { background: var(--ink); color: #fff; }
.dw-fit { font-size: 12.5px; font-weight: 600; }
.dw-sep { width: 1px; height: 22px; background: var(--line); margin: 0 4px; }
.dw-color { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #fff; background: var(--c); box-shadow: 0 0 0 1px var(--line); cursor: pointer; }
.dw-color.on { box-shadow: 0 0 0 2px var(--ink); }
.dw-share { flex-direction: row; align-items: center; gap: 6px; font-weight: 500; font-size: 12.5px; }
.dw-zoom { font-size: 12px; min-width: 44px; text-align: center; color: var(--muted); }
.dw-stage { max-height: min(76vh, 960px); min-height: 240px; overflow: auto; background: #e9ecf1; padding: 12px; touch-action: none; overscroll-behavior: contain; }
.dw-stage.tool-pan { cursor: grab; } .dw-stage.tool-pan:active { cursor: grabbing; }
.dw-stage:not(.tool-pan) { cursor: crosshair; }
.dw-page { position: relative; background: #fff; box-shadow: 0 2px 12px rgba(22,35,58,.18); margin: 0 auto; }
.dw-canvas-slot, .dw-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.dw-canvas-slot { display: grid; place-items: center; }
.dw-loading { font-size: 13px; color: var(--muted); }
.dw-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.dw-svg .mk { cursor: pointer; }
.dw-svg .mk-sel { filter: drop-shadow(0 0 3px rgba(26,115,232,.9)); }
.dw-svg text { font-family: var(--font); pointer-events: none; }
.dw-side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.dw-selpanel { border-color: var(--blue); }
.dw-selpanel textarea, .dw-selpanel select { width: 100%; }
.dw-link { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.dw-new, .dw-selactions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.dw-mlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; max-height: 320px; overflow: auto; }
.dw-mitem { width: 100%; text-align: left; font: inherit; display: flex; gap: 8px; align-items: flex-start; padding: 7px 8px; border: 0; border-radius: 8px; background: none; cursor: pointer; }
.dw-mitem:hover, .dw-mitem.on { background: var(--line-2); }
.dw-mitem > span:last-child { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 13px; }
.dw-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); margin-top: 4px; flex: none; }
.pins-on { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: 10px 0; }
@media (max-width: 1000px) { .dw-wrap { grid-template-columns: 1fr; } .dw-stage { max-height: 64vh; } }

/* ── Photos ── */
.ph-tags { margin: -4px 0 12px; }
.chip-sm { font-size: 12px; padding: 3px 9px; }
.ph-day { margin-bottom: 18px; }
.ph-dayhead { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; font-size: 14.5px; margin: 0 0 8px; }
.ph-dayhead a { margin-left: auto; }
.ph-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.ph-tile { position: relative; padding: 0; border: 0; border-radius: 10px; overflow: hidden; aspect-ratio: 1; background: var(--gray-soft); cursor: pointer; font: inherit; }
.ph-tile img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .2s; }
.ph-tile:hover img { transform: scale(1.03); }
.ph-noimg { display: grid; place-items: center; height: 100%; font-size: 12px; color: var(--muted); }
.ph-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 8px 6px; background: linear-gradient(transparent, rgba(0,0,0,.62)); color: #fff; font-size: 12px; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ph-cap .muted { color: #e6e9ee; }
.ph-badges { position: absolute; top: 6px; left: 6px; display: flex; gap: 4px; }
.ph-badges span { background: rgba(22,35,58,.82); color: #fff; font: 600 10.5px var(--mono); padding: 2px 6px; border-radius: 4px; }
.ph-strip { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line-2); }
.ph-row { display: flex; gap: 6px; flex-wrap: wrap; }
.ph-mini { width: 64px; height: 64px; padding: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--gray-soft); cursor: pointer; }
.ph-mini img { width: 100%; height: 100%; object-fit: cover; }
dialog.ph-dialog { width: min(1100px, calc(100vw - 24px)); max-height: calc(100vh - 24px); }
.ph-viewer { display: flex; flex-direction: column; max-height: calc(100vh - 24px); }
.ph-body { display: grid; grid-template-columns: minmax(0, 1fr) 300px; min-height: 0; flex: 1; }
.ph-stage { position: relative; background: #0f1724; display: grid; place-items: center; min-height: 300px; }
.ph-full { max-width: 100%; max-height: calc(100vh - 120px); object-fit: contain; display: block; }
.ph-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 40px; height: 56px; border: 0; border-radius: 8px; background: rgba(255,255,255,.14); color: #fff; font-size: 28px; cursor: pointer; }
.ph-nav:hover { background: rgba(255,255,255,.28); }
.ph-prev { left: 8px; } .ph-next { right: 8px; }
.ph-info { padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; overflow: auto; }
.ph-info textarea, .ph-info input, .ph-info select { width: 100%; }
.ph-actions { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 760px) { .ph-body { grid-template-columns: 1fr; } .ph-grid { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); } .ph-full { max-height: 55vh; } }
.dw-mtop { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

/* File-picker buttons are labels; keep icon and text on one line. */
label.btn { flex-direction: row; }
.dw-stage.tool-pan { touch-action: pan-x pan-y pinch-zoom; }
[data-xadd] { align-self: flex-start; }

/* ── Change management ── */
.chg-table td { vertical-align: top; }
.chg-strip { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: -4px 0 12px; }
.chg-strip a { margin-left: auto; }
.chg-desc { margin: 0 0 14px; font-size: 14px; white-space: pre-wrap; max-width: 80ch; }
.chg-lines input, .chg-lines select { width: 100%; min-width: 0; font-size: 13px; padding: 5px 7px; }
.chg-lines td:nth-child(1) { min-width: 120px; } .chg-lines td:nth-child(2) { min-width: 180px; } .chg-lines td:nth-child(3) { min-width: 140px; }
.chg-lines .num-in { width: 96px; text-align: right; } .chg-lines .w-pct { width: 64px; }
.pco-doc { padding: 24px 28px; }
.pco-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; border-bottom: 2px solid var(--ink); padding-bottom: 12px; margin-bottom: 14px; }
.pco-head h2 { margin: 2px 0 0; font-size: 22px; }
.pco-facts { margin-bottom: 14px; }
.pco-desc { white-space: pre-wrap; font-size: 14px; margin: 0 0 14px; }
.pco-lines tfoot td { font-weight: 700; font-size: 14.5px; border-top: 2px solid var(--ink); }
.pco-decision { margin-top: 16px; padding: 12px 14px; border-radius: 10px; background: var(--good-soft); color: var(--good); }
.pco-decision.rejected { background: var(--bad-soft); color: var(--bad); }
.pco-decision p { margin: 6px 0 0; color: var(--ink-2); }
.pco-sign { margin-top: 18px; }
@media (max-width: 640px) { .pco-doc { padding: 16px; } .chg-strip a { margin-left: 0; } }
@media print {
  .pco-doc { border: 0; box-shadow: none; padding: 0; }
  .split-detail:has(.pco-doc) { display: block; }
  .split-detail:has(.pco-doc) > .stack { display: none; }
  .dw-banner, .kpis, .tabs { display: none !important; }
}
.tabs { overflow-y: hidden; }
.chg-lines th:last-child, .chg-lines td:last-child { position: sticky; right: 0; width: 40px; min-width: 40px; background: var(--surface); }
.chg-lines th:nth-last-child(2), .chg-lines td:nth-last-child(2) { position: sticky; right: 40px; background: var(--surface); box-shadow: -8px 0 8px -8px rgba(22,35,58,.25); }
.chg-lines tfoot td { background: var(--surface); }
.chg-lines .num-in { width: 88px; } .chg-lines .w-pct { width: 58px; }

/* ── Field mode & offline ── */
.fm { max-width: 680px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.fm-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.fm-head h1 { margin: 2px 0 0; font-size: 22px; line-height: 1.2; }
.fm-note { margin: 0; background: var(--warn-soft); color: var(--warn); border-radius: 10px; padding: 10px 12px; font-size: 13.5px; }
.fm-install { font: inherit; font-weight: 700; font-size: 15px; padding: 14px; border-radius: 12px; border: 2px dashed var(--accent); background: var(--accent-soft); color: var(--ink); cursor: pointer; }
.fm-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px; }
.fm-card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.fm-card-head h2 { margin: 0; font-size: 17px; }
.fm-weather { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.fm-chip { font: inherit; font-size: 13px; font-weight: 600; min-height: 44px; padding: 6px 8px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.fm-chip span { font-size: 18px; line-height: 1; }
.fm-chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.fm-chip b { font-weight: 700; }
.fm-chip:disabled { opacity: .6; cursor: default; }
.fm-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.fm-step { display: flex; flex-direction: column; gap: 4px; align-items: center; background: var(--line-2); border-radius: 12px; padding: 8px 6px; }
.fm-step > div { display: flex; align-items: center; gap: 8px; }
.fm-step strong { min-width: 34px; text-align: center; font-size: 20px; }
.fm-sbtn { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); font-size: 22px; font-weight: 700; cursor: pointer; color: var(--ink); }
.fm-sbtn:active { background: var(--accent); }
.fm-field { display: flex; flex-direction: column; gap: 5px; font-size: 13px; }
.fm-field input, .fm-field textarea, .fm-field select, .fm-search { font: inherit; font-size: 16px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); width: 100%; min-width: 0; }
.fm-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fm-big { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 56px; border-radius: 12px; border: 0; background: var(--ink); color: #fff; font: inherit; font-weight: 700; font-size: 16px; cursor: pointer; width: 100%; }
.fm-big.fm-primary { background: var(--accent); color: var(--accent-ink); }
.fm-photos { display: flex; gap: 6px; flex-wrap: wrap; }
.fm-photos .ph-mini { width: 72px; height: 72px; }
.fm-new { display: flex; flex-direction: column; gap: 10px; padding: 12px; border: 2px solid var(--accent); border-radius: 12px; background: var(--accent-soft); }
.fm-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.fm-tabs .fm-chip { flex-direction: row; gap: 6px; font-size: 12.5px; }
.fm-loc { margin: 6px 0 0; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.fm-punch { border: 1px solid var(--line); border-left: 5px solid var(--line); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 4px; }
.fm-punch.pr-high { border-left-color: var(--bad); } .fm-punch.pr-medium { border-left-color: var(--accent); } .fm-punch.pr-low { border-left-color: var(--blue); }
.fm-punch.is-queued { background: var(--accent-soft); }
.fm-punch-top { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.fm-punch-title { font-size: 15.5px; }
.fm-acts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.fm-act { font: inherit; font-weight: 700; font-size: 14px; min-height: 44px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; flex-direction: row; }
.fm-ready { background: var(--good); color: #fff; border-color: var(--good); flex: 1; }
.fm-close { background: var(--ink); color: #fff; border-color: var(--ink); flex: 1; }
.fm-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.fm-link { display: flex; align-items: center; justify-content: center; min-height: 52px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); font-weight: 600; color: var(--ink); }
.fm-projects { display: flex; flex-direction: column; gap: 8px; }
.fm-proj { display: flex; flex-direction: column; gap: 2px; padding: 16px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); }
.sync-chip { display: inline-flex; align-items: center; gap: 4px; font: inherit; font-size: 12px; font-weight: 700; padding: 5px 10px; border-radius: 99px; border: 0; white-space: nowrap; cursor: pointer; }
.sc-ok { background: var(--good-soft); color: var(--good); cursor: default; }
.sc-off { background: var(--warn-soft); color: var(--warn); }
.sc-wait { background: var(--blue-soft); color: var(--blue); }
.sc-sync { background: var(--blue-soft); color: var(--blue); cursor: default; }
.sc-bad { background: var(--bad-soft); color: var(--bad); }
.side-sync { padding: 0 12px 8px; }
.sync-list { list-style: none; margin: 0; padding: 0; }
.sync-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line-2); }
.sync-acts { display: flex; gap: 6px; }
.ph-tile { position: relative; } .ph-wait { position: absolute; top: 6px; right: 6px; background: var(--accent); color: var(--accent-ink); font-weight: 700; border-radius: 99px; width: 22px; height: 22px; display: grid; place-items: center; font-size: 13px; }
@media (max-width: 420px) { .fm-weather { grid-template-columns: repeat(4, minmax(0, 1fr)); } .fm-chip { font-size: 11.5px; } .fm-steps { gap: 6px; } .fm-sbtn { width: 40px; height: 40px; } }
@media (max-width: 560px) {
  .fm-steps { grid-template-columns: 1fr; gap: 6px; }
  .fm-step { flex-direction: row; justify-content: space-between; padding: 6px 6px 6px 14px; }
  .fm-step .muted { font-size: 14px; color: var(--ink-2); }
  .fm-sbtn { width: 44px; height: 44px; }
}
/* ── Offline drawings ── */
.dw-thumb { position: relative; }
.dw-kept { position: absolute; top: 6px; right: 6px; background: var(--good); color: #fff; font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 99px; }
.dw-off-on { border-color: var(--good); color: var(--good); }
.dw-off-discs:disabled { opacity: .5; }
.fm-off { margin-left: 6px; font-size: 11px; font-weight: 700; color: var(--good); background: var(--good-soft); padding: 2px 7px; border-radius: 99px; }
/* ── Notifications ── */
.brand-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.bell { position: relative; font-size: 17px; color: var(--side-ink); }
.bell:hover { background: rgba(255,255,255,.08); }
.bell-n { position: absolute; top: -2px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--accent); color: var(--accent-ink); font-size: 10.5px; font-weight: 800; display: grid; place-items: center; }
.inbox { width: min(560px, calc(100vw - 24px)); }
.inbox-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.inbox-item { width: 100%; text-align: left; font: inherit; display: flex; gap: 10px; padding: 10px; border: 0; border-radius: 10px; background: none; cursor: pointer; color: var(--ink); }
.inbox-item:hover { background: var(--line-2); }
.inbox-item.unread { background: var(--accent-soft); }
.inbox-item.unread strong::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-right: 6px; vertical-align: middle; }
.inbox-ico { font-size: 20px; line-height: 1.2; }
.inbox-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ns-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
dialog.modal .inbox { width: auto; } .inbox header { flex-wrap: wrap; row-gap: 6px; }
/* ── T&M tickets ── */
.fm-tm { display: flex; flex-direction: column; gap: 2px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); }
.fm-tm:hover { border-color: var(--blue); }
.tm-line { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line-2); }
.tm-desc { font: inherit; font-size: 15px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; min-width: 0; }
.tm-qty { display: flex; align-items: center; gap: 4px; }
.tm-qty input { font: inherit; font-size: 16px; width: 64px; padding: 9px 6px; text-align: right; border: 1px solid var(--line); border-radius: 10px; }
.tm-qty .tm-unit { width: 52px; text-align: left; }
.tm-ot { flex-direction: row; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.tm-signed { border-color: var(--good); }
.tm-sig { max-width: 320px; width: 100%; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.tm-sig-sm { max-width: 220px; }
.tm-pad-wrap { position: relative; }
.tm-pad { width: 100%; height: auto; aspect-ratio: 3 / 1; border: 2px dashed var(--line); border-radius: 12px; background: #fff; touch-action: none; display: block; }
.tm-pad-wrap .tm-clear { position: absolute; top: 8px; right: 8px; }
.tm-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.tm-apply { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--accent-soft); border: 1px solid #f3dd8a; border-radius: 10px; padding: 10px 12px; margin-bottom: 14px; font-size: 13.5px; }
.tm-apply a { margin-left: auto; }
@media (max-width: 560px) { .tm-line { grid-template-columns: 1fr auto; } .tm-desc { grid-column: 1 / -1; } }
.tm-qty .tm-unit { width: 64px; }

/* ── Payment compliance & statutory declarations */
.ok-text { color: var(--good); } .bad-text { color: var(--bad); } .warn-text { color: var(--warn); }
.alert.soft { background: var(--warn-soft); color: var(--ink); border-color: transparent; margin-bottom: 10px; }
.hold-note { margin-bottom: 10px; display: grid; gap: 8px; } .hold-note ul { margin: 2px 0 6px; padding-left: 18px; } .hold-note li { margin: 1px 0; } .hold-note p { margin: 0; }
.compliance .facts { margin-bottom: 10px; }
.decl-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 10px; }
.decl-list li { border-top: 1px solid var(--line); padding-top: 10px; }
.decl-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.statdec-form .exceptions { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin: 6px 0 10px; }
.statdec-form .exceptions legend { font-size: 12px; color: var(--ink-2); padding: 0 4px; }
.statdec-form .exceptions input { width: 100%; }
.statdec-form .decl-preview { font: 13px/1.5 Georgia, serif; background: var(--gray-soft); padding: 12px 16px; border-radius: 8px; margin-top: 8px; max-height: 340px; overflow: auto; }
.statdec-form .decl-preview h1 { font-size: 17px; margin: 0; } .statdec-form .decl-preview .sub { color: var(--ink-2); margin: 0 0 8px; }
.statdec-form .decl-preview table { width: 100%; border-collapse: collapse; } .statdec-form .decl-preview th, .statdec-form .decl-preview td { text-align: left; padding: 3px 6px; vertical-align: top; }
.statdec-form .decl-preview .lines th, .statdec-form .decl-preview .lines td { border: 1px solid var(--line); }
@media print { .no-print { display: none !important; } }
.table td.pay-cell { min-width: 180px; }

/* ── Submittal packages & register */
.table tr.pkg-row td { background: var(--gray-soft); font-size: 13px; padding-top: 9px; padding-bottom: 9px; }
.table tr.pkg-row[data-sub] { cursor: pointer; } .table tr.pkg-row[data-sub]:hover td { background: var(--line); }
.chips.seg { margin-right: 6px; }
.register { background: var(--surface, #fff); border: 1px solid var(--line); border-radius: 10px; padding: 18px 20px; }
.reg-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 10px; }
.reg-head h2 { margin: 0; font-size: 18px; } .reg-head p { margin: 2px 0 0; }
.reg-table td, .reg-table th { font-size: 12px; }
@media print { .register { border: 0; padding: 0; } .reg-table { font-size: 10px; } .reg-table .pill { padding: 0; background: none !important; color: #000 !important; } .reg-table tbody { break-inside: avoid; } }
.reg-table td:nth-child(2) { min-width: 180px; }
@media print { .register .table-wrap { overflow: visible; border: 0; } .reg-table td:nth-child(2) { min-width: 0; } }

/* ── Consultant review links & email-in */
.copy-row { display: flex; gap: 6px; margin-top: 4px; } .copy-row input { flex: 1; min-width: 0; font-size: 12px; }
.email-pre { white-space: pre-wrap; font: 12.5px/1.5 var(--mono, ui-monospace, monospace); background: var(--gray-soft); border-radius: 8px; padding: 10px 12px; max-height: 260px; overflow: auto; }
.step-send { margin-top: 4px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.btn .badge { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--bad); color: #fff; font-size: 11px; line-height: 18px; text-align: center; margin-left: 4px; }
.btn.btn-warn { border-color: var(--warn); }
.panel.inbound { margin-bottom: 12px; } .panel.inbound.needs_review { border-left: 3px solid var(--warn); }
.section-title { margin: 18px 0 8px; }

/* ── Closeout */
.co-table td:nth-child(2) { min-width: 220px; }
.binder-panel { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.binder-panel > div:first-child { display: grid; gap: 4px; }
.g-subs { display: block; font-size: 11.5px; color: var(--ink-2); text-decoration: none; } .g-subs.bad { color: var(--bad); font-weight: 600; } .g-subs:hover { text-decoration: underline; }

/* ── Drawing callouts */
.dw-svg .dw-co rect { fill: rgba(26, 115, 232, 0.06); stroke: rgba(26, 115, 232, 0.55); stroke-width: 1.2; cursor: pointer; pointer-events: all; }
.dw-svg .dw-co:hover rect { fill: rgba(26, 115, 232, 0.18); stroke: #1a73e8; stroke-width: 2; }
.dw-svg .dw-co.unres rect { fill: transparent; stroke: rgba(120, 120, 120, 0.6); stroke-dasharray: 4 3; cursor: help; }
.dw-stage:not(.tool-pan) .dw-co rect { pointer-events: none; }
.dw-svg .dw-anchor rect { fill: none; stroke: none; pointer-events: none; }
.dw-svg .flash rect { stroke: #e37400 !important; stroke-width: 4 !important; fill: rgba(227, 116, 0, 0.18) !important; animation: dwflash 0.6s ease-in-out 4 alternate; }
@keyframes dwflash { from { opacity: 1; } to { opacity: 0.25; } }

/* ── Specifications */
.spec-search { display: flex; gap: 6px; flex: 1; } .spec-search .search { flex: 1; max-width: 560px; }
.spec-hits { list-style: none; margin: 0; padding: 0; } .spec-hits li { padding: 8px 0; border-top: 1px solid var(--line); } .spec-hits li:first-child { border-top: 0; }
.spec-hits p { margin: 4px 0 0; color: var(--ink-2); } .spec-hits mark { background: #ffe58a; color: inherit; padding: 0 1px; border-radius: 2px; }
.spec-table td:nth-child(2) { min-width: 240px; }
.spec-pages { display: flex; flex-direction: column; gap: 12px; align-items: center; background: var(--gray-soft); border-radius: 10px; padding: 12px 4px; min-height: 300px; }
.spec-page { box-shadow: 0 1px 4px rgba(0,0,0,0.15); background: #fff; max-width: 100%; height: auto; }

/* ── Photo pins: view cones, placing, sheet location */
.dw-svg .ph-cone { fill: rgba(26, 115, 232, 0.28); stroke: #1a73e8; stroke-width: 1.2; vector-effect: non-scaling-stroke; }
.dw-svg .ph-place circle { fill: rgba(227, 116, 0, 0.2); stroke: #e37400; stroke-width: 2.5; vector-effect: non-scaling-stroke; }
.dw-svg .ph-place .dot { fill: #e37400; animation: dwflash 0.8s ease-in-out infinite alternate; }
.dw-svg .geo-pt circle { fill: #16233a; stroke: #fff; stroke-width: 2; vector-effect: non-scaling-stroke; } .dw-svg .geo-pt text { fill: #fff; font-size: 12px; font-weight: 700; }
.dw-banner.dw-place { background: var(--warn-soft); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dw-page { position: relative; }
.dw-north { position: absolute; top: 8px; right: 8px; width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,0.9); border: 1px solid var(--line); display: grid; place-items: center; font-weight: 700; font-size: 11px; pointer-events: none; }
.dw-north b { display: flex; flex-direction: column; align-items: center; line-height: 0.9; font-size: 10px; } .dw-north i { font-style: normal; font-size: 13px; }
.fm-big.fm-ghost { background: var(--surface); color: var(--ink); border: 2px solid var(--line); text-decoration: none; }

/* Change markups: own forces vs subcontracted breakdown */
.chg-split { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 12px 0 4px; font-size: 13px; }
.chg-split > div { display: contents; }
.chg-split dt { color: var(--muted); }
.chg-split dd { margin: 0; }
.chg-lines td:nth-child(4) { min-width: 120px; }

/* Daily log: weather row and crews / site activity */
.dl-weather { display: flex; align-items: center; gap: 10px; margin: 4px 0 12px; }
.dl-entries { border-top: 1px solid var(--line-2, #e4e7ec); margin-top: 12px; padding-top: 10px; }
.dl-entries h3 { font-size: 14px; margin: 0 0 8px; }
.dl-group { margin-bottom: 8px; }
.dl-list { margin: 4px 0 0; padding-left: 18px; }
.dl-list li { margin: 2px 0; }
.dl-add { display: grid; grid-template-columns: 110px 1.4fr 1fr 80px 80px 1.6fr auto; gap: 6px; margin-top: 8px; align-items: center; }
.dl-add select[hidden] { display: none; }
@media (max-width: 720px) { .dl-add { grid-template-columns: 1fr 1fr; } .dl-add .dl-notes { grid-column: 1 / -1; } }

/* RFI distribution */
.rfi-dist { border-top: 1px solid var(--line-2, #e4e7ec); margin-top: 12px; padding-top: 10px; }
.rfi-dist h3 { font-size: 14px; margin: 0; }
.dist-list { margin: 6px 0; padding-left: 18px; }
.dist-add { display: grid; gap: 6px; margin-top: 6px; }
.dist-ext { display: grid; grid-template-columns: 1fr 1.3fr; gap: 6px; }

/* Takeoff */
.to-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 8px 0; }
.to-bar select { max-width: 280px; }
.to-scale { font-size: 12.5px; }
.to-scale.bad { color: #b42318; font-weight: 600; }
.to-hint { margin: 0 0 8px; }
.to-split { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 12px; align-items: start; }
.to-stage { background: #f2f4f7; border: 1px solid var(--line-2, #e4e7ec); border-radius: 8px; overflow: auto; max-height: 78vh; padding: 2px; }
.to-canvas { position: relative; width: max-content; }
.to-canvas canvas { display: block; background: #fff; }
.to-svg { position: absolute; inset: 0; cursor: crosshair; }
.to-list .rows li { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; cursor: pointer; }
.to-list li.to-sel { background: #eff8ff; }
.to-swatch { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.to-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.asm-parts select { max-width: 360px; }
.asm-parts input { width: 90px; }
@media (max-width: 900px) { .to-split { grid-template-columns: 1fr; } }
