/* Era Management Inspection App - Modern Design */

:root {
  /* Brand */
  --primary: #0f172a;
  --primary-soft: #1e293b;
  --accent: #d4a857;
  --accent-soft: #f5ecd3;

  /* Neutrals */
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #fbfbfd;
  --text: #0b1220;
  --text-2: #475569;
  --text-3: #94a3b8;
  --border: #e6e8ef;
  --border-soft: #f1f3f7;

  /* Semantic */
  --ok: #10b981;
  --ok-bg: #ecfdf5;
  --issue: #ef4444;
  --issue-bg: #fef2f2;
  --minor: #f59e0b;
  --major: #ef4444;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(15,23,42,0.06);
  --shadow-md: 0 6px 16px rgba(15,23,42,0.08);
  --shadow-lg: 0 18px 40px rgba(15,23,42,0.18);

  /* Radii */
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;

  /* Spacing safe-area */
  --safe-top: env(safe-area-inset-top, 0);
  --safe-bottom: env(safe-area-inset-bottom, 0);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
*:focus { outline: none; }

html, body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overscroll-behavior-y: contain;
  letter-spacing: -0.005em;
}

#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  position: relative;
  padding-bottom: var(--safe-bottom);
}

/* SCREENS */
.screen {
  display: none;
  min-height: 100vh;
  flex-direction: column;
  animation: fadeIn 0.25s ease;
}
.screen.active { display: flex; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================ */
/* HERO (Home top section)      */
/* ============================ */
.hero {
  background: linear-gradient(160deg, #0f172a 0%, #1e293b 60%, #334155 100%);
  color: white;
  padding: calc(20px + var(--safe-top)) 22px 28px;
  border-radius: 0 0 var(--r-xl) var(--r-xl);
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: '';
  position: absolute;
  right: -60px;
  top: -60px;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(212,168,87,0.18), transparent 70%);
  border-radius: 50%;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  position: relative;
  z-index: 1;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), #b8923f);
  color: var(--primary);
  font-weight: 800;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(212,168,87,0.4);
}

.brand-name {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.01em;
}

.brand-tag {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  opacity: 0.6;
  font-weight: 500;
}

.hero-title {
  margin: 0 0 6px;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.1;
  position: relative;
  z-index: 1;
}

.hero-sub {
  margin: 0 0 22px;
  font-size: 15px;
  opacity: 0.7;
  position: relative;
  z-index: 1;
}

.cta-card {
  width: 100%;
  background: rgba(255, 255, 255, 0.09);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--r-lg);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  color: white;
  cursor: pointer;
  transition: transform 0.15s, background 0.2s;
  position: relative;
  z-index: 1;
}

.cta-card:active {
  transform: scale(0.985);
  background: rgba(255,255,255,0.13);
}

.cta-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: var(--accent);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
}
.cta-icon svg { width: 22px; height: 22px; }

.cta-text { flex: 1; text-align: left; }
.cta-title { font-weight: 700; font-size: 16px; }
.cta-sub { font-size: 13px; opacity: 0.7; margin-top: 1px; }

.cta-arrow {
  color: rgba(255,255,255,0.6);
}
.cta-arrow svg { width: 20px; height: 20px; }

/* ============================ */
/* TOP BAR                      */
/* ============================ */
.top-bar {
  display: flex;
  align-items: center;
  padding: calc(12px + var(--safe-top)) 14px 12px;
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(16px);
  background: rgba(246,247,251,0.85);
}

.top-title {
  flex: 1;
  text-align: center;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.01em;
}
.top-spacer { width: 40px; }

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: none;
  background: var(--surface);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.1s;
}
.icon-btn:active { transform: scale(0.92); }
.icon-btn.ghost { background: transparent; box-shadow: none; color: var(--text-2); }
.icon-btn svg { width: 22px; height: 22px; }

/* ============================ */
/* CONTENT                       */
/* ============================ */
.content {
  padding: 18px 20px 120px;
  flex: 1;
}

.section-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 18px 0 12px;
}

.section-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-3);
  margin: 0;
}

