:root {
  color-scheme: light;
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-muted: #f7f9fb;
  --ink: #151a21;
  --muted: #657080;
  --line: #d9e0e8;
  --primary: #1769e0;
  --primary-strong: #0f4fae;
  --teal: #0f9f7a;
  --amber: #b56b08;
  --danger: #c7313c;
  --shadow: 0 18px 42px rgba(20, 30, 40, 0.12);
  --radius: 8px;
  --tap: 48px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  max-width: 100%;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

body {
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(246, 248, 251, 0.98)),
    var(--bg);
  color: var(--ink);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: var(--primary);
}

.hidden {
  display: none !important;
}

.visit-shell {
  width: min(100%, 960px);
  max-width: 100%;
  min-height: 100vh;
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 16px max(92px, env(safe-area-inset-bottom));
}

.visit-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 18px;
  text-align: center;
}

.visit-header > div {
  width: 100%;
}

.visit-header h1,
.auth-panel h2,
.property-band h2,
.capture-launcher h2 {
  margin: 0;
  line-height: 1.08;
  letter-spacing: 0;
}

.visit-header h1 {
  font-size: clamp(1.55rem, 5.5vw, 2.8rem);
  font-weight: 800;
}

#page-title {
  position: relative;
  display: inline-block;
  max-width: 100%;
  font-weight: 800;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

#page-title .word {
  display: inline-block;
  opacity: 1;
  transform: none;
}

#page-title .word.done::after {
  content: "";
  display: block;
  height: 3px;
  margin-top: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, #1a73e8, #10b981);
}

#page-title.ready .word,
#page-title.animated .word {
  opacity: 1;
  transform: none;
}

.eyebrow {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.visit-main {
  display: grid;
  gap: 14px;
}

.auth-panel,
.property-band,
.capture-launcher,
.tip-box,
.sync-status,
.upload-guard {
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(217, 224, 232, 0.86);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.auth-panel {
  max-width: 440px;
  margin: 12vh auto 0;
  padding: 22px;
  display: grid;
  gap: 10px;
}

.auth-panel label {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.auth-panel input,
.bottom-sheet input,
.bottom-sheet select,
.bottom-sheet textarea {
  width: 100%;
  min-height: var(--tap);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  padding: 0 12px;
}

.bottom-sheet textarea {
  min-height: 96px;
  padding-top: 10px;
  padding-bottom: 10px;
  resize: vertical;
}

.field-stack {
  display: grid;
  gap: 7px;
}

.field-stack.compact {
  gap: 6px;
}

.field-stack input {
  width: 100%;
  min-height: var(--tap);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  padding: 0 12px;
}

.address-field {
  position: relative;
}

.address-ac {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 6;
  max-height: min(260px, 42vh);
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 16px 34px rgba(28, 40, 54, 0.18);
}

.address-ac-item {
  width: 100%;
  min-height: 46px;
  display: block;
  border: 0;
  border-bottom: 1px solid rgba(217, 224, 232, 0.72);
  padding: 10px 12px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.address-ac-item:last-child {
  border-bottom: 0;
}

.address-ac-item[aria-selected="true"],
.address-ac-item:hover {
  background: var(--surface-muted);
}

#login-error {
  min-height: 1.2em;
  color: var(--danger);
  font-weight: 700;
}

.auth-panel .support-btn {
  width: 100%;
}

#app-container {
  display: grid;
  gap: 14px;
  min-width: 0;
  max-width: 100%;
}

.property-band {
  min-width: 0;
  max-width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 16px;
}

.unit-bar {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: -6px;
  padding: 10px 12px;
  border: 1px solid rgba(23, 105, 224, 0.22);
  border-radius: var(--radius);
  background: #f4f8ff;
  box-shadow: 0 10px 24px rgba(20, 30, 40, 0.08);
}

.unit-bar p {
  min-width: 0;
  margin: 0;
  color: #33506b;
  font-size: 0.94rem;
  line-height: 1.35;
}

.unit-bar strong {
  color: var(--ink);
  overflow-wrap: anywhere;
}

.unit-bar .btn {
  min-height: 44px;
  flex: 0 0 auto;
  padding: 0 14px;
}

.property-summary h2 {
  font-size: clamp(1.35rem, 5vw, 2rem);
}

.property-summary p {
  margin: 7px 0 0;
  color: var(--muted);
}

#empty-property-label {
  color: var(--muted);
}

#welcome-text:not(:empty) + #empty-property-label {
  display: none;
}

