:root {
  color-scheme: light;
  --bg: #f3f5f8;
  --surface: #ffffff;
  --surface-2: #edf1f6;
  --surface-3: #f8fafc;
  --text: #111827;
  --muted: #667085;
  --line: #dfe4ea;
  --navy: #0b1220;
  --blue: #1976d2;
  --blue-dark: #125aa2;
  --blue-soft: #e8f2fd;
  --green: #18794e;
  --green-soft: #e9f7ef;
  --amber: #9a6700;
  --amber-soft: #fff5d6;
  --red: #b42318;
  --red-soft: #ffebe9;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(15, 23, 42, .08);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(25,118,210,.25); outline-offset: 2px; }

.startup-gate { min-height: 100dvh; display: grid; place-content: center; justify-items: center; gap: 18px; padding: 28px; background: linear-gradient(155deg, #f8fbff 0%, #edf4fc 46%, #e7edf5 100%); }
.startup-brand { display: flex; align-items: center; gap: 14px; }
.startup-mark { width: 58px; height: 58px; object-fit: contain; }
.startup-lockup { display: flex; align-items: center; }
.startup-wordmark { display: block; width: 140px; height: auto; }
.startup-lockup span { margin-left: 12px; padding-left: 12px; border-left: 1px solid var(--line); color: var(--muted); font-size: 12px; font-weight: 900; letter-spacing: .12em; }
.startup-gate p { margin: 0; color: var(--muted); font-size: 13px; font-weight: 750; }

.app-shell { min-height: 100dvh; padding-bottom: calc(82px + env(safe-area-inset-bottom)); }
.topbar { position: sticky; top: 0; z-index: 20; height: calc(64px + env(safe-area-inset-top)); display: flex; align-items: center; justify-content: space-between; padding: env(safe-area-inset-top) 18px 0; background: rgba(255,255,255,.93); backdrop-filter: blur(14px); border-bottom: 1px solid rgba(223,228,234,.85); }
.brand { display: flex; align-items: center; border: 0; background: transparent; padding: 5px 6px; color: var(--text); }
.topbar-wordmark { display: block; width: 94px; height: auto; }
.brand-os { margin-left: 8px; padding-left: 8px; border-left: 1px solid var(--line); font-size: 11px; font-weight: 900; letter-spacing: .14em; color: var(--muted); }
.desktop-menu { display: none; }
.icon-button { width: 42px; height: 42px; border: 0; border-radius: 12px; background: var(--surface-2); color: var(--text); font-size: 24px; display: grid; place-items: center; }
.content { width: min(100%, 1120px); margin: 0 auto; padding: 18px 16px 36px; }

.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.page-heading h1 { margin: 0; font-size: clamp(25px, 5vw, 34px); line-height: 1.05; letter-spacing: -.035em; }
.page-heading p { margin: 5px 0 0; color: var(--muted); }
.eyebrow { margin: 0 0 4px !important; text-transform: uppercase; letter-spacing: .1em; color: var(--blue) !important; font-size: 10px !important; font-weight: 900; }
.date-pill { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 8px 12px; color: var(--muted); font-size: 13px; white-space: nowrap; }
.record-id { color: #98a2b3; font-size: 11px; font-weight: 800; letter-spacing: .02em; white-space: nowrap; }

.section { margin-top: 22px; }
.compact-section { margin-top: 0; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.section-title h2 { margin: 0; font-size: 17px; }
.section-title button { border: 0; background: transparent; color: var(--blue); font-weight: 800; padding: 8px 0; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 2px 8px rgba(15,23,42,.03); }
.card + .card { margin-top: 10px; }
.card-body { padding: 16px; }
.card-button { width: 100%; color: inherit; text-align: left; }
button.card { font: inherit; }
button.card:hover { border-color: #c7d0dc; box-shadow: 0 5px 14px rgba(15,23,42,.06); }

.stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
.stat { padding: 15px; border: 1px solid var(--line); }
.stat strong { display: block; font-size: 25px; letter-spacing: -.04em; }
.stat span { display: block; margin-top: 3px; color: var(--muted); font-size: 13px; }
.stat.attention strong { color: var(--amber); }

.job-card { padding: 14px; display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: start; border: 1px solid var(--line); background: var(--surface); }
.scheduled-job-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; overflow: hidden; margin-bottom: 10px; }
.scheduled-job-card > .job-card { width: 100%; border: 0; border-radius: 0; box-shadow: none; text-align: left; }
.scheduled-job-calendar { min-width: 116px; border: 0; border-left: 1px solid var(--line); background: var(--blue-soft); color: var(--blue-dark); padding: 10px 12px; display: grid; place-items: center; align-content: center; gap: 4px; font-size: 11px; font-weight: 850; }
.scheduled-job-calendar > span { font-size: 20px; line-height: 1; }
.scheduled-job-calendar:hover, .scheduled-job-calendar:focus-visible { background: #d9eaff; }
.time { min-width: 62px; font-weight: 850; font-size: 13px; }
.job-main { min-width: 0; }
.job-main h3 { margin: 0; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job-main p { margin: 4px 0 0; color: var(--muted); font-size: 13px; line-height: 1.4; }
.card-title-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.badge { display: inline-flex; align-items: center; min-height: 25px; padding: 3px 8px; border-radius: 999px; font-size: 11px; font-weight: 800; background: var(--surface-2); color: #344054; white-space: nowrap; }
.badge.green { background: var(--green-soft); color: var(--green); }
.badge.amber { background: var(--amber-soft); color: var(--amber); }
.badge.red { background: var(--red-soft); color: var(--red); }
.badge.blue { background: var(--blue-soft); color: var(--blue-dark); }
.chevron { color: #98a2b3; font-size: 20px; align-self: center; }

.action-list { overflow: hidden; }
.action-row { width: 100%; border: 0; border-bottom: 1px solid var(--line); background: var(--surface); padding: 14px 15px; display: flex; align-items: center; gap: 12px; text-align: left; }
.action-row:last-child { border-bottom: 0; }
.action-row:hover { background: var(--surface-3); }
.action-icon { flex: 0 0 38px; width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--surface-2); font-weight: 900; font-size: 13px; }
.action-copy { flex: 1; min-width: 0; }
.action-copy strong { display: block; font-size: 14px; }
.action-copy span { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; }
.action-count { min-width: 27px; height: 27px; display: grid; place-items: center; border-radius: 999px; background: var(--amber-soft); color: var(--amber); font-size: 12px; font-weight: 800; }
.row-status { display: none; max-width: 180px; color: var(--muted); font-size: 11px; text-align: right; }

.list-toolbar { display: flex; gap: 8px; margin-bottom: 12px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.list-toolbar::-webkit-scrollbar { display: none; }
.filter-chip { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 8px 12px; white-space: nowrap; color: var(--muted); }
.filter-chip.active { background: var(--navy); color: white; border-color: var(--navy); }
.date-divider { margin: 18px 3px 8px; color: var(--muted); font-size: 12px; font-weight: 850; text-transform: uppercase; letter-spacing: .08em; }

.client-card { padding: 14px; display: flex; gap: 12px; align-items: center; border: 1px solid var(--line); background: var(--surface); }
.avatar { flex: 0 0 44px; width: 44px; height: 44px; border-radius: 14px; background: var(--blue-soft); color: var(--blue); display: grid; place-items: center; font-weight: 900; }
.avatar.large { flex-basis: 58px; width: 58px; height: 58px; border-radius: 18px; font-size: 18px; }
.avatar.small { flex-basis: 38px; width: 38px; height: 38px; border-radius: 11px; }
.client-copy { flex: 1; min-width: 0; }
.client-copy h3 { margin: 0; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.client-copy p { margin: 4px 0 0; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.empty { padding: 28px 18px; text-align: center; color: var(--muted); }
.empty-state { padding: 28px 18px; text-align: center; }
.empty-state h3 { margin: 8px 0 0; font-size: 16px; }
.empty-state p { margin: 6px auto 14px; max-width: 420px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.empty-icon { width: 42px; height: 42px; margin: 0 auto; display: grid; place-items: center; border-radius: 14px; background: var(--surface-2); color: var(--muted); font-size: 24px; }
.muted-text { color: var(--muted); font-size: 13px; }

.bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; height: calc(70px + env(safe-area-inset-bottom)); padding: 6px 8px env(safe-area-inset-bottom); background: rgba(255,255,255,.97); backdrop-filter: blur(18px); border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(5,1fr); }
.nav-item { border: 0; background: transparent; color: #7a8493; border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.nav-item span { font-size: 21px; line-height: 1; }
.nav-item small { font-size: 10px; font-weight: 750; }
.nav-item.active { color: var(--blue); background: var(--blue-soft); }
.fab { position: fixed; right: 18px; bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 40; width: 58px; height: 58px; border: 0; border-radius: 20px; background: var(--blue); color: white; font-size: 34px; line-height: 1; box-shadow: 0 14px 28px rgba(25,118,210,.35); }
.fab:hover { background: var(--blue-dark); }

.sheet { width: min(100% - 16px, 580px); border: 0; border-radius: 24px 24px 0 0; margin: auto auto 0; padding: 8px 16px calc(22px + env(safe-area-inset-bottom)); box-shadow: var(--shadow); color: var(--text); }
.sheet::backdrop { background: rgba(2,6,23,.46); backdrop-filter: blur(3px); }
.sheet-handle { width: 42px; height: 5px; border-radius: 99px; background: #d0d5dd; margin: 2px auto 12px; }
.sheet-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sheet-header h2 { margin: 0; font-size: 22px; }
.action-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 18px; }
.action-grid button { min-height: 96px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; padding: 14px; text-align: left; }
.action-grid button:hover { border-color: #b9c5d4; background: var(--surface-3); }
.action-grid button > span:last-child { font-size: 13px; font-weight: 850; }
.quick-icon { font-size: 27px; }
.search-sheet { min-height: min(78dvh, 720px); }
.search-box { display: flex; align-items: center; gap: 9px; margin-top: 15px; padding: 0 13px; height: 50px; background: var(--surface-2); border-radius: 14px; }
.search-box input { width: 100%; border: 0; outline: 0; background: transparent; font-size: 16px; }
.search-results { margin-top: 12px; }
.search-result { padding: 12px; display: flex; align-items: center; gap: 11px; border: 1px solid var(--line); background: var(--surface); }

.primary, .secondary, .ghost { min-height: 44px; border-radius: 12px; padding: 0 16px; font-weight: 850; }
.primary { border: 0; background: var(--blue); color: white; }
.primary:hover { background: var(--blue-dark); }
.secondary { border: 1px solid var(--line); background: white; color: var(--text); }
.secondary:hover { background: var(--surface-3); }
.ghost { border: 0; background: transparent; }
.compact { min-height: 38px; padding: 0 13px; font-size: 13px; }
.danger { border-color: #f3b8b3; color: var(--red); }
.danger-text { color: var(--red); }

.form { display: grid; gap: 18px; }
.form-section { padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.form-section:last-of-type { border-bottom: 0; padding-bottom: 0; }
.form-section-heading { display: flex; gap: 11px; align-items: flex-start; margin-bottom: 14px; }
.form-section-heading > span { flex: 0 0 28px; width: 28px; height: 28px; border-radius: 10px; display: grid; place-items: center; background: var(--navy); color: white; font-size: 12px; font-weight: 900; }
.form-section-heading h2 { margin: 1px 0 0; font-size: 16px; }
.form-section-heading p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.form-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.field { display: grid; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 12px; font-weight: 800; color: #475467; }
.field input, .field select, .field textarea, .inline-form input { width: 100%; min-height: 44px; border: 1px solid var(--line); background: white; color: var(--text); border-radius: 12px; padding: 11px 12px; outline: none; }
.field textarea { min-height: auto; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .inline-form input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.checkbox-field { align-content: end; min-height: 44px; }
.checkbox-field label, .check-inline { display: flex; align-items: center; gap: 8px; min-height: 44px; }
.checkbox-field input, .check-inline input { width: 18px; height: 18px; }
.fields-disabled { opacity: .45; }
.existing-property-field { margin-bottom: 12px; }
.client-picker { position: relative; }
.client-picker-control { position: relative; display: flex; align-items: center; }
.client-picker-icon { position: absolute; left: 13px; color: var(--muted); pointer-events: none; font-size: 18px; }
.field .client-picker-input { padding-left: 40px; padding-right: 42px; }
.client-picker-clear { position: absolute; right: 7px; width: 32px; height: 32px; border: 0; border-radius: 9px; background: var(--surface-2); color: var(--muted); font-size: 20px; line-height: 1; }
.client-picker-clear:hover, .client-picker-clear:focus-visible { background: var(--blue-soft); color: var(--blue-dark); }
.client-picker-hint { color: var(--muted); font-size: 11px; }
.client-picker-menu { position: absolute; top: 50px; left: 0; right: 0; z-index: 40; max-height: min(360px, 48vh); overflow-y: auto; padding: 6px; border: 1px solid var(--line); border-radius: 14px; background: white; box-shadow: 0 18px 45px rgba(15, 23, 42, .18); }
.client-picker-option { width: 100%; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 10px; border: 0; border-radius: 11px; background: transparent; text-align: left; color: var(--text); }
.client-picker-option:hover, .client-picker-option.active, .client-picker-option:focus-visible { background: var(--blue-soft); outline: none; }
.client-picker-option-copy { min-width: 0; display: grid; gap: 2px; }
.client-picker-option-copy strong, .client-picker-option-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.client-picker-option-copy small { color: var(--muted); font-size: 11px; }
.client-picker-empty { padding: 14px 12px; color: var(--muted); font-size: 12px; line-height: 1.45; }

.form-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 4px; }
.sticky-actions { position: sticky; bottom: calc(74px + env(safe-area-inset-bottom)); z-index: 10; margin: 0 -8px -8px; padding: 12px 8px; background: rgba(243,245,248,.93); backdrop-filter: blur(10px); border-top: 1px solid rgba(223,228,234,.8); }
.divider-label { padding-top: 4px; color: var(--muted); font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; }
.inline-form { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center; padding: 10px; }

.back-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.back-button { border: 0; background: transparent; color: var(--blue); font-weight: 850; padding: 8px 0; }
.detail-hero { display: flex; align-items: center; gap: 14px; padding: 16px; }
.detail-hero-main { display: flex; align-items: center; gap: 14px; flex: 1; min-width: 0; }
.detail-hero-copy { flex: 1; min-width: 0; }
.detail-hero h1 { margin: 0; font-size: clamp(23px, 5vw, 32px); letter-spacing: -.035em; overflow-wrap: anywhere; }
.detail-hero-copy > p:last-child { margin: 5px 0 0; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.detail-hero-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; max-width: 520px; }
.notice-card { display: flex; gap: 10px; align-items: center; margin-top: 12px; padding: 12px 14px; border: 1px solid #f3d48b; border-radius: 14px; background: var(--amber-soft); color: #6d4a00; font-size: 12px; }
.notice-card strong { white-space: nowrap; }
.property-card { padding: 14px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: flex-start; }
.property-card-copy { min-width: 0; }
.property-card h3 { margin: 0; font-size: 15px; }
.property-card p { margin: 4px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.property-card-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 6px; }
.property-card-actions .map-link { margin-top: 0; white-space: nowrap; }
.property-icon { flex: 0 0 40px; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: var(--surface-2); }
.inline-note { display: inline-block; margin-top: 8px; padding: 5px 8px; border-radius: 8px; background: var(--amber-soft); color: var(--amber); font-size: 11px; font-weight: 750; }
.notes-list { margin-top: 10px; }
.note-card { padding: 12px 14px; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.note-card p { margin: 0; font-size: 13px; line-height: 1.45; }
.note-card span { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; }
.note-card .ghost { min-height: 30px; padding: 0 6px; font-size: 18px; }

.job-hero { align-items: flex-start; }
.status-strip { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 1px; margin-top: 12px; overflow: hidden; background: var(--line); }
.status-strip > div { padding: 13px; background: var(--surface); }
.status-strip span { display: block; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; font-weight: 850; }
.status-strip strong { display: block; margin-top: 4px; font-size: 13px; }
.job-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.prose-card p { margin: 0; line-height: 1.6; font-size: 14px; }
dl { margin: 18px 0 0; }
dl > div { padding: 10px 0; border-top: 1px solid var(--line); }
dt { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .07em; font-weight: 850; }
dd { margin: 4px 0 0; font-size: 13px; }
.timeline { padding: 10px 14px; }
.timeline-step { position: relative; min-height: 39px; display: grid; grid-template-columns: 20px 1fr; gap: 9px; color: #a3abb8; }
.timeline-step::before { content: ''; position: absolute; left: 6px; top: 17px; bottom: -2px; width: 2px; background: var(--line); }
.timeline-step:last-child::before { display: none; }
.timeline-step > span { position: relative; z-index: 1; width: 14px; height: 14px; margin-top: 2px; border: 2px solid #cbd2dc; border-radius: 999px; background: white; }
.timeline-step strong { font-size: 12px; }
.timeline-step small { display: block; margin-top: 2px; color: var(--blue); font-size: 10px; }
.timeline-step.done { color: var(--green); }
.timeline-step.done > span { border-color: var(--green); background: var(--green); }
.timeline-step.current { color: var(--text); }
.timeline-step.current > span { border-color: var(--blue); box-shadow: 0 0 0 4px var(--blue-soft); }

@media (max-width: 619px) {
  .client-detail-hero { align-items: stretch; flex-direction: column; }
  .client-detail-hero .detail-hero-main { width: 100%; }
  .client-detail-hero .detail-hero-actions { width: 100%; max-width: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .client-detail-hero .detail-hero-actions > * { width: 100%; min-width: 0; padding-left: 9px; padding-right: 9px; }
  .client-detail-hero .detail-hero-actions > :last-child:nth-child(odd) { grid-column: 1 / -1; }
  .property-card { grid-template-columns: auto minmax(0, 1fr); }
  .property-card-actions { grid-column: 2; justify-content: flex-start; }
}

.inspection-row { padding: 14px; }
.inspection-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.inspection-title h3 { margin: 0; font-size: 15px; }
.inspection-title span { color: var(--muted); font-size: 10px; }
.segmented-control { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 12px; }
.segment input { position: absolute; opacity: 0; pointer-events: none; }
.segment span { min-height: 38px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); font-size: 12px; font-weight: 850; }
.segment input:checked + span { border-color: var(--blue); background: var(--blue-soft); color: var(--blue-dark); }
.segment.recommend input:checked + span { border-color: #e5bd56; background: var(--amber-soft); color: var(--amber); }
.segment.unsafe input:checked + span { border-color: #ef9b93; background: var(--red-soft); color: var(--red); }

.settings-stack { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
.settings-stack strong { font-size: 14px; }
.settings-stack p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.toast { position: fixed; left: 50%; bottom: calc(92px + env(safe-area-inset-bottom)); z-index: 100; max-width: calc(100% - 32px); transform: translate(-50%, 18px); opacity: 0; pointer-events: none; padding: 11px 14px; border-radius: 12px; background: var(--navy); color: white; box-shadow: var(--shadow); font-size: 13px; transition: .2s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (min-width: 620px) {
  .form-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .row-status { display: block; }
  .status-strip { grid-template-columns: repeat(4, minmax(0,1fr)); }
}

@media (min-width: 760px) {
  .content { padding: 28px 26px 54px; }
  .stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .dashboard-columns, .detail-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; align-items: start; }
  .bottom-nav { left: 16px; right: auto; top: calc(82px + env(safe-area-inset-top)); bottom: 16px; width: 86px; height: auto; padding: 10px 8px; border: 1px solid var(--line); border-radius: 22px; grid-template-columns: 1fr; grid-template-rows: repeat(5, 72px); box-shadow: var(--shadow); }
  .app-shell { padding-bottom: 0; padding-left: 102px; }
  .fab { bottom: 28px; right: 30px; }
  .sheet { margin: auto; border-radius: 24px; }
  .sticky-actions { bottom: 0; }
  .toast { bottom: 30px; }
}

@media (min-width: 1040px) {
  .content { padding-left: 36px; padding-right: 36px; }
}

/* Checkpoint 2: secure access, cloud sync, door measurements, and photos */
.hidden { display: none !important; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.sync-chip { min-height: 34px; border: 1px solid var(--line); border-radius: 999px; padding: 0 10px; background: var(--surface); color: var(--muted); font-size: 11px; font-weight: 850; }
.sync-chip[data-state="synced"], .sync-chip[data-state="ready"] { border-color: #b7dfc9; background: var(--green-soft); color: var(--green); }
.sync-chip[data-state="syncing"], .sync-chip[data-state="pending"], .sync-chip[data-state="loading"] { border-color: #efd68c; background: var(--amber-soft); color: var(--amber); }
.sync-chip[data-state="error"] { border-color: #efb3ad; background: var(--red-soft); color: var(--red); }

.auth-gate { min-height: 100dvh; display: grid; place-items: center; padding: 24px; background: linear-gradient(155deg, #f8fbff 0%, #edf4fc 46%, #e7edf5 100%); }
.auth-card { width: min(100%, 430px); padding: 28px; border: 1px solid rgba(199,208,220,.9); border-radius: 24px; background: rgba(255,255,255,.95); box-shadow: 0 24px 65px rgba(15,23,42,.14); }
.auth-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 28px; }
.auth-mark { width: 48px; height: 48px; object-fit: contain; flex: 0 0 auto; }
.auth-lockup { display: flex; align-items: center; min-width: 0; }
.auth-wordmark { width: 132px; height: auto; display: block; }
.auth-lockup > span { margin-left: 12px; padding-left: 12px; border-left: 1px solid var(--line); color: var(--muted); font-size: 12px; font-weight: 900; letter-spacing: .12em; white-space: nowrap; }
.auth-card h1 { margin: 0; font-size: 31px; letter-spacing: -.04em; }
.auth-subtitle { margin: 7px 0 0; color: var(--muted); }
.auth-form { display: grid; gap: 12px; margin-top: 22px; }
.auth-message { min-height: 18px; margin: 0; color: var(--red); font-size: 12px; line-height: 1.45; }
.auth-form button:disabled { opacity: .6; cursor: wait; }

.global-measure-field { padding: 10px 12px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-3); }
.global-measure-field label { min-height: 28px; }
.global-measure-field small { display: block; margin-left: 26px; color: var(--muted); font-size: 11px; }
.door-measurements-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.door-measurements-heading span { color: var(--muted); font-size: 11px; font-weight: 800; }
.door-measurements { display: grid; gap: 10px; }
.door-measurement-card { padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-3); }
.door-measurement-card.disabled { opacity: .7; }
.door-card-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.door-card-title strong { font-size: 13px; }
.door-card-title span { color: var(--muted); font-size: 10px; }
.door-card-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }

.photo-upload-card { padding: 12px; }
.media-upload-actions { display: grid; gap: 10px; padding: 12px; }
.photo-upload-button { min-height: 72px; display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px dashed #aebacc; border-radius: 14px; background: var(--surface-3); cursor: pointer; }
.photo-upload-button input { position: absolute; opacity: 0; pointer-events: none; }
.photo-upload-icon { flex: 0 0 42px; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; background: var(--blue-soft); color: var(--blue); font-size: 24px; }
.photo-upload-button strong { display: block; font-size: 13px; }
.photo-upload-button small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.photo-local-note { margin: 10px 2px 0; color: var(--muted); font-size: 11px; }
.photo-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.photo-card { overflow: hidden; }
.photo-preview { aspect-ratio: 4 / 3; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); font-size: 11px; }
.photo-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; }
.photo-meta > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 10px; }
.section-title > span { color: var(--muted); font-size: 11px; }

@media (min-width: 620px) {
  .door-measurements { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .photo-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .scheduled-job-card { grid-template-columns: 1fr; }
  .scheduled-job-calendar { min-height: 44px; grid-auto-flow: column; justify-content: center; border-left: 0; border-top: 1px solid var(--line); }
  .scheduled-job-calendar > span { font-size: 18px; }
}