.subsection-title {
  font-size: 16px;
  font-weight: 700;
  margin: 22px 0 4px;
  letter-spacing: -0.01em;
}

.hint {
  font-size: 13px;
  color: var(--text-2);
  margin: 0 0 14px;
}

.screen-title {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.025em;
  margin: 4px 0 22px;
  line-height: 1.15;
}

.step-indicator {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 4px;
}

/* ============================ */
/* HISTORY LIST                  */
/* ============================ */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.history-card {
  background: var(--surface);
  border-radius: var(--r-md);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.2s;
}
.history-card:active {
  transform: scale(0.99);
  box-shadow: var(--shadow-md);
}

.history-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.history-icon svg { width: 20px; height: 20px; }
.history-icon.clean { background: var(--ok-bg); color: var(--ok); }
.history-icon.issues { background: var(--issue-bg); color: var(--issue); }

.history-info { flex: 1; min-width: 0; }
.h-title {
  font-weight: 600;
  font-size: 15px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.h-meta {
  font-size: 13px;
  color: var(--text-2);
  margin-top: 2px;
}

.history-badge {
  background: var(--issue-bg);
  color: var(--issue);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  letter-spacing: 0.02em;
}
.history-badge.clean { background: var(--ok-bg); color: var(--ok); }

.skeleton-card {
  height: 70px;
  border-radius: var(--r-md);
  background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.empty-state {
  text-align: center;
  padding: 36px 16px;
  color: var(--text-2);
}
.empty-state-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  box-shadow: var(--shadow-sm);
}
.empty-state-icon svg { width: 28px; height: 28px; }
.empty-state-title {
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}
.empty-state-sub { font-size: 14px; }

/* ============================ */
/* FIELDS                        */
/* ============================ */
.field { margin-bottom: 16px; }

.field-group {
  display: flex;
  gap: 10px;
}
.field-group .half { flex: 1; }

.field-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
  letter-spacing: -0.005em;
}
.optional {
  font-weight: 400;
  color: var(--text-3);
  font-size: 12px;
  margin-left: 2px;
}

.field input[type="text"],
.field input[type="email"],
.field select,
.field textarea {
  width: 100%;
  padding: 13px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  font-size: 16px;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
  transition: border 0.15s, box-shadow 0.15s;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(15,23,42,0.06);
}

.field textarea { resize: vertical; min-height: 84px; font-family: inherit; }