.gps-status {
  margin-top: 10px;
  color: #425466;
  font-size: 0.92rem;
}

.gps-status[data-state="error"] {
  color: var(--danger);
  font-weight: 800;
}

.gps-status[data-state="ok"] {
  color: #0b6b55;
  font-weight: 800;
}

.permission-hint {
  margin: 8px 0 0;
  color: #33506b;
  font-size: 0.86rem;
  line-height: 1.35;
}

.permission-hint strong,
.capture-flow-actions p strong {
  color: var(--ink);
}

.property-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.btn {
  min-height: var(--tap);
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 800;
  text-decoration: none;
  transition: transform 120ms ease, border-color 160ms ease, background-color 160ms ease, color 160ms ease, opacity 160ms ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled,
.btn[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.62;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 10px 24px rgba(23, 105, 224, 0.24);
}

.btn-primary:hover {
  background: var(--primary-strong);
}

.btn-secondary {
  background: #0c7667;
  color: #fff;
  box-shadow: 0 10px 22px rgba(12, 118, 103, 0.2);
}

.btn-secondary:hover {
  background: #095f54;
}

.btn-ghost {
  background: #fff;
  color: #2e3946;
  border-color: var(--line);
}

.btn-ghost:hover {
  border-color: #aab6c3;
}

.support-btn {
  color: #1769e0;
  border-color: rgba(23, 105, 224, 0.22);
}

.support-btn:hover {
  background: #f5f9ff;
  border-color: rgba(23, 105, 224, 0.42);
}

.accent-pulse {
  position: relative;
}

.accent-pulse::after {
  content: "";
  position: absolute;
  inset: -7px;
  border: 2px solid rgba(23, 105, 224, 0.45);
  border-radius: calc(var(--radius) + 8px);
  pointer-events: none;
  animation: ctaPulse 1.15s ease-out infinite;
}

.capture-launcher {
  min-width: 0;
  max-width: 100%;
  padding: 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
}

.capture-launcher p,
.tip-box p {
  margin: 8px 0 0;
  color: var(--muted);
}

.tip-box ol {
  margin: 10px 0 0;
  padding-left: 1.25rem;
  color: var(--muted);
}

.tip-box li + li {
  margin-top: 6px;
}

.capture-launcher h2 {
  font-size: 1.35rem;
}

.tip-box {
  position: relative;
  padding: 16px;
}

.unit-hint {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-color: rgba(15, 159, 122, 0.3);
  background: #f1fbf7;
}

.unit-hint p {
  margin: 0;
  color: #33506b;
  line-height: 1.45;
}

.unit-hint .btn {
  flex: 0 0 auto;
}

body.camera-open #camera-tooltip {
  position: fixed;
  left: 12px;
  right: 12px;
  top: max(76px, env(safe-area-inset-top));
  z-index: 120;
  max-width: 520px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
}

.tip-box .close-btn,
.bottom-sheet .close-btn {
  min-height: 36px;
  border: 0;
  border-radius: var(--radius);
  padding: 0 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
}

.tip-box .close-btn {
  position: absolute;
  top: 8px;
  right: 8px;
}

.check-row {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-weight: 700;
}

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(10, 16, 24, 0.38);
}

.bottom-sheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 80;
  width: min(100%, 560px);
  max-width: 100vw;
  max-height: min(84vh, 680px);
  padding: 10px 16px max(18px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px 8px 0 0;
  box-shadow: 0 -22px 52px rgba(10, 16, 24, 0.22);
}

