/* ResiInspect — pine and brass */
:root {
  --display: "Segoe UI", "Avenir Next", system-ui, sans-serif;
  --sans: "Segoe UI", system-ui, -apple-system, sans-serif;
  --navy: #1A3338;
  --deep: #1A3338;
  --gold: #C9A227;
  --gold-soft: #D4B44A;
  --gold-deep: #A8871A;
  --honey: #C9A227;
  --teal: #2E6B63;
  --cream: #F6F3EB;
  --page: #F3F0E8;
  --panel: #FFFFFF;
  --alt: #F7F4EC;
  --title: #1A3338;
  --text: #1A2B2E;
  --muted: #5C6F73;
  --line: #D5D0C4;
  --soft-line: #E4DFD3;
  --shadow: 0 10px 28px rgba(26, 51, 56, 0.08);
  --radius: 14px;
  --sidebar: 268px;
  --ok: #2F6B4F;
  --warn: #C47B17;
  --repair: #C47B17;
  --danger: #B42318;
  --info: #2E6B63;
  --ink: #1A3338;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; background: var(--page); color: var(--text); font-family: var(--sans); }
body { font-size: 15px; line-height: 1.5; }
img { max-width: 100%; height: auto; }
button, input, select, textarea { font-family: inherit; font-size: 14px; }
a { color: var(--teal); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.app { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar);
  flex: 0 0 var(--sidebar);
  background: var(--navy);
  color: var(--cream);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 40;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 20px 18px;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid #2A4A50;
}
.brand img { width: 52px; height: auto; display: block; border-radius: 12px; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-wordmark {
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #F6F3EB;
  font-size: 13px;
  line-height: 1.15;
}
.brand-sub {
  display: block;
  margin-top: 6px;
  font-family: var(--display);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--gold);
}
.nav { display: flex; flex-direction: column; padding: 14px 12px; gap: 4px; flex: 1; overflow: auto; }
.nav a {
  color: #D5D0C4;
  text-decoration: none;
  font-family: var(--display);
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-size: 13px;
  padding: 10px 12px;
  border-radius: var(--radius);
}
.nav a:hover { background: #2A4A50; color: #fff; }
.nav a.active { background: #C9A2271A; color: var(--gold); box-shadow: inset 3px 0 0 var(--gold); }
.sidebar-foot { padding: 16px 20px 22px; border-top: 1px solid #2A4A50; color: #D5D0C4; font-size: 12px; }
.sidebar-foot p { margin: 0 0 4px; }
.sidebar-foot a { color: var(--gold); text-decoration: none; }

.shell { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 28px 12px;
  background: var(--page);
  position: sticky;
  top: 0;
  z-index: 20;
}
.menu-btn {
  display: none;
  background: var(--navy);
  color: var(--cream);
  border: 0;
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  cursor: pointer;
}
.topbar-title { flex: 1; min-width: 0; }
.eyebrow {
  display: block;
  font-family: var(--display);
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
  font-size: 12px;
  color: var(--gold-deep);
  margin-bottom: 2px;
}
h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: .005em;
  margin: 0;
  color: var(--title);
}
h1 { font-size: 30px; line-height: 1.15; }
h2 { font-size: 22px; }
h3 { font-size: 18px; }
h4 { font-size: 16px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.search-wrap input {
  width: min(360px, 36vw);
  border: 1px solid var(--line);
  background: #fff;
  border-radius: var(--radius);
  padding: 10px 12px;
}

.sample-banner {
  margin: 0 28px;
  background: #C9A2271A;
  border: 1px solid #C9A22766;
  color: var(--gold-deep);
  padding: 8px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
}
.view { padding: 20px 28px 48px; }

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin: 18px 0 22px;
}
.kpi {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  padding: 16px 18px 14px;
  position: relative;
  overflow: hidden;
}
.kpi::after {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--gold);
}
.kpi span { display: block; color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.kpi strong {
  display: block;
  font-family: var(--display);
  font-size: 32px;
  font-weight: 600;
  margin: 6px 0 2px;
}
.kpi small { color: var(--muted); font-size: 12px; }

.grid-2 { display: grid; grid-template-columns: 1.3fr .7fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}
.card + .card { margin-top: 16px; }
.card header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 12px;
}
.card header a { font-size: 13px; font-weight: 600; text-decoration: none; }

.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th {
  font-family: var(--display);
  font-weight: 500;
  letter-spacing: .06em;
  text-transform: uppercase;
  font-size: 12px;
  color: var(--muted);
}
tr.clickable { cursor: pointer; }
tr.clickable:hover { background: var(--alt); }
tr.area-group td {
  background: var(--navy);
  color: var(--cream);
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-size: 12px;
  border-bottom: 0;
}
tr.area-subtotal td {
  background: var(--alt);
  font-weight: 700;
  color: var(--title);
}

.btn {
  appearance: none;
  border: 0;
  background: var(--gold);
  color: var(--navy);
  font-weight: 700;
  padding: 10px 16px;
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  line-height: 1;
}
.btn:hover { background: var(--gold-soft); }
.btn.ghost {
  background: transparent;
  border: 1px solid var(--gold);
  color: var(--teal);
}
.btn.navy { background: var(--navy); color: var(--cream); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.small { padding: 7px 11px; font-size: 13px; }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 16px 0; }
.toolbar .grow { flex: 1; }
select, input[type="text"], input[type="search"], input[type="date"], input[type="email"], input[type="tel"], input[type="number"], input[type="password"], textarea {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: var(--radius);
  padding: 9px 11px;
  color: var(--title);
}
textarea { min-height: 88px; width: 100%; resize: vertical; }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
  white-space: nowrap;
  background: var(--alt);
  color: var(--title);
}
.badge.status-Scheduled { background: #2E6B631A; color: var(--info); }
.badge.status-Inspected { background: #2E6B6333; color: var(--teal); }
.badge.status-Bid-Drafted,
.badge.status-Bid\ Drafted { background: #C9A22733; color: var(--gold-deep); }
.badge.status-Bid-Sent,
.badge.status-Bid\ Sent { background: #C9A2271A; color: var(--gold-deep); }
.badge.status-Approved { background: #2F6B4F1A; color: var(--ok); }
.badge.status-In-Progress,
.badge.status-In\ Progress { background: #2E6B6322; color: var(--navy); }
.badge.status-Complete { background: #2F6B4F1A; color: var(--ok); }
.badge.item-pass { background: #2F6B4F1A; color: var(--ok); }
.badge.item-repair { background: #C47B171A; color: var(--repair); }
.badge.item-replace { background: #B423181A; color: var(--danger); }
.badge.item-na { background: #5C6F731A; color: var(--muted); }
.badge.sample { background: #C9A2271A; color: var(--gold-deep); }

.kanban {
  display: grid;
  grid-template-columns: repeat(7, minmax(150px, 1fr));
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
}
.kanban-col {
  background: var(--alt);
  border-radius: var(--radius);
  min-height: 220px;
  display: flex;
  flex-direction: column;
}
.kanban-col h3 {
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 12px 12px 8px;
  display: flex;
  justify-content: space-between;
}
.kanban-col h3 b { color: var(--muted); font-weight: 500; }
.kanban-list { display: flex; flex-direction: column; gap: 8px; padding: 0 8px 12px; min-height: 80px; flex: 1; }
.wo-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: block;
}
.wo-card:hover { border-color: var(--gold); }
.wo-card .wo-num, .muted { color: var(--muted); font-size: 12px; }
.wo-card h4 { font-size: 15px; margin: 4px 0; }
.wo-card p { margin: 0; font-size: 13px; color: var(--muted); }

.progress {
  height: 8px;
  background: #D5D0C4;
  border-radius: 99px;
  overflow: hidden;
  margin: 10px 0 6px;
}
.progress > span { display: block; height: 100%; background: var(--gold); }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid.thirds { grid-template-columns: repeat(4, 1fr); }
label.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
label.field input, label.field select, label.field textarea { font-weight: 500; color: var(--title); }

.photos { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.photos .photo-thumb {
  position: relative;
  width: 96px;
}
.photos img {
  width: 96px; height: 72px; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--line);
  display: block;
}
.photos button.photo-del {
  position: absolute; top: 4px; right: 4px;
  background: #B42318; color: #fff; border: 0; border-radius: 99px;
  width: 20px; height: 20px; font-size: 12px; cursor: pointer; line-height: 1;
}

.detail-grid { display: grid; grid-template-columns: 1.4fr .8fr; gap: 16px; }
.meta-list { display: grid; gap: 8px; }
.meta-list div { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.totals { margin-left: auto; width: min(320px, 100%); }
.totals div { display: flex; justify-content: space-between; padding: 6px 0; }
.totals .grand { font-family: var(--display); font-size: 22px; border-top: 2px solid var(--navy); padding-top: 10px; }

.invoice-sheet {
  max-width: 900px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 40px 44px;
}
.inv-head { display: flex; justify-content: space-between; gap: 24px; align-items: flex-start; }
.inv-head .co { display: flex; gap: 14px; align-items: center; }
.inv-head .co img { width: 72px; height: auto; border-radius: 12px; }
.inv-head address { font-style: normal; font-size: 13px; color: var(--muted); line-height: 1.55; }
.inv-kicker {
  font-family: var(--display);
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--gold-deep);
  font-size: 13px;
}
.inv-title { font-size: 36px; margin: 4px 0; }
.inv-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin: 28px 0; }
.inv-parties h3 { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.sample-stamp {
  display: inline-block;
  border: 2px solid var(--gold);
  color: var(--gold-deep);
  font-family: var(--display);
  letter-spacing: .14em;
  padding: 4px 10px;
  margin-top: 8px;
}
.inv-foot {
  margin-top: 36px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
}
.area-heading {
  margin: 22px 0 8px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--navy);
  font-size: 15px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.prop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.prop-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow); text-decoration: none; color: inherit; display: block;
}
.prop-card:hover { border-color: var(--gold); }
.prop-card h3 { margin: 8px 0 4px; }
.empty { padding: 28px; text-align: center; color: var(--muted); }

.modal-backdrop {
  position: fixed; inset: 0; background: #1A333866; display: flex; align-items: flex-start; justify-content: center;
  padding: 48px 16px; z-index: 80; overflow: auto;
}
.modal {
  width: min(680px, 100%);
  background: #fff;
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: 0 24px 80px #0006;
}
.modal h2, .modal h3 { margin-bottom: 16px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

.toast {
  position: fixed; right: 20px; bottom: 20px; background: var(--navy); color: var(--cream);
  padding: 12px 16px; border-left: 4px solid var(--gold); border-radius: var(--radius); z-index: 90;
}

.sidebar-backdrop { display: none; }

/* Inspection items */
.inspect-stack { display: grid; gap: 10px; }
.inspect-item {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.inspect-item.is-pass { border-left: 4px solid var(--ok); }
.inspect-item.is-repair { border-left: 4px solid var(--repair); }
.inspect-item.is-replace { border-left: 4px solid var(--danger); }
.inspect-item.is-na { border-left: 4px solid var(--muted); }
.inspect-item > header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
}
.area-chip {
  background: var(--navy);
  color: var(--cream);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 99px;
  white-space: nowrap;
}
.status-pills { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.status-pills button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 99px;
  padding: 6px 12px;
  font-weight: 700;
  cursor: pointer;
  color: var(--title);
}
.status-pills button.on[data-status="pass"] { background: var(--ok); color: #fff; border-color: var(--ok); }
.status-pills button.on[data-status="repair"] { background: var(--repair); color: #fff; border-color: var(--repair); }
.status-pills button.on[data-status="replace"] { background: var(--danger); color: #fff; border-color: var(--danger); }
.status-pills button.on[data-status="na"] { background: var(--muted); color: #fff; border-color: var(--muted); }

.bid-entry {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}
.area-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 8px;
}
.area-row .area-kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--gold-deep);
}
.area-row .area-name { font-size: 16px; color: var(--navy); }
.bid-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.measure-card {
  background: var(--alt);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 12px;
}
.measure-card h4 { margin-bottom: 6px; }
.measure-note {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--muted);
}
.measure-results {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 12px;
  font-size: 14px;
}
.measure-results strong { font-size: 18px; color: var(--navy); }

.room-block, .group-block {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin: 14px 0;
  padding: 4px 16px 16px;
}
.room-block > summary, .group-block > summary {
  cursor: pointer;
  list-style: none;
  padding: 14px 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: 18px;
  color: var(--title);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.room-block > summary::-webkit-details-marker,
.group-block > summary::-webkit-details-marker { display: none; }
.room-block > summary .hint { font-size: 13px; font-weight: 600; color: var(--muted); }

.cap-warning {
  display: none;
  background: #B4231814;
  border: 1px solid var(--danger);
  color: var(--danger);
  padding: 12px 16px;
  border-radius: var(--radius);
  font-weight: 700;
  margin: 12px 0;
}
.cap-warning.is-over { display: block; }

.add-line-form .field:first-child label,
.add-line-form > label.field:first-of-type {
  font-size: 13px;
}
.example-note { font-size: 12px; color: var(--muted); font-style: italic; }

.report-photos { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.report-photos img { width: 140px; height: 100px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }

.user-chip { position: relative; }
.user-menu-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 6px 10px 6px 6px;
  cursor: pointer;
  text-align: left;
}
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--navy); color: var(--cream);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 12px;
}
.user-meta { display: flex; flex-direction: column; }
.user-meta strong { font-size: 13px; }
.user-meta em { font-size: 11px; color: var(--muted); font-style: normal; }
.user-menu {
  position: absolute; right: 0; top: calc(100% + 6px);
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); min-width: 180px; z-index: 30;
}
.user-menu button {
  display: block; width: 100%; text-align: left;
  background: none; border: 0; padding: 10px 14px; cursor: pointer;
}
.user-menu button:hover { background: var(--alt); }

.app-wordmark { white-space: nowrap; font-weight: 700; letter-spacing: 0.01em; text-transform: none; }
.app-wordmark .wm-resi { color: #1A3338; }
.app-wordmark .wm-inspect { color: #C9A227; }
.sidebar .app-wordmark .wm-resi { color: #FFFFFF; }
.sidebar .app-wordmark .wm-inspect { color: #C9A227; }
.login-screen .app-wordmark .wm-resi { color: #1A3338; }
.login-screen .app-wordmark .wm-inspect { color: #C9A227; }
.app-mark { display: none; }

body.is-login { background: var(--navy); }
body.is-login .app, body.is-login #modal-root { display: none !important; }
.login-screen {
  display: none;
  min-height: 100vh;
  background:
    radial-gradient(1200px 500px at 50% -10%, #C9A22722, transparent 60%),
    var(--navy);
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
}
body.is-login .login-screen { display: flex; }
.login-card {
  width: min(720px, 100%);
  background: #FFFFFF;
  border: 1px solid #2A4A50;
  border-radius: 8px;
  padding: 36px 36px 28px;
  color: var(--title);
}
.login-brand { text-align: center; margin-bottom: 8px; }
.login-brand img { width: 88px; margin: 0 auto 12px; display: block; border-radius: 18px; }
.login-brand .brand-wordmark { font-size: 15px; letter-spacing: .14em; color: var(--navy); }
.login-brand .brand-sub { color: inherit; text-transform: none; letter-spacing: 0; font-size: 28px; margin: 0; }
.login-lead { text-align: center; color: var(--muted); margin: 12px 0 16px; }
.login-note { margin: 0 0 20px; }
.demo-accounts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 22px;
}
.demo-card {
  background: var(--alt);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  text-align: left;
  color: var(--title);
  cursor: pointer;
  width: 100%;
}
.demo-card:hover { border-color: var(--gold); }
.demo-card .role-tag {
  display: inline-block;
  color: var(--navy);
  background: var(--gold);
  font-family: var(--display);
  letter-spacing: .1em;
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 99px;
  margin-bottom: 10px;
}
.demo-card h3 { color: var(--navy); font-size: 20px; margin-bottom: 4px; }
.demo-card p { margin: 0 0 6px; color: var(--muted); font-size: 13px; }
.demo-card .email { color: var(--teal); font-size: 12px; font-weight: 600; }
.login-form {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 12px;
  align-items: end;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}
.login-form .field { color: var(--muted); }
.login-form input { background: #fff; border-color: var(--line); color: var(--title); }
.login-foot { text-align: center; color: var(--muted); font-size: 12px; margin: 18px 0 0; }

.tech-tabbar {
  display: none;
  background: #fff;
  border-top: 1px solid var(--line);
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  gap: 6px;
  justify-content: space-around;
}
.tech-tabbar a, .tech-tabbar button {
  background: none; border: 0; color: var(--muted);
  text-decoration: none; font-size: 11px; font-weight: 700;
  letter-spacing: .04em; text-transform: uppercase;
  padding: 8px; cursor: pointer;
}
.tech-tabbar a.active { color: var(--navy); }

@media (max-width: 1100px) {
  .kpi-grid, .grid-2, .grid-3, .detail-grid, .form-grid, .inv-parties, .form-grid.thirds { grid-template-columns: 1fr 1fr; }
  .search-wrap input { width: 180px; }
  .kanban { grid-template-columns: repeat(7, minmax(140px, 1fr)); }
}
@media (max-width: 860px) {
  .sidebar {
    position: fixed; left: 0; top: 0; transform: translateX(-105%); transition: transform .2s ease;
  }
  body.nav-open .sidebar { transform: none; box-shadow: 8px 0 40px #0005; }
  .sidebar-backdrop { display: block; position: fixed; inset: 0; background: #1A333866; z-index: 35; }
  .menu-btn { display: inline-flex; align-items: center; justify-content: center; }
  .topbar, .sample-banner, .view { padding-left: 16px; padding-right: 16px; }
  .sample-banner { margin: 0 16px; }
  h1 { font-size: 24px; }
  .invoice-sheet { padding: 22px; }
  .login-form, .demo-accounts, .kpi-grid, .form-grid, .form-grid.thirds, .bid-fields, .detail-grid, .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .user-meta { display: none; }
  .tech-tabbar { display: flex; position: sticky; bottom: 0; z-index: 15; }
  .app-mark { display: inline; font-size: 13px; }
}

@media print {
  body { background: #fff; }
  .sidebar, .topbar, .sample-banner, .toolbar, .no-print, #toast-root, #modal-root, .tech-tabbar, .menu-btn { display: none !important; }
  .app { display: block; }
  .view { padding: 0; }
  .invoice-sheet { box-shadow: none; border: 0; max-width: none; padding: 0; }
  .cap-warning { display: block; }
  .cap-warning:not(.is-over) { display: none; }
}

.walk-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}
.walk-nav .walk-count { flex: 1; font-weight: 700; color: var(--navy); }
.btn:disabled, button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.photo-gate {
  background: #B4231814;
  border: 1px solid var(--danger);
  color: var(--danger);
  padding: 10px 14px;
  border-radius: var(--radius);
  font-weight: 700;
  margin: 10px 0;
}
.photo-needed {
  background: #C47B1714;
  border: 1px solid var(--repair);
  color: var(--gold-deep);
  padding: 8px 12px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 13px;
  margin: 8px 0;
}
.area-progress { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.area-progress li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  background: var(--alt);
  border-radius: 10px;
  font-size: 14px;
}
.area-progress li.done { background: #2F6B4F1A; }
.area-progress .count { font-weight: 700; white-space: nowrap; }
.walk-stage { margin-top: 8px; }
.status-pills button.on[data-status="on"] { background: var(--ok); color: #fff; border-color: var(--ok); }
.status-pills button.on[data-status="off"] { background: var(--danger); color: #fff; border-color: var(--danger); }
.status-pills button.on[data-status="not-available"] { background: var(--muted); color: #fff; border-color: var(--muted); }

.damage-box {
  margin-top: 14px;
  padding: 12px 14px;
  background: var(--alt);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.damage-box h4 { margin-bottom: 10px; }
.damage-list { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 8px; }
.damage-list li {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px;
}
.damage-add { display: grid; gap: 10px; }

.photo-hint { font-size: 14px; margin: 8px 0 12px; color: var(--ink); }
.identity-box, .burner-box {
  margin: 12px 0;
  padding: 12px 14px;
  background: var(--alt);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.identity-box h4 { margin-bottom: 6px; }
.photos .photo-kind {
  position: absolute; bottom: 6px; left: 6px;
  background: #1A3338CC; color: #fff; font-size: 10px; font-weight: 700;
  padding: 2px 6px; border-radius: 6px;
}
.photos .star-btn {
  position: absolute; top: 4px; left: 4px;
  border: 0; background: rgba(14,26,28,.75); color: #F6F3EB;
  border-radius: 999px; width: 26px; height: 26px; cursor: pointer; line-height: 1;
}
.photos .star-btn.on, .star-btn.on { color: #C9A227; }
.photos .photo-thumb.is-marketing img { outline: 2px solid var(--gold, #C9A227); }
.star-btn.text {
  background: transparent; color: #F6F3EB; border: 1px solid #C9A227;
  border-radius: 999px; padding: 8px 14px; cursor: pointer; font-weight: 700;
}

body.tour-open .sidebar,
body.tour-open .topbar,
body.tour-open .sample-banner,
body.tour-open .tech-tabbar,
body.tour-open .menu-btn { display: none !important; }
body.tour-open .app { display: block; }
body.tour-open .view { padding: 0; max-width: none; }
.tour-overlay {
  position: fixed; inset: 0; z-index: 80;
  background: #0E1A1C; color: #F6F3EB;
  display: flex; flex-direction: column;
}
.tour-bar {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 14px 20px;
}
.tour-kicker { letter-spacing: .08em; text-transform: uppercase; font-size: 12px; color: #C9A227; margin: 0; }
.tour-overlay h2 { margin: 2px 0 4px; font-size: 28px; }
.tour-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.tour-stage {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 16px;
  padding: 8px 16px 20px; min-height: 0;
}
.tour-stage img {
  max-width: min(1100px, calc(100vw - 220px));
  max-height: calc(100vh - 220px);
  object-fit: contain; border-radius: 16px; background: #142326;
}
.tour-nav {
  background: #C9A227; color: #1A3338; border: 0; border-radius: 999px;
  padding: 12px 18px; font-weight: 700; cursor: pointer;
}
.tour-nav:disabled { opacity: .35; cursor: not-allowed; }
.framing-tips {
  margin: 0 20px 8px; padding: 10px 14px;
  background: #C9A22714; border: 1px solid #C9A22755;
  border-radius: 10px; color: var(--navy);
}
.tour-overlay .framing-tips { color: #F6F3EB; background: #C9A2271A; border-color: #C9A22766; }
.marketing-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px;
}
.marketing-card { margin: 0; }
.marketing-card img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); }
.marketing-card figcaption { margin-top: 8px; font-size: 14px; }

@media (max-width: 720px) {
  .tour-stage { flex-direction: column; }
  .tour-stage img { max-width: calc(100vw - 32px); max-height: calc(100vh - 280px); }
}


/* —— Added inspection, AI, HUD, Aaron, and Pro camera styles —— */
.sop-badge {
  display: inline-block; margin-left: 8px; padding: 2px 8px;
  border-radius: 999px; background: #1A333814; color: #1A3338;
  font-size: 11px; font-weight: 700; letter-spacing: .03em;
}
.example-note { color: var(--muted); font-size: 13px; }
.ai-card { display: grid; grid-template-columns: 160px 1fr; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); }
.ai-card img { width: 160px; height: 120px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.ai-card .conf { color: #C9A227; font-weight: 700; }
.paint-toggle { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 16px; }
.paint-toggle .example-note { flex: 1 1 100%; }
.hud-yes { color: #1d6b3a; font-weight: 800; }
.hud-no { color: #9b2c2c; font-weight: 800; }
#hud-status-banner { padding: 10px 14px; border-radius: 10px; background: #f6f3eb; border: 1px solid var(--line); }
.hud-item, .ready-item, .debris-row { padding: 14px 0; border-top: 1px solid var(--line); }
.status-pills button.on { background: var(--navy); color: #fff; }
.lockbox-entry { display: grid; grid-template-columns: 120px 1fr; gap: 12px; margin: 12px 0; }
.lockbox-photo { width: 120px; height: 90px; object-fit: cover; border-radius: 10px; }
.lockbox-code { font-family: ui-monospace, monospace; letter-spacing: .12em; }
.portal-list { padding-left: 18px; }
.report-sheet { margin-bottom: 28px; }
.def-row { padding: 12px 0; border-top: 1px solid var(--line); }
.repair-suggest {
  margin-top: 10px; padding: 12px 14px;
  background: #C9A22714; border: 1px solid #C9A22755; border-radius: 10px;
}
.repair-suggest h4 { margin: 0 0 8px; }
.repair-suggest ul { margin: 6px 0 8px 18px; }
.aaron-guide {
  margin: 16px 0; padding: 14px 16px;
  background: #1A33380d; border: 1px solid var(--line); border-radius: 14px;
}
.aaron-guide header { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.aaron-guide header p { margin: 0; color: var(--muted); font-size: 12px; }
.aaron-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: #C9A227; color: #1A3338; display: inline-flex;
  align-items: center; justify-content: center; font-weight: 800;
}
.aaron-dock {
  position: fixed; right: 18px; bottom: 18px; z-index: 40;
  display: flex; flex-direction: column; align-items: flex-end; gap: 10px;
}
.aaron-bubble {
  background: #C9A227; color: #1A3338; border: 0; border-radius: 999px;
  padding: 12px 18px; font-weight: 800; cursor: pointer;
  box-shadow: 0 8px 24px #1A333833;
}
.aaron-panel {
  width: min(380px, calc(100vw - 28px)); height: 420px;
  background: #fff; border: 1px solid var(--line); border-radius: 16px;
  display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 16px 40px #1A333829;
}
.aaron-panel header {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; background: #1A3338; color: #F6F3EB;
}
.aaron-panel header span { flex: 1; font-size: 12px; opacity: .8; }
.aaron-panel header a, .aaron-panel header button { color: #C9A227; background: none; border: 0; cursor: pointer; }
.aaron-log { flex: 1; overflow: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.aaron-msg { max-width: 90%; padding: 8px 10px; border-radius: 12px; white-space: pre-wrap; font-size: 14px; }
.aaron-msg.is-user { align-self: flex-end; background: #C9A227; color: #1A3338; }
.aaron-msg.is-bot { align-self: flex-start; background: #f3efe4; }
.aaron-composer, #aaron-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); }
.aaron-composer input, #aaron-form input { flex: 1; }
#aaron-page .aaron-log { min-height: 280px; border: 1px solid var(--line); border-radius: 12px; }
#video-record video, #pro-video { width: 100%; background: #111; border-radius: 12px; max-height: 52vh; }
.pro-view { position: relative; background: #111; border-radius: 12px; overflow: hidden; }
.pro-grid { pointer-events: none; position: absolute; inset: 0; }
.pro-grid.is-off { display: none; }
.pro-grid i:nth-child(1) { position:absolute; left:33.333%; top:0; bottom:0; width:1px; background:rgba(255,255,255,.5); }
.pro-grid i:nth-child(2) { position:absolute; left:66.666%; top:0; bottom:0; width:1px; background:rgba(255,255,255,.5); }
.pro-grid i:nth-child(3) { position:absolute; top:33.333%; left:0; right:0; height:1px; background:rgba(255,255,255,.5); }
.pro-grid i:nth-child(4) { position:absolute; top:66.666%; left:0; right:0; height:1px; background:rgba(255,255,255,.5); }
.pro-grid b:nth-child(5) { position:absolute; left:50%; top:0; bottom:0; width:1px; background:#C9A227cc; }
.pro-grid b:nth-child(6) { position:absolute; top:50%; left:0; right:0; height:1px; background:#C9A22799; }
.pro-focus {
  position: absolute; width: 54px; height: 54px; margin: -27px 0 0 -27px;
  border: 2px solid #C9A227; border-radius: 8px; pointer-events: none;
}
.toolbar.wrap { flex-wrap: wrap; }
label.check { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }
#pro-limits { max-width: 72ch; }
@media (max-width: 860px) {
  .aaron-dock { bottom: 72px; right: 12px; }
  .ai-card { grid-template-columns: 1fr; }
  .lockbox-entry { grid-template-columns: 1fr; }
}
@media print {
  .aaron-dock, .aaron-guide, #aaron-root { display: none !important; }
}

.aaron-engine { margin: 6px 0 0; font-size: 11px; color: var(--muted); }
.aaron-sources { margin: 8px 0 0; padding-left: 18px; font-size: 12px; }
.aaron-sources a { color: #0C7388; }
.aaron-search-entry { margin-top: 8px; overflow: auto; }
.aaron-msg.is-pending { opacity: .7; font-style: italic; }