/* CHIP PICKER */
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip-pick {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-2);
  transition: all 0.15s;
}
.chip-pick.selected {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.rooms-picker {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 6px;
}

.room-chip {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  padding: 14px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  user-select: none;
  color: var(--text-2);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.15s;
}
.room-chip.selected {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}
.room-chip .check {
  width: 16px; height: 16px; opacity: 0;
}
.room-chip.selected .check { opacity: 1; }

/* ============================ */
/* INSPECT SCREEN                */
/* ============================ */
.progress-bar {
  height: 3px;
  background: var(--border-soft);
  margin: 0;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #b8923f);
  width: 0%;
  transition: width 0.3s;
  border-radius: 0 3px 3px 0;
}

.property-card {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 16px 18px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 14px;
}
.property-card .pc-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--primary-soft));
  color: white;
  display: flex; align-items: center; justify-content: center;
}
.property-card .pc-icon svg { width: 22px; height: 22px; }
.property-card .pc-info { flex: 1; min-width: 0; }
.property-card .pc-address {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.property-card .pc-meta {
  font-size: 13px;
  color: var(--text-2);
  margin-top: 2px;
}

.room-section {
  background: var(--surface);
  border-radius: var(--r-lg);
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.room-header {
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
}
.room-header .room-name {
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.01em;
}
.room-progress-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}
.room-progress {
  font-size: 12px;
  background: var(--accent-soft);
  color: #8a6a2e;
  padding: 3px 10px;
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.room-progress.done { background: var(--ok-bg); color: var(--ok); }
.room-progress.has-issues { background: var(--issue-bg); color: var(--issue); }

.room-chevron {
  color: var(--text-3);
  transition: transform 0.2s;
}
.room-chevron svg { width: 20px; height: 20px; }
.room-section.collapsed .room-chevron { transform: rotate(-90deg); }
.room-section.collapsed .item-list { display: none; }

.item-list {
  padding: 4px 0 8px;
  border-top: 1px solid var(--border-soft);
}

.item-row {
  padding: 12px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  transition: background 0.12s;
}
.item-row:active { background: var(--surface-2); }

.item-info { flex: 1; min-width: 0; }
.item-name {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.005em;
}
.item-note {
  font-size: 13px;
  color: var(--text-2);
  margin-top: 3px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.item-pills {
  display: flex;
  gap: 6px;
  margin-top: 6px;
  flex-wrap: wrap;
}
.pill {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.pill.severity-minor { background: #fef3c7; color: #92400e; }
.pill.severity-major { background: var(--issue-bg); color: var(--issue); }
.pill.photo { background: var(--accent-soft); color: #8a6a2e; }

.status-toggle {
  display: flex;
  background: var(--border-soft);
  padding: 3px;
  border-radius: 12px;
  flex-shrink: 0;
}

.status-btn {
  border: none;
  background: transparent;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
  border-radius: 10px;
  cursor: pointer;
  color: var(--text-3);
  letter-spacing: -0.005em;
  transition: all 0.15s;
  min-width: 50px;
}
.status-btn.active.ok {
  background: var(--ok);
  color: white;
  box-shadow: 0 2px 8px rgba(16,185,129,0.3);
}
.status-btn.active.issue {
  background: var(--issue);
  color: white;
  box-shadow: 0 2px 8px rgba(239,68,68,0.3);
}

/* ============================ */
/* BUTTONS                       */
/* ============================ */
.primary-btn {
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 14px;
  padding: 16px 22px;
  font-size: 16px;
  font-weight: 700;
  font-family: inherit;
  letter-spacing: -0.01em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  transition: transform 0.1s, background 0.2s, box-shadow 0.2s;
  box-shadow: 0 6px 16px rgba(15,23,42,0.18);
}
.primary-btn:active {
  transform: scale(0.98);
  background: var(--primary-soft);
}
.primary-btn.full { width: 100%; }
.primary-btn svg { width: 20px; height: 20px; }

.secondary-btn {
  background: var(--surface);
  color: var(--text);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 14px 20px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.secondary-btn.full { width: 100%; }
.secondary-btn svg { width: 18px; height: 18px; }
.secondary-btn:active { background: var(--surface-2); }

.ghost-btn {
  background: var(--surface-2);
  color: var(--text);
  border: 1.5px dashed var(--border);
  border-radius: var(--r-md);
  padding: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  font-family: inherit;
  color: var(--text-2);
}
.ghost-btn svg { width: 18px; height: 18px; }
.ghost-btn:active { background: var(--border-soft); }

.text-btn {
  background: transparent;
  color: var(--text-2);
  border: none;
  padding: 14px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
}

/* ============================ */
/* BOTTOM BAR (sticky CTA)       */
/* ============================ */
.bottom-bar {
  position: sticky;
  bottom: 0;
  background: linear-gradient(to top, var(--bg) 60%, rgba(246,247,251,0));
  padding: 16px 20px calc(16px + var(--safe-bottom));
  z-index: 5;
}
.bottom-bar .primary-btn { width: 100%; }

/* ============================ */
/* SHEET (Modal)                 */
/* ============================ */
.sheet {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.55);
  z-index: 100;
  align-items: flex-end;
  justify-content: center;
  animation: fadeBg 0.2s ease;
}
.sheet.active { display: flex; }
@keyframes fadeBg {
  from { background: rgba(15,23,42,0); }
  to { background: rgba(15,23,42,0.55); }
}

.sheet-card {
  background: var(--surface);
  width: 100%;
  max-width: 480px;
  border-radius: 24px 24px 0 0;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.2);
  padding-bottom: var(--safe-bottom);
}
@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.sheet-handle {
  width: 40px;
  height: 4px;
  background: var(--border);
  border-radius: 999px;
  margin: 10px auto 6px;
}

.sheet-header {
  padding: 8px 22px 12px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.sheet-eyebrow {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.sheet-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-top: 2px;
}

.sheet-body {
  padding: 6px 22px 12px;
  overflow-y: auto;
  flex: 1;
}

.sheet-footer {
  padding: 12px 22px 18px;
  border-top: 1px solid var(--border-soft);
  background: var(--surface);
}

/* SEVERITY ROW */
.severity-row {
  display: flex;
  gap: 10px;
}
.sev-btn {
  flex: 1;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  padding: 14px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text);
  transition: all 0.15s;
}
.sev-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
}
.sev-dot.minor { background: var(--minor); }
.sev-dot.major { background: var(--major); }

.sev-btn.active[data-sev="minor"] {
  background: #fff7ed;
  border-color: var(--minor);
  color: #92400e;
}
.sev-btn.active[data-sev="major"] {
  background: var(--issue-bg);
  border-color: var(--major);
  color: var(--issue);
}

/* PHOTOS */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}

.photo-thumb {
  aspect-ratio: 1;
  border-radius: var(--r-md);
  overflow: hidden;
  position: relative;
  background: var(--border-soft);
  box-shadow: var(--shadow-sm);
}
.photo-thumb img {
  width: 100%; height: 100%; object-fit: cover;
}
.photo-thumb .remove-photo {
  position: absolute;
  top: 6px; right: 6px;
  background: rgba(15,23,42,0.75);
  color: white;
  border: none;
  width: 24px; height: 24px;
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  backdrop-filter: blur(4px);
}

/* ============================ */
/* DONE SCREEN                   */
/* ============================ */
.done-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 40px 24px calc(40px + var(--safe-bottom));
  text-align: center;
}

.success-burst {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--ok), #059669);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 22px;
  box-shadow: 0 18px 36px rgba(16,185,129,0.35);
  animation: pop 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.4);
}
.success-burst svg { width: 44px; height: 44px; }