.sheet-handle {
  width: 44px;
  height: 5px;
  margin: 2px auto 14px;
  border-radius: 999px;
  background: #cbd5df;
}

.sheet-title {
  margin: 0;
  color: var(--ink);
  font-size: 1.2rem;
  font-weight: 800;
}

.sheet-copy {
  margin: 7px 0 14px;
  color: var(--muted);
}

.detected-address-card {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid #cbdcf4;
  border-radius: var(--radius);
  background: #f4f8ff;
}

.detected-address-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.detected-address-state {
  flex: 0 0 auto;
  color: #3d5b85;
  font-size: 0.78rem;
  font-weight: 800;
}

.nearby-property-card {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid rgba(15, 159, 122, 0.32);
  border-radius: var(--radius);
  background: #f1fbf7;
}

.nearby-property-card strong {
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.25;
}

.nearby-property-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.35;
}

.nearby-property-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.nearby-property-actions .btn {
  width: 100%;
  min-width: 0;
  padding: 0 10px;
}

.add-mode-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  margin: 0 0 12px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-muted);
}

.add-mode-tab {
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  padding: 0 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 800;
  line-height: 1.1;
}

.add-mode-tab.is-active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 6px 14px rgba(20, 30, 40, 0.09);
}

.add-mode-tab:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.add-mode-panel {
  display: grid;
  gap: 10px;
}

.mode-copy {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.35;
}

.bottom-sheet label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.sheet-actions {
  margin-top: 12px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.empty-state {
  margin-top: 12px;
  padding: 12px;
  border: 1px dashed #bec8d3;
  border-radius: var(--radius);
  color: var(--muted);
  background: var(--surface-muted);
}

.unit-picker-sheet {
  display: grid;
  gap: 12px;
}

body.unit-picker-open .sheet-backdrop {
  z-index: 140;
}

body.unit-picker-open .unit-picker-sheet {
  z-index: 150;
}

.unit-search-field {
  margin-top: 2px;
}

.unit-list-scroll {
  max-height: min(46vh, 390px);
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-muted);
}

.unit-option-list {
  display: grid;
}

