:root { --blue:#1f4e79; --blue2:#2d6aa3; --ink:#1d2733; --muted:#5f6f80; --line:#dde3ea; --bg:#f4f6f9; --card:#fff;
  --tenant:#b42318; --cond:#b54708; --owner:#1f4e79; --nc:#667085; --ok:#067647; --r:10px; }
* { box-sizing:border-box; }
html,body { margin:0; background:var(--bg); color:var(--ink); font:15px/1.45 system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif; }
a { color:var(--blue2); }
.topbar { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:10px 18px; background:var(--blue); color:#fff; position:sticky; top:0; z-index:20; flex-wrap:wrap; }
.brand { display:flex; align-items:center; gap:10px; color:#fff; text-decoration:none; }
.brand-mark { background:#fff; color:var(--blue); font-weight:800; letter-spacing:1px; padding:4px 7px; border-radius:6px; font-size:14px; }
.brand-text { font-weight:700; line-height:1.1; } .brand-text small { display:block; font-weight:400; opacity:.85; font-size:12px; }
#nav { display:flex; gap:6px; align-items:center; flex-wrap:wrap; }
#nav a, #nav button { color:#fff; text-decoration:none; background:transparent; border:1px solid rgba(255,255,255,.35); border-radius:7px; padding:5px 10px; font-size:13px; cursor:pointer; }
#nav a.active { background:rgba(255,255,255,.18); }
#nav .who { font-size:12px; opacity:.85; margin-right:4px; }
main { max-width:1280px; margin:0 auto; padding:16px; }
.pad { padding:16px; } .muted { color:var(--muted); } .small { font-size:13px; } .tiny { font-size:12px; }
.foot { text-align:center; color:var(--muted); font-size:12px; padding:24px 10px 30px; }
h1 { font-size:22px; margin:4px 0 12px; } h2 { font-size:18px; margin:0 0 10px; } h3 { font-size:15px; margin:0 0 8px; }
.card { background:var(--card); border:1px solid var(--line); border-radius:var(--r); padding:16px; margin-bottom:16px; box-shadow:0 1px 2px rgba(16,24,40,.04); }
.row { display:flex; gap:12px; flex-wrap:wrap; align-items:center; } .row.between { justify-content:space-between; } .grow { flex:1; }
.grid { display:grid; gap:14px; } .grid.cols2 { grid-template-columns:repeat(auto-fit,minmax(320px,1fr)); } .grid.cols3 { grid-template-columns:repeat(auto-fit,minmax(260px,1fr)); }
.btn { display:inline-flex; align-items:center; justify-content:center; gap:6px; background:var(--blue2); color:#fff; border:0; border-radius:8px; padding:9px 14px; font-size:14px; font-weight:600; cursor:pointer; text-decoration:none; }
.btn:hover { filter:brightness(1.07); } .btn:disabled { opacity:.55; cursor:not-allowed; }
.btn.secondary { background:#fff; color:var(--blue); border:1px solid #b9c6d4; } .btn.danger { background:#fff; color:var(--tenant); border:1px solid #f1b8b2; }
.btn.small { padding:5px 9px; font-size:12.5px; font-weight:500; }
.btn.huge { font-size:19px; padding:16px 28px; border-radius:12px; background:linear-gradient(180deg,#2d6aa3,#1f4e79); box-shadow:0 3px 10px rgba(31,78,121,.25); }
input, select, textarea { font:inherit; padding:8px 10px; border:1px solid #c4ced8; border-radius:8px; background:#fff; color:var(--ink); max-width:100%; }
textarea { width:100%; min-height:60px; } label { font-size:13px; color:var(--muted); display:block; margin-bottom:3px; }
.field { margin-bottom:10px; } .field input, .field select { width:100%; }
.form-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(200px,1fr)); gap:10px; }
.login { max-width:400px; margin:40px auto; }
.alert { padding:10px 12px; border-radius:8px; margin:8px 0; font-size:14px; }
.alert.warn { background:#fffaeb; border:1px solid #fedf89; color:#7a2e0e; } .alert.err { background:#fef3f2; border:1px solid #fecdca; color:#912018; }
.alert.ok { background:#ecfdf3; border:1px solid #abefc6; color:#05603a; } .alert.info { background:#eff8ff; border:1px solid #b2ddff; color:#175cd3; }
#flash { position:fixed; right:16px; bottom:16px; z-index:50; display:flex; flex-direction:column; gap:8px; max-width:420px; }
#flash .alert { box-shadow:0 4px 14px rgba(0,0,0,.12); }
.list { list-style:none; margin:0; padding:0; }
.prop-item { display:flex; justify-content:space-between; align-items:center; gap:10px; padding:12px 4px; border-bottom:1px solid var(--line); text-decoration:none; color:inherit; }
.prop-item:hover { background:#f8fafc; } .prop-item .addr { font-weight:600; }
.badge { display:inline-block; padding:2px 8px; border-radius:999px; font-size:12px; font-weight:600; background:#eef2f6; color:#344054; white-space:nowrap; }
.badge.Tenant { background:#fef3f2; color:var(--tenant); } .badge.Conditional { background:#fffaeb; color:var(--cond); }
.badge.Owner { background:#eff8ff; color:var(--owner); } .badge.nc { background:#f2f4f7; color:var(--nc); }
.badge.ok { background:#ecfdf3; color:var(--ok); } .badge.warn { background:#fffaeb; color:var(--cond); } .badge.err { background:#fef3f2; color:var(--tenant); }
.uploads { display:grid; grid-template-columns:repeat(auto-fit,minmax(290px,1fr)); gap:14px; }
.upcard h3 { display:flex; justify-content:space-between; align-items:center; }
.drop { border:2px dashed #b9c6d4; border-radius:10px; padding:16px 10px; text-align:center; color:var(--muted); cursor:pointer; background:#fafcfe; transition:.15s; }
.drop.over { border-color:var(--blue2); background:#eef5fc; color:var(--blue); } .drop strong { color:var(--blue); }
.drop input[type=file] { display:none; }
.files { list-style:none; margin:10px 0 0; padding:0; }
.files li { display:flex; gap:9px; align-items:center; padding:6px 0; border-top:1px solid var(--line); font-size:13px; }
.files img, .files .ph { width:44px; height:44px; object-fit:cover; border-radius:6px; background:#eef2f6; flex:none; display:flex; align-items:center; justify-content:center; font-size:10px; color:var(--muted); font-weight:700; }
.files li { flex-wrap:wrap; } .files .name { flex:1 1 150px; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.progress { height:6px; background:#e4e9ef; border-radius:4px; overflow:hidden; margin-top:8px; } .progress > div { height:100%; background:var(--blue2); width:0; transition:width .2s; }
.analysis-hero { text-align:center; padding:22px 12px; }
.chips { display:flex; gap:10px; flex-wrap:wrap; margin:10px 0; }
.chip { flex:1; min-width:140px; border:1px solid var(--line); border-radius:10px; padding:10px 12px; background:#fff; }
.chip .k { font-size:12px; color:var(--muted); } .chip .v { font-size:20px; font-weight:700; }
.chip.Tenant .v { color:var(--tenant); } .chip.Conditional .v { color:var(--cond); } .chip.Owner .v { color:var(--owner); }
table.items { width:100%; border-collapse:collapse; font-size:13.5px; }
table.items th { text-align:left; font-size:12px; text-transform:uppercase; letter-spacing:.3px; color:var(--muted); padding:8px 6px; border-bottom:2px solid var(--line); background:#fafbfc; position:sticky; top:52px; z-index:2; }
table.items td { padding:8px 6px; border-bottom:1px solid var(--line); vertical-align:top; }
table.items tr.roomhead td { background:#f2f6fa; font-weight:700; color:var(--blue); padding:6px; }
table.items select { padding:5px 6px; font-size:13px; } table.items input.amt { width:92px; padding:5px 6px; text-align:right; }
.desc { font-weight:600; } .why { color:var(--muted); font-size:12.5px; margin-top:3px; } .ai-was { font-size:11.5px; color:var(--cond); margin-top:3px; }
.thumbs { display:flex; gap:4px; flex-wrap:wrap; align-items:center; } .thumbs img { width:46px; height:46px; object-fit:cover; border-radius:5px; border:1px solid var(--line); }
.thumbs .lbl { font-size:10.5px; color:var(--muted); width:100%; }
.conf { font-variant-numeric:tabular-nums; } .conf.lo { color:var(--tenant); } .conf.mid { color:var(--cond); } .conf.hi { color:var(--ok); }
details summary { cursor:pointer; color:var(--blue2); font-size:12.5px; }
.toolbar { display:flex; gap:8px; flex-wrap:wrap; align-items:center; margin:10px 0; }
.modal-bg { position:fixed; inset:0; background:rgba(16,24,40,.45); display:flex; align-items:flex-start; justify-content:center; z-index:60; padding:30px 12px; overflow:auto; }
.modal { background:#fff; border-radius:12px; max-width:900px; width:100%; padding:18px; }
.gallery { display:grid; grid-template-columns:repeat(auto-fill,minmax(120px,1fr)); gap:8px; } .gallery img { width:100%; height:110px; object-fit:cover; border-radius:6px; border:1px solid var(--line); }
.gallery figure { margin:0; } .gallery figcaption { font-size:11px; color:var(--muted); }
.statute pre { white-space:pre-wrap; font:13px/1.5 ui-monospace,Menlo,Consolas,monospace; background:#fafbfc; border:1px solid var(--line); border-radius:8px; padding:10px; max-height:420px; overflow:auto; }
.hide { display:none !important; }
@media (max-width: 760px) {
  main { padding:10px; } .card { padding:12px; } h1 { font-size:19px; }
  table.items thead { display:none; } table.items, table.items tbody, table.items tr, table.items td { display:block; width:100%; }
  table.items tr { border:1px solid var(--line); border-radius:10px; margin-bottom:10px; padding:6px; background:#fff; display:grid; grid-template-columns:1fr 1fr; }
  table.items tr.roomhead { display:block; } table.items td.span2 { grid-column:1 / -1; }
  .topbar { position:static; } table.items th { position:static; }
  table.items tr.roomhead { border:0; background:transparent; padding:0; } table.items td { border:0; padding:4px 6px; }
  table.items td[data-l]::before { content:attr(data-l); display:block; font-size:11px; color:var(--muted); text-transform:uppercase; }
  .btn.huge { width:100%; }
}

/* ---- action feedback ---- */
#flash { z-index:80; }  /* above modals so feedback is never hidden */
#flash .toast { display:flex; align-items:flex-start; gap:10px; }
#flash .toast > span { flex:1; }
.alert .x { background:none; border:0; font-size:18px; line-height:1; cursor:pointer; color:inherit; opacity:.6; padding:0 2px; }
.alert .x:hover { opacity:1; }
.btn.busy, .btn:disabled { opacity:.7; cursor:progress; }
.btn:disabled:not(.busy) { cursor:not-allowed; }
.spin { display:inline-block; width:13px; height:13px; border:2px solid currentColor; border-right-color:transparent; border-radius:50%; animation:spin .7s linear infinite; vertical-align:-2px; }
@keyframes spin { to { transform:rotate(360deg); } }
.notice { margin:10px 0; }
.notice .toolbar { margin:8px 0 0; }
ul.plain { list-style:none; padding:0; margin:6px 0; } ul.plain li { margin:3px 0; }
ul.warnlist li { color:#7a2e0e; }
.err-text { color:var(--tenant); }
.nowrap { white-space:nowrap; } .scroll-x { overflow-x:auto; } .mono { font-family:ui-monospace,Menlo,Consolas,monospace; font-size:12.5px; }
.picker { display:inline-flex; gap:6px; flex-wrap:wrap; align-items:center; }
.picker .vendor-sel { min-width:260px; max-width:420px; }
.picker input[type=search] { width:170px; }
.assign { border-top:1px solid var(--line); margin-top:6px; }
.assign .toolbar .grow { flex:1; min-width:220px; }
.row .grow { flex:1; min-width:200px; }
.timeline { list-style:none; padding:0; margin:0; }
.timeline li { border-top:1px solid var(--line); padding:8px 0; }
.timeline .row { gap:8px; flex-wrap:wrap; }
pre.mailbody, textarea.mailbody { white-space:pre-wrap; font:13px/1.45 ui-monospace,Menlo,Consolas,monospace; }
pre.mailbody { background:#f8fafc; border:1px solid var(--line); border-radius:6px; padding:8px; margin:6px 0 0; }
.compose .field input, .compose .field select { width:100%; }

/* ---- locked controls must look locked ---- */
select:disabled, input:disabled, textarea:disabled { background:#f2f4f7; color:#98a2b3; border-color:#e4e7ec; cursor:not-allowed; }
.update-banner { position:sticky; top:0; z-index:90; margin:0; border-radius:0; text-align:center; }

/* ---- per-line vendor ---- */
th.selcol, td.selcol { width:28px; text-align:center; }
td.vcol { min-width:200px; }
.vpick { display:inline-flex; align-items:center; justify-content:space-between; gap:6px; width:100%; max-width:260px; min-width:180px; font:inherit; font-size:13px; text-align:left;
  padding:7px 9px; border:1px solid #c4ced8; border-radius:8px; background:#fff; color:var(--ink); cursor:pointer; }
.vpick .vl { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.vpick .caret { color:var(--muted); flex:none; }
.vpick:hover { border-color:var(--blue2); } .vpick:focus-visible { outline:2px solid var(--blue2); outline-offset:1px; }
.vpick.empty { color:var(--muted); } .vpick.needs { border-style:dashed; border-color:#f79009; color:#b54708; background:#fffcf5; }
.vchooser { position:absolute; z-index:75; background:#fff; border:1px solid var(--line); border-radius:10px; box-shadow:0 12px 32px rgba(16,24,40,.18); padding:8px; }
.vchooser .vhead { display:flex; gap:6px; } .vchooser .vhead input { flex:1; min-width:0; } .vchooser .vhead select { max-width:130px; }
.vlist { max-height:290px; overflow:auto; margin-top:6px; }
.vgroup { font-size:11px; text-transform:uppercase; letter-spacing:.4px; color:var(--muted); padding:8px 6px 3px; }
.vopt { padding:7px 8px; border-radius:6px; cursor:pointer; font-size:13.5px; }
.vopt.active, .vopt:hover { background:#eef5fc; } .vopt.cur { font-weight:700; } .vopt.cur::after { content:' ✓'; color:var(--ok); }
.vopt.none { color:var(--tenant); }
.vfoot { padding:6px 4px 0; }
.vsummary { border-top:1px solid var(--line); margin-top:8px; padding-top:4px; }
.vsummary h3 { margin:8px 0; font-size:15px; }
table.items.compact th { position:static; } table.items.compact td { padding:6px; }
ul.sowlist li { margin:6px 0; }