@keyframes pop {
  0%   { transform: scale(0); }
  60%  { transform: scale(1.12); }
  100% { transform: scale(1); }
}

.done-title {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.025em;
  margin: 8px 0 6px;
}
.done-sub {
  color: var(--text-2);
  margin: 0 0 28px;
  font-size: 16px;
}

.done-wrap .primary-btn,
.done-wrap .secondary-btn {
  margin-bottom: 10px;
}

/* ============================ */
/* TOAST                         */
/* ============================ */
.toast {
  position: fixed;
  bottom: calc(28px + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--primary);
  color: white;
  padding: 12px 20px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  z-index: 300;
  opacity: 0;
  transition: all 0.3s;
  box-shadow: var(--shadow-lg);
  pointer-events: none;
  white-space: nowrap;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ============================ */
/* SAVED PROPERTIES / TENANTS    */
/* ============================ */
.saved-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin-bottom: 14px;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.saved-row::-webkit-scrollbar { display: none; }

.saved-chip {
  flex-shrink: 0;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s;
  white-space: nowrap;
}
.saved-chip:active { background: var(--surface-2); }
.saved-chip.recent { background: var(--accent-soft); border-color: var(--accent); color: #8a6a2e; }
.saved-chip svg { width: 14px; height: 14px; opacity: 0.6; }

.inline-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-2);
  cursor: pointer;
  margin: -8px 0 16px;
  user-select: none;
}
.inline-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--primary);
}

.optional-inline {
  font-weight: 400;
  font-size: 13px;
  color: var(--text-3);
  margin-left: 4px;
}

/* ============================ */
/* COST SUMMARY (inspect screen) */
/* ============================ */
.cost-summary {
  background: var(--surface);
  border-radius: var(--r-md);
  padding: 12px 14px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  border: 1.5px solid var(--accent);
}

.cs-item { flex: 1; }
.cs-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-2);
  text-transform: uppercase;
}
.cs-value {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-top: 2px;
  color: var(--issue);
}
.cs-value.muted { color: var(--text-2); }
.cs-divider {
  width: 1px;
  height: 32px;
  background: var(--border);
  margin: 0 14px;
}