.unit-option-row {
  width: 100%;
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 0;
  border-bottom: 1px solid rgba(217, 224, 232, 0.82);
  padding: 10px 12px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.unit-option-row:hover,
.unit-option-row:focus-visible {
  background: #f4f8ff;
}

.unit-option-row[aria-pressed="true"],
.unit-option-row[aria-current="true"],
.unit-option-row.is-current {
  background: #eaf3ff;
  color: #0f4fae;
  box-shadow: inset 4px 0 0 var(--primary);
}

.unit-option-row-pinned {
  position: sticky;
  top: 0;
  z-index: 2;
  font-weight: 800;
  box-shadow: 0 5px 14px rgba(20, 30, 40, 0.08);
}

.unit-option-row-pinned[aria-pressed="true"],
.unit-option-row-pinned[aria-current="true"],
.unit-option-row-pinned.is-current {
  box-shadow: inset 4px 0 0 var(--primary), 0 5px 14px rgba(20, 30, 40, 0.08);
}

.unit-option-name {
  min-width: 0;
  font-weight: 800;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.unit-option-check {
  display: none;
  flex: 0 0 auto;
  color: #0b6b55;
  font-size: 0.78rem;
  font-weight: 900;
}

.unit-option-row[aria-pressed="true"] .unit-option-check,
.unit-option-row[aria-current="true"] .unit-option-check,
.unit-option-row.is-current .unit-option-check {
  display: inline;
}

.unit-section {
  padding-top: 8px;
}

.unit-section-title {
  margin: 0;
  padding: 7px 12px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.unit-list-sentinel {
  width: 100%;
  height: 1px;
}

.unit-empty-state {
  margin: 8px;
}

.unit-row-with-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid rgba(217, 224, 232, 0.82);
  padding: 8px;
  background: #fff;
}

.unit-row-with-actions .unit-option-row {
  border-bottom: 0;
}

.unit-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.unit-row-actions .btn {
  min-height: 44px;
  padding: 0 12px;
}

.unit-row-actions .unit-delete-button {
  color: var(--danger);
  border-color: rgba(199, 49, 60, 0.3);
}

.unit-inline-editor {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  padding: 4px 0;
}

.unit-inline-editor .btn {
  min-height: var(--tap);
  padding: 0 12px;
}

.unit-manager-controls {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(15, 159, 122, 0.3);
  border-radius: var(--radius);
  background: #f1fbf7;
}

.unit-manager-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.unit-manager-header strong {
  color: var(--ink);
}

.unit-manager-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.35;
}

.unit-manager-header .btn {
  flex: 0 0 auto;
}

.unit-add-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.unit-add-row .btn {
  min-height: var(--tap);
}

.unit-picker-status {
  min-height: 1.25em;
  color: #0b6b55;
  font-weight: 800;
}

.unit-picker-status[data-state="error"] {
  color: var(--danger);
}

.camera-shell {
  position: fixed;
  inset: 0;
  z-index: 60;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 0;
  padding: max(12px, env(safe-area-inset-top)) 10px max(12px, env(safe-area-inset-bottom));
  background: #f7f9fb;
  color: var(--ink);
}

.camera-topbar {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 2px 10px;
}

.camera-topbar .eyebrow {
  margin-bottom: 2px;
  color: var(--muted);
}

.camera-topbar p {
  margin: 0;
  max-width: 70vw;
  overflow: hidden;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.camera-location-copy {
  min-width: 0;
  flex: 1 1 auto;
}

.camera-topbar-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.camera-change-unit-button {
  min-height: var(--tap);
  padding: 0 12px;
}

.btn-camera {
  min-height: 42px;
  color: var(--ink);
  border-color: rgba(175, 187, 200, 0.8);
  background: rgba(255, 255, 255, 0.84);
  backdrop-filter: blur(12px);
}

.camera-frame {
  position: relative;
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(185, 197, 211, 0.82);
  border-radius: var(--radius);
  background: #000;
  box-shadow: 0 16px 36px rgba(28, 40, 54, 0.14);
}

#camera-preview {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  background: #000;
}

#camera-preview.snapshot-feedback {
  outline: 999px solid rgba(255, 255, 255, 0.38);
  outline-offset: -999px;
}

.snap-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  touch-action: none;
}

.camera-control-stack {
  position: absolute;
  right: 12px;
  top: 12px;
  z-index: 8;
  display: grid;
  gap: 8px;
}

.cam-icon-btn {
  min-width: 58px;
  min-height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: var(--radius);
  padding: 0 10px;
  background: rgba(6, 9, 13, 0.54);
  color: #fff;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 900;
  backdrop-filter: blur(12px);
}

.cam-icon-btn[aria-pressed="true"] {
  border-color: rgba(255, 210, 110, 0.8);
  background: rgba(181, 107, 8, 0.68);
}

.zoom-popover {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 106px;
  z-index: 8;
  min-height: 56px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius);
  background: rgba(6, 9, 13, 0.72);
  color: #fff;
  backdrop-filter: blur(14px);
}

.zoom-popover label,
.zoom-popover output {
  font-size: 0.86rem;
  font-weight: 900;
}

.zoom-popover input,
.inline-control input {
  accent-color: var(--teal);
}

.shutter-button {
  position: absolute;
  left: 50%;
  bottom: 22px;
  z-index: 9;
  width: 76px;
  height: 76px;
  border: 3px solid rgba(255, 255, 255, 0.9);
  border-radius: 999px;
  padding: 6px;
  background: rgba(255, 255, 255, 0.18);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.36);
  cursor: pointer;
  transform: translateX(-50%);
}

.shutter-button span {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 999px;
  background: #fff;
}

.shutter-button.is-pressing span {
  background: #f35b66;
  transform: scale(0.9);
}

.camera-review-strip {
  min-height: 154px;
  padding-top: 10px;
}

.review-strip-header {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
}

#thumbs-container {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 66px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}

#thumbs-container::-webkit-scrollbar {
  display: none;
}

.thumb {
  position: relative;
  width: 64px;
  height: 64px;
  flex: 0 0 64px;
  overflow: hidden;
  border: 1px solid rgba(185, 197, 211, 0.85);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.08);
  transition: opacity 220ms ease, transform 220ms ease;
}

.capture-flow-actions {
  margin-top: 10px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.capture-action-buttons {
  min-width: 156px;
  display: grid;
  gap: 8px;
}

.capture-action-buttons .btn {
  width: 100%;
  min-width: 0;
  padding: 0 12px;
}

.capture-flow-actions p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.thumb.fade {
  opacity: 0;
  transform: scale(0.96);
}

.thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.thumb .badge-mic {
  position: absolute;
  right: 4px;
  bottom: 4px;
  min-width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--teal);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 900;
}

.thumb .badge-assign {
  position: absolute;
  left: 4px;
  top: 4px;
  min-width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--teal);
  color: #fff;
  font-size: 0.76rem;
  font-weight: 900;
  line-height: 1;
}

.thumb .badge-assign[data-urgent="true"] {
  background: var(--danger);
}

.camera-controls {
  display: none;
}

.bottom-actions {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 50;
  width: min(100%, 960px);
  max-width: 100vw;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 10px 16px max(10px, env(safe-area-inset-bottom));
  background: rgba(246, 248, 250, 0.86);
  border-top: 1px solid rgba(217, 224, 232, 0.82);
  backdrop-filter: blur(18px);
  transform: translateX(-50%);
}

.bottom-actions .btn {
  width: 100%;
  min-width: 0;
  padding: 0 10px;
}

.record-note-btn.recording {
  background: var(--danger);
  color: #fff;
}

.record-note-btn--disabled {
  background: #8793a1 !important;
  box-shadow: none !important;
}

.assign-sheet {
  display: grid;
  gap: 12px;
}

.assign-preview {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(217, 224, 232, 0.9);
  border-radius: var(--radius);
  background: var(--surface-muted);
}

.assign-preview img {
  width: 86px;
  height: 86px;
  display: block;
  object-fit: cover;
  border-radius: var(--radius);
  background: #dce3eb;
}

.assign-preview p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.assign-preview .assign-latest-location {
  margin-bottom: 4px;
  color: var(--ink);
  font-size: 0.94rem;
  font-weight: 900;
}

.urgent-row {
  align-items: flex-start;
  line-height: 1.35;
}

.urgent-row input {
  flex: 0 0 auto;
  margin-top: 3px;
}

.assign-status {
  min-height: 1.25em;
  color: var(--primary);
  font-weight: 800;
}

.assign-status[data-state="error"] {
  color: var(--danger);
}

#status-message {
  min-height: 1.3em;
  color: var(--primary);
  font-weight: 800;
}

#status-message[data-state="error"] {
  color: var(--danger);
}

.sync-status {
  padding: 12px;
  color: #194a7a;
  background: #eff6ff;
}

.upload-guard {
  padding: 12px;
  color: #704400;
  background: #fff7df;
  border-color: #e8c16e;
  font-weight: 800;
}

body.camera-open #upload-guard {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: max(12px, env(safe-area-inset-bottom));
  z-index: 130;
  max-width: 560px;
  margin: 0 auto;
}

.sync-status.warn {
  color: #704400;
  background: #fff7df;
  border-color: #e8c16e;
}

.user-footer {
  display: none;
  margin-top: 18px;
  color: var(--muted);
  font-size: 0.86rem;
  text-align: center;
}

body.authed .user-footer {
  display: block;
}

#logout-link,
.footer-help-link {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--primary);
  cursor: pointer;
  font-weight: 800;
  text-decoration: underline;
}