/* ============================ */
/* WEAR / DAMAGE TOGGLE          */
/* ============================ */
.wear-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wear-btn {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  padding: 12px 14px;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  transition: all 0.15s;
}

.wear-btn .wear-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.wear-btn .wear-icon svg { width: 18px; height: 18px; }
.wear-icon.damage { background: var(--issue-bg); color: var(--issue); }
.wear-icon.wear { background: var(--border-soft); color: var(--text-2); }

.wear-text { flex: 1; }
.wear-name {
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -0.005em;
}
.wear-sub {
  font-size: 12px;
  color: var(--text-2);
  margin-top: 1px;
}

.wear-btn.active[data-wear="tenant_damage"] {
  background: var(--issue-bg);
  border-color: var(--issue);
}
.wear-btn.active[data-wear="normal_wear"] {
  background: var(--surface-2);
  border-color: var(--text-2);
}

/* ============================ */
/* MONEY INPUT                   */
/* ============================ */
.money-input {
  position: relative;
}
.money-prefix {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-weight: 700;
  color: var(--text-2);
  pointer-events: none;
  font-size: 16px;
}
.money-input input {
  padding-left: 28px !important;
}

/* ============================ */
/* SIGNATURE PADS                */
/* ============================ */
.sig-section {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 14px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}
.sig-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 10px;
}
.sig-title {
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -0.005em;
}
.sig-name {
  font-size: 12px;
  color: var(--text-2);
  margin-top: 2px;
}
.text-link {
  background: transparent;
  border: none;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 8px;
  font-family: inherit;
}
.text-link:active { color: var(--primary); }

.sig-pad {
  width: 100%;
  height: 160px;
  background: #fafbfc;
  border: 1.5px dashed var(--border);
  border-radius: var(--r-md);
  cursor: crosshair;
  touch-action: none;
  display: block;
}

/* ============================ */
/* PHOTO ANNOTATION OVERLAY      */
/* ============================ */
.annotate-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: #0a0a0a;
  z-index: 250;
  flex-direction: column;
}
.annotate-overlay.active { display: flex; }

.annotate-top {
  display: flex;
  align-items: center;
  padding: calc(10px + var(--safe-top)) 14px 10px;
  background: #0a0a0a;
  color: white;
  gap: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.annotate-title {
  flex: 1;
  text-align: center;
  font-weight: 700;
  font-size: 15px;
  color: white;
}
.icon-btn.ghost.light {
  background: rgba(255,255,255,0.08);
  color: white;
  box-shadow: none;
}
.primary-btn.small {
  padding: 8px 16px;
  font-size: 14px;
  border-radius: 10px;
}

.annotate-stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  touch-action: none;
}
.annotate-stage canvas {
  max-width: 100%;
  max-height: 100%;
  touch-action: none;
  display: block;
}

.annotate-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  padding-bottom: calc(12px + var(--safe-bottom));
  background: #161616;
  border-top: 1px solid rgba(255,255,255,0.08);
  overflow-x: auto;
}

.tool-btn {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(255,255,255,0.08);
  border: 1.5px solid transparent;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.tool-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--primary);
}
.tool-btn svg { width: 20px; height: 20px; }

.color-row {
  display: flex;
  gap: 6px;
  align-items: center;
}
.color-swatch {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}
.color-swatch.active {
  border-color: white;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.3);
}

/* Annotate trigger button on photo thumb */
.photo-thumb .annotate-photo {
  position: absolute;
  bottom: 6px;
  right: 6px;
  background: rgba(15,23,42,0.75);
  color: white;
  border: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  padding: 0;
}
.photo-thumb .annotate-photo svg { width: 14px; height: 14px; }

/* ============================ */
/* LOADING                       */
/* ============================ */
.loading-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(6px);
  z-index: 200;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
}
.loading-overlay.active { display: flex; }

.spinner {
  width: 38px;
  height: 38px;
  border: 3.5px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-text {
  font-weight: 600;
  color: var(--text);
  font-size: 14px;
}