.footer-help-link {
  margin-left: 10px;
}

.help-options {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: grid;
  place-items: center;
  padding: max(18px, env(safe-area-inset-top)) 16px max(18px, env(safe-area-inset-bottom));
  background: rgba(22, 32, 44, 0.34);
}

.walk-app-prompt {
  position: fixed;
  inset: 0;
  z-index: 165;
  display: grid;
  place-items: center;
  padding: max(18px, env(safe-area-inset-top)) 16px max(18px, env(safe-area-inset-bottom));
  background: rgba(18, 28, 40, 0.38);
}

.walk-app-prompt-panel {
  position: relative;
  width: min(100%, 470px);
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 24px 60px rgba(28, 40, 54, 0.24);
}

.walk-app-prompt-panel .close-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  min-height: 36px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
}

.walk-app-prompt-panel h2 {
  margin: 6px 44px 0 0;
  font-size: 1.32rem;
  line-height: 1.16;
}

.walk-app-prompt-panel p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.walk-app-prompt-actions {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.walk-app-prompt-actions .btn {
  width: 100%;
}

.walk-app-prompt-actions[data-platform="ios"] #walk-app-ios-link {
  order: 1;
}

.walk-app-prompt-actions[data-platform="ios"] #walk-app-android-link {
  order: 2;
}

.walk-app-prompt-actions[data-platform="ios"] #walk-app-continue {
  order: 3;
}

.walk-app-prompt-actions[data-platform="android"] #walk-app-android-link {
  order: 1;
}

.walk-app-prompt-actions[data-platform="android"] #walk-app-ios-link {
  order: 2;
}

.walk-app-prompt-actions[data-platform="android"] #walk-app-continue {
  order: 3;
}

.walk-app-prompt-note {
  font-size: 0.86rem;
}

.help-options-panel {
  position: relative;
  width: min(100%, 430px);
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 24px 60px rgba(28, 40, 54, 0.22);
}

.help-options-panel .close-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  min-height: 36px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
}

.help-options-panel h2 {
  margin: 6px 44px 0 0;
  font-size: 1.28rem;
}

.help-options-panel p {
  margin: 10px 0 0;
  color: var(--muted);
}

.help-options-actions {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.help-options-actions .btn {
  width: 100%;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: max(86px, env(safe-area-inset-bottom));
  z-index: 120;
  max-width: min(92vw, 420px);
  padding: 11px 14px;
  border-radius: var(--radius);
  background: #111827;
  color: #fff;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.25);
  font-weight: 800;
  transform: translateX(-50%) translateY(10px);
  opacity: 0;
  transition: transform 160ms ease, opacity 160ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.tour {
  position: fixed;
  inset: 0;
  z-index: 140;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(22, 32, 44, 0.32);
}

.tour-panel {
  width: min(100%, 520px);
  position: relative;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 24px 60px rgba(28, 40, 54, 0.22);
}

.tour-panel .close-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  min-height: 36px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
}

.tour-step h2 {
  margin: 0;
  font-size: 1.35rem;
}

.tour-step p {
  margin: 10px 0 0;
  color: var(--muted);
}

.tour-actions {
  margin-top: 16px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

#voice-overlay {
  position: fixed;
  inset: 0;
  z-index: 130;
  display: none;
  grid-template-rows: auto minmax(0, 1fr) auto;
  align-items: center;
  justify-items: center;
  gap: 10px;
  padding: max(18px, env(safe-area-inset-top)) 16px max(18px, env(safe-area-inset-bottom));
  background: rgba(4, 7, 12, 0.9);
  color: #fff;
  cursor: pointer;
}

#voice-overlay.show {
  display: grid;
}

.voice-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(199, 49, 60, 0.74);
  font-weight: 900;
}

.rec-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #fff;
  animation: recPulse 1.2s ease-in-out infinite;
}

#voice-photo {
  max-width: min(94vw, 760px);
  max-height: 70vh;
  border-radius: var(--radius);
  object-fit: contain;
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.48);
}

.voice-sub {
  color: rgba(255, 255, 255, 0.78);
  font-weight: 800;
}

body.camera-open {
  overflow: hidden;
}

body.camera-open .bottom-actions {
  display: none;
}

body.camera-open .visit-header,
body.camera-open .property-band,
body.camera-open .capture-launcher,
body.camera-open #status-message,
body.camera-open #sync-status,
body.camera-open .user-footer {
  visibility: hidden;
}

@keyframes recPulse {
  0%,
  100% {
    opacity: 0.45;
    transform: scale(0.9);
  }
  50% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes ctaPulse {
  0% {
    opacity: 0.95;
    transform: scale(0.98);
  }
  100% {
    opacity: 0;
    transform: scale(1.1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .accent-pulse::after {
    animation: none;
  }
}

@media (max-width: 700px) {
  .visit-shell {
    padding-left: 12px;
    padding-right: 12px;
  }

  .bottom-sheet {
    max-height: min(88vh, 720px);
    padding-left: 14px;
    padding-right: 14px;
  }

  #add-property-sheet .sheet-copy {
    margin-bottom: 12px;
  }

  .add-mode-tab {
    min-height: 44px;
    padding: 0 6px;
    font-size: 0.82rem;
  }

  #add-property-sheet .sheet-actions {
    position: sticky;
    bottom: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.28fr);
    padding-top: 10px;
    padding-bottom: max(18px, env(safe-area-inset-bottom));
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.72), #fff 28%);
  }

  #add-property-sheet .sheet-actions .btn {
    width: 100%;
    min-width: 0;
    padding-left: 10px;
    padding-right: 10px;
  }

  .visit-header {
    align-items: flex-start;
  }

  .property-band,
  .capture-launcher {
    grid-template-columns: 1fr;
  }

  .property-actions {
    justify-content: stretch;
  }

  .property-actions .btn,
  .capture-launcher .btn {
    flex: 1 1 0;
  }

  .unit-bar {
    align-items: stretch;
    margin-top: -4px;
  }

  .unit-bar .btn {
    min-width: 112px;
  }

  .unit-hint {
    display: grid;
    grid-template-columns: 1fr;
  }

  .unit-hint .btn {
    width: 100%;
  }

  .unit-list-scroll {
    max-height: min(43vh, 360px);
  }

  .unit-manager-header {
    align-items: stretch;
    flex-direction: column;
  }

  .unit-manager-header .btn {
    width: 100%;
  }

  .unit-add-row,
  .unit-inline-editor {
    grid-template-columns: 1fr;
  }

  .unit-add-row .btn,
  .unit-inline-editor .btn {
    width: 100%;
  }

  .unit-row-with-actions {
    grid-template-columns: 1fr;
  }

  .unit-row-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .unit-row-actions .btn {
    width: 100%;
  }

  .camera-topbar-actions {
    gap: 6px;
  }

  .camera-topbar-actions .btn {
    padding-left: 10px;
    padding-right: 10px;
    font-size: 0.84rem;
  }

  .camera-shell {
    padding-left: 0;
    padding-right: 0;
  }

  .camera-frame {
    border-left: 0;
    border-right: 0;
    border-radius: 0;
  }

  .camera-topbar,
  .camera-review-strip {
    padding-left: 10px;
    padding-right: 10px;
  }

  .bottom-actions {
    padding-left: 10px;
    padding-right: 10px;
  }

  .bottom-actions .btn {
    padding-left: 6px;
    padding-right: 6px;
    font-size: 0.9rem;
    line-height: 1.05;
  }

  .capture-flow-actions {
    grid-template-columns: 1fr;
  }

  .capture-action-buttons {
    min-width: 0;
  }
}

@media (min-width: 900px) {
  .camera-shell {
    padding-left: max(18px, calc((100vw - 900px) / 2));
    padding-right: max(18px, calc((100vw - 900px) / 2));
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}
