/* =============================================
   PROPERTY VALUATION TOOL v3 - Mobile UX
   ============================================= */

* { margin:0; padding:0; box-sizing:border-box; -webkit-tap-highlight-color:transparent; }

:root {
  --primary:  #1a3c5e;
  --primary2: #2563a8;
  --accent:   #e8a838;
  --green:    #22c55e;
  --red:      #ef4444;
  --amber:    #f59e0b;
  --bg:       #f0f4f8;
  --card:     #ffffff;
  --text:     #1e2a3a;
  --muted:    #6b7280;
  --border:   #dde4ed;
  --radius:   12px;
}

html { font-size: 16px; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
}

/* ── SCREENS ─────────────────────────────── */
.screen { display: none; }
/* All screens use flex column layout when active */
.screen.active { display: flex; flex-direction: column; min-height: 100vh; }
/* Inspect screen — CSS grid to place tab bar on right side */
#screen-inspect.active {
  display: grid;
  grid-template-columns: 1fr 56px;
  grid-template-rows: auto 1fr;
  grid-template-areas:
    "topbar tabbar"
    "panels tabbar";
  height: 100vh;
  height: 100dvh;
  min-height: unset;
  max-height: 100vh;
  overflow: hidden;
}
#screen-inspect > .top-bar    { grid-area: topbar; }
#screen-inspect > .tab-panels { grid-area: panels; }
#screen-inspect > .tab-bar {
  grid-area: tabbar;
  flex-direction: column;
  border-top: none;
  border-left: 1.5px solid var(--border);
  padding: 8px 0;
  box-shadow: -2px 0 6px rgba(0,0,0,0.06);
  justify-content: space-around;
  overflow-y: auto;
}
#screen-inspect > .tab-bar .tab-item {
  flex: none;
  width: 100%;
  padding: 8px 2px;
  font-size: 17px;
  position: relative;
  border-radius: 10px;
  transition: background 0.15s, color 0.15s;
}
#screen-inspect > .tab-bar .tab-item.active {
  background: rgba(37, 99, 168, 0.13);
  color: var(--primary2);
}
#screen-inspect > .tab-bar .tab-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 55%;
  background: var(--primary2);
  border-radius: 0 3px 3px 0;
}
#screen-inspect > .tab-bar .tab-label { display: none; }

/* ── SHARED TOP BAR ──────────────────────── */
.top-bar {
  background: var(--primary);
  color: white;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.top-bar h2 { font-size: 17px; font-weight: 700; flex: 1; }
.btn-back-top {
  background: none; border: none; color: white;
  font-size: 22px; cursor: pointer; line-height: 1; padding: 0;
}
.type-badge {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 12px; font-weight: 600; color: white;
}
.btn-discl-top {
  background: none; border: none;
  color: rgba(255,255,255,0.55);
  font-size: 15px; padding: 2px 4px;
  cursor: pointer; line-height: 1;
  flex-shrink: 0;
  transition: color 0.15s;
}
.btn-discl-top:hover { color: rgba(255,255,255,0.9); }

/* ═══════════════════════════════════════════
   LANDING SCREEN
   ═══════════════════════════════════════════ */
#screen-landing {
  background: linear-gradient(160deg, #1a3c5e 0%, #2563a8 100%);
}
.landing-header {
  position: relative;
  height: clamp(120px, 15vw, 175px);
  overflow: hidden;
  color: white;
}
/* "Valoris" anchored bottom-left in the open sky */
.landing-brand {
  position: absolute;
  bottom: 22px;
  left: 24px;
  z-index: 2;
  font-size: 28px;
  font-weight: 800;
  color: white;
  text-shadow: 0 1px 8px rgba(0,0,0,0.4);
}
.landing-skyline {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  display: block;
  z-index: 0;
}
.landing-sub {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 16px;
}
.btn-settings-icon {
  position: absolute;
  top: 18px; right: 18px;
  z-index: 3;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  width: 42px; height: 42px;
  font-size: 18px; cursor: pointer; color: white;
  display: flex; align-items: center; justify-content: center;
}

.landing-body {
  flex: 1;
  background: var(--bg);
  border-radius: 24px 24px 0 0;
  padding: 24px 16px 40px;
}

.section-label {
  font-size: 11px; font-weight: 800; text-transform: uppercase;
  letter-spacing: 1px; color: var(--muted); margin-bottom: 12px;
}

/* Property type grid */
.type-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin-bottom: 28px;
}
.type-card {
  background: white; border-radius: var(--radius);
  padding: 16px 8px; text-align: center; cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  border: 2px solid transparent;
  transition: all 0.2s; user-select: none;
}
.type-card:active { transform: scale(0.95); border-color: var(--primary2); }
.type-card .t-icon  { font-size: 28px; margin-bottom: 6px; }
.type-card .t-label { font-size: 11px; font-weight: 700; color: var(--text); line-height: 1.3; }

/* Recent inspections */
.recent-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.recent-card {
  background: white; border-radius: 10px;
  display: flex; align-items: stretch;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
  overflow: hidden;
}
.recent-card-main {
  flex: 1; display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; cursor: pointer; min-width: 0;
}
.recent-card-main:active { background: var(--bg); }
.recent-icon  { font-size: 22px; flex-shrink: 0; }
.recent-info  { flex: 1; min-width: 0; }
.recent-addr  { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent-meta  { font-size: 12px; color: var(--muted); }
.recent-arrow { color: var(--muted); font-size: 18px; flex-shrink: 0; }
.btn-delete-recent {
  background: #fff5f5;
  border: none;
  border-left: 1px solid var(--border);
  color: var(--red);
  font-size: 18px;
  padding: 0 14px;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s;
}
.btn-delete-recent:active { background: #fee2e2; }
.empty-recent { text-align: center; color: var(--muted); font-size: 13px; padding: 20px 0; }

/* ═══════════════════════════════════════════
   SETUP / SETTINGS SCREEN
   ═══════════════════════════════════════════ */
#screen-setup {
  /* layout handled by .screen.active */
}
.setup-body {
  flex: 1; padding: 24px;
  display: flex; flex-direction: column; gap: 16px;
  overflow-y: auto;
}
.setup-icon  { font-size: 48px; text-align: center; }
.setup-title { font-size: 22px; font-weight: 800; color: var(--primary); text-align: center; }
.setup-desc  { font-size: 14px; color: var(--muted); text-align: center; line-height: 1.6; }

.setup-steps { background: white; border-radius: var(--radius); padding: 16px; }
.setup-step  { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 12px; }
.setup-step:last-child { margin-bottom: 0; }
.step-num {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--primary); color: white;
  font-size: 12px; font-weight: 800;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.step-text { font-size: 13px; color: var(--text); line-height: 1.5; }
.step-text a { color: var(--primary2); font-weight: 600; }

.api-input-wrap { position: relative; }
.api-input-wrap input {
  width: 100%; padding: 13px 44px 13px 14px;
  border: 2px solid var(--border); border-radius: 10px;
  font-size: 15px; font-family: monospace;
}
.api-input-wrap input:focus { outline: none; border-color: var(--primary2); }
.toggle-key {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; font-size: 18px;
}

.btn-primary {
  width: 100%; padding: 14px;
  background: var(--primary); color: white;
  border: none; border-radius: 10px;
  font-size: 16px; font-weight: 700; cursor: pointer; font-family: inherit;
}
.btn-skip {
  width: 100%; padding: 12px;
  background: none; border: none;
  font-size: 13px; color: var(--muted);
  cursor: pointer; font-family: inherit;
}
.setup-divider {
  width: 100%; height: 1px;
  background: #e0e8f0; margin: 24px 0 20px;
}
.setup-disc-field {
  width: 100%; margin-bottom: 14px;
}
.valuer-profile-grid {
  width: 100%; display: flex; flex-direction: column; gap: 10px;
  margin-bottom: 16px;
}
.vp-field { display: flex; flex-direction: column; gap: 4px; }
.vp-field label { font-size: 12px; font-weight: 600; color: var(--primary2); }
.vp-field input {
  padding: 10px 12px; border: 1.5px solid #d0d9e8; border-radius: 8px;
  font-size: 14px; font-family: inherit; background: #fafcff;
}
.vp-upload-row {
  display: flex; gap: 12px; width: 100%; margin-bottom: 16px;
}
.vp-upload-box {
  flex: 1; border: 1.5px dashed #b0c4de; border-radius: 10px;
  padding: 14px 10px; text-align: center; cursor: pointer;
  background: #f4f8ff; display: flex; flex-direction: column; align-items: center;
}
.vp-upload-label { font-size: 12px; font-weight: 700; color: var(--primary2); margin-bottom: 4px; }
.vp-upload-hint  { font-size: 11px; color: var(--muted); margin-top: 6px; }

/* ═══════════════════════════════════════════
   INSPECTION SCREEN (Tab-based)
   ═══════════════════════════════════════════ */
#screen-inspect {
  /* layout handled by .screen.active + #screen-inspect.active above */
}

/* Tab panels container */
.tab-panels {
  flex: 1;
  min-height: 0;
  position: relative;
  overflow: hidden;
}

/* Individual tab panel */
.tab-panel {
  display: none;
  position: absolute;
  inset: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 12px;
  padding-bottom: 28px;
}
.tab-panel.active { display: block; }

/* Space between cards inside panels */
.tab-panel .card,
.tab-panel .photo-zone,
.tab-panel .auto-row,
.tab-panel .btn-next-tab,
.tab-panel .btn-skip-to-review {
  margin-bottom: 12px;
}
/* Building panel — tighter card spacing and padding */
#panel-building .card {
  margin-bottom: 7px;
  padding: 10px 12px;
}
.tab-panel .btn-next-tab:last-child,
.tab-panel .btn-skip-to-review:last-child {
  margin-bottom: 4px;
}

/* ── TAB BAR ─────────────────────────────── */
.tab-bar {
  display: flex;
  background: white;
  border-top: 1.5px solid var(--border);
  padding: 6px 0 calc(8px + env(safe-area-inset-bottom, 0px));
  flex-shrink: 0;
  box-shadow: 0 -2px 8px rgba(0,0,0,0.06);
}
.tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 2px;
  color: var(--muted);
  transition: color 0.15s;
}
.tab-item.active { color: var(--primary); }
.tab-icon  { font-size: 18px; line-height: 1; }
.tab-label {
  font-size: 8.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.3px;
  font-family: inherit;
}

/* ── COVER PHOTO ─────────────────────────── */
.photo-zone {
  background: white;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
  cursor: pointer;
}
.photo-placeholder {
  height: 180px;
  background: linear-gradient(135deg, #e8f0fe, #dde8f5);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 8px;
}
.ph-icon { font-size: 40px; }
.ph-text { font-size: 14px; font-weight: 600; color: var(--primary); }
.ph-sub  { font-size: 12px; color: var(--muted); }
.cover-preview { width: 100%; max-height: 220px; object-fit: cover; display: none; }
.photo-retake {
  padding: 10px; text-align: center;
  font-size: 13px; font-weight: 600; color: var(--primary2);
  border-top: 1px solid var(--border);
}

/* ── AUTO ROW (GPS + DATE) ───────────────── */
.auto-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 10px;
}
.auto-card {
  background: white;
  border-radius: var(--radius);
  padding: 12px 14px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.gps-card { display: flex; align-items: center; gap: 10px; }
.auto-label { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.3px; }
.gps-value { font-size: 12px; color: var(--text); margin-top: 3px; line-height: 1.3; }
.date-auto-card .date-val { font-size: 12px; font-weight: 600; color: var(--text); margin-top: 3px; line-height: 1.3; }

/* GPS dot */
.gps-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); flex-shrink: 0; }
.gps-dot.getting { background: var(--amber); animation: pulse 1s infinite; }
.gps-dot.got     { background: var(--green); }
.gps-dot.error   { background: var(--red); }
@keyframes pulse { 0%,100% { opacity:1; } 50% { opacity:0.4; } }

/* ── CARDS ───────────────────────────────── */
.card {
  background: white;
  border-radius: var(--radius);
  padding: 14px 14px 14px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.card-title {
  font-size: 11px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.8px;
  color: var(--muted);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--bg);
  display: flex; align-items: center; gap: 6px;
}
.card-title-note {
  font-weight: 500; text-transform: none; letter-spacing: 0;
  font-size: 10px; font-style: italic;
}

/* ── OTHER ROOM (custom room entry) ─────── */
input.other-room-name-input {
  display: block !important; width: 100% !important; box-sizing: border-box !important;
  font-size: 11px !important; font-weight: 700 !important;
  text-transform: uppercase; letter-spacing: 0.3px;
  color: var(--muted) !important;
  border: none !important; background: transparent !important;
  padding: 0 !important; margin-bottom: 6px;
  outline: none !important; font-family: inherit !important;
  box-shadow: none !important; border-radius: 0 !important;
}
input.other-room-name-input:focus {
  border: none !important; box-shadow: none !important; outline: none !important;
}
input.other-room-name-input::placeholder { color: var(--muted); opacity: 0.6; }

/* ── FORM FIELDS ─────────────────────────── */
.field { margin-bottom: 14px; }
.field-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.field-row-2 .field { margin-bottom: 0; }
label {
  display: block;
  font-size: 11px; font-weight: 700;
  color: var(--muted); margin-bottom: 6px;
  text-transform: uppercase; letter-spacing: 0.3px;
}
input[type=text], input[type=number], textarea {
  width: 100%;
  padding: 12px 13px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 16px; color: var(--text);
  background: white; font-family: inherit;
  -webkit-appearance: none;
  transition: border-color 0.2s;
}
input:focus, textarea:focus {
  outline: none; border-color: var(--primary2);
  box-shadow: 0 0 0 3px rgba(37,99,168,0.1);
}
textarea { resize: vertical; min-height: 70px; line-height: 1.5; }

/* ── SITE DESCRIPTION PREVIEW ────────── */
.site-desc-preview {
  background: #f0f7ff;
  border: 1.5px solid #bfdbfe;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.6;
  color: #1e40af;
  margin-bottom: 10px;
  min-height: 36px;
  font-style: italic;
}
.site-desc-preview:empty::before {
  content: 'Select options above to build description...';
  color: #93c5fd;
}

/* ── ROOM CHIP + NOTES TEXTAREA ─────────── */
.chip-group + textarea,
input.other-room-name-input + textarea {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
  border-color: var(--border);
  background: #fafbfc;
}
.chip-group + textarea::placeholder,
input.other-room-name-input + textarea::placeholder { color: #bcc5d0; font-style: italic; }

/* ── INDUSTRIAL ADD BUILDING ─────────── */
.btn-add-ind-building {
  display: block; width: 100%; margin-top: 14px;
  padding: 10px; border-radius: 8px;
  border: 1.5px dashed var(--primary2);
  background: #f0f7ff; color: var(--primary2);
  font-size: 14px; font-weight: 600;
  cursor: pointer; text-align: center;
}
.btn-add-ind-building:active { background: #dbeafe; }
.ind-building-extra { margin-top: 10px; }
.ind-extra-name { margin-bottom: 6px; }

/* ── TAP BUTTONS (main feature!) ────────── */
.tap-group {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.tap-group.tap-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
}
.tap-group.tap-3col {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 5px;
}
.tap-group.tap-4col {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 5px;
}
.tap-group.tap-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 5px;
}
.tap-group.tap-row .tap-opt {
  flex: 1;
  min-width: 0;
  padding: 8px 4px;
  font-size: 11px;
}
.tap-group.tap-inline-sm {
  display: flex;
  flex-wrap: nowrap;
  gap: 5px;
}
.tap-group.tap-inline-sm .tap-opt {
  flex: 1;
  min-width: 0;
  padding: 7px 4px;
  font-size: 11px;
  text-align: center;
}

.tap-opt {
  flex: 1;
  min-width: calc(50% - 3px);
  padding: 5px 7px;
  border: 1.5px solid var(--border);
  border-radius: 7px;
  background: white;
  font-size: 11px; font-weight: 600;
  cursor: pointer; text-align: center;
  color: var(--text); font-family: inherit;
  transition: all 0.15s;
  line-height: 1.2; user-select: none;
}
.tap-opt:active { transform: scale(0.96); }

/* Selected state (default blue) */
.tap-opt.sel {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

/* Colored tap options (condition / repairs) */
.tap-opt.tap-green { border-color: var(--green); color: #16a34a; }
.tap-opt.tap-amber { border-color: var(--amber); color: #d97706; }
.tap-opt.tap-red   { border-color: var(--red);   color: var(--red); }

.tap-opt.tap-green.sel { background: var(--green); border-color: var(--green); color: white; }
.tap-opt.tap-amber.sel { background: var(--amber); border-color: var(--amber); color: white; }
.tap-opt.tap-red.sel   { background: var(--red);   border-color: var(--red);   color: white; }

/* ── NUMBER BUTTONS (bedrooms/bathrooms) ─── */
.num-group { display: flex; gap: 6px; flex-wrap: wrap; }
.num-btn {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: white;
  font-size: 13px; font-weight: 700;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--text); font-family: inherit;
  transition: all 0.15s; flex-shrink: 0; user-select: none;
}
.num-btn:active { transform: scale(0.9); }
.num-btn.sel {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

/* ── CHIP TOGGLES ────────────────────────── */
.chip-group { display: flex; flex-wrap: wrap; gap: 5px; }
.chip {
  padding: 4px 9px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: white;
  font-size: 11px; font-weight: 500;
  cursor: pointer; transition: all 0.15s; user-select: none;
}
.chip.on {
  background: var(--primary);
  border-color: var(--primary);
  color: white; font-weight: 600;
}

/* ── RISK RATING ─────────────────────────── */
.risk-row {
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--bg);
  gap: 8px;
}
.risk-row:last-child { border-bottom: none; }
.risk-label { font-size: 13px; flex: 1; line-height: 1.3; }
.risk-btns  { display: flex; gap: 5px; flex-shrink: 0; }
.risk-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: white;
  font-size: 13px; font-weight: 700;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s; color: var(--muted);
  font-family: inherit;
}
.risk-btn.sel-low    { background: #66bb6a; border-color: #66bb6a; color: white; }
.risk-btn.sel-mid    { background: #fff176; border-color: #f9a825; color: #555;  }
.risk-btn.sel-orange { background: #ffa726; border-color: #fb8c00; color: white; }
.risk-btn.sel-high   { background: #ef5350; border-color: #c62828; color: white; }

/* ── RISK COMMENT DROPDOWN ───────────────── */
.risk-comment-wrap {
  display: flex; gap: 8px; align-items: center;
  padding: 6px 0 10px 0;
  border-bottom: 1px dashed #e0e0e0;
  margin-bottom: 2px;
}
.risk-comment-sel {
  flex: 1; padding: 8px 10px;
  border: 1.5px solid #b0c4de; border-radius: 8px;
  background: #f4f8ff; color: #333;
  font-size: 13px; font-family: inherit;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23666' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
  padding-right: 28px;
}
.btn-risk-add {
  flex-shrink: 0; width: 34px; height: 34px;
  border: 1.5px dashed var(--primary2); border-radius: 8px;
  background: #f0f7ff; color: var(--primary2);
  font-size: 18px; line-height: 1; font-weight: 600;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}

/* ── STANDARD DISCLOSURES TAB ────────────── */
.disc-note {
  font-size: 12px; color: var(--muted); margin: 0; padding: 2px 0 4px;
}
.disc-label {
  font-size: 12px; font-weight: 700; color: var(--primary2);
  text-transform: uppercase; letter-spacing: 0.5px;
  margin-bottom: 6px;
}
.disc-textarea {
  width: 100%; box-sizing: border-box;
  border: 1.5px solid #d0d9e8; border-radius: 8px;
  padding: 10px 12px; font-size: 13px; font-family: inherit;
  color: #333; background: #fafcff;
  resize: vertical; line-height: 1.5;
  min-height: 80px;
}
.disc-textarea:focus {
  outline: none; border-color: var(--primary2);
  background: #fff; box-shadow: 0 0 0 3px rgba(46,92,158,0.08);
}

/* ── NEXT TAB BUTTON ─────────────────────── */
.btn-next-tab {
  width: 100%; padding: 15px;
  background: var(--primary); color: white;
  border: none; border-radius: 10px;
  font-size: 15px; font-weight: 700;
  cursor: pointer; font-family: inherit;
  transition: opacity 0.2s;
}
.btn-next-tab:active { opacity: 0.85; }
.btn-skip-to-review {
  background: var(--bg);
  color: var(--muted);
  border: 1.5px solid var(--border);
}

/* ── REVIEW TAB ──────────────────────────── */
.cover-thumb {
  width: 100%; border-radius: var(--radius);
  max-height: 200px; object-fit: cover;
  margin-bottom: 12px; display: none;
}
.review-section { margin-bottom: 16px; }
.review-section-title {
  font-size: 11px; font-weight: 800; text-transform: uppercase;
  letter-spacing: 1px; color: var(--muted);
  margin-bottom: 8px; padding: 0 4px;
}
.review-grid { display: flex; flex-direction: column; gap: 5px; }
.review-row {
  background: white; border-radius: 8px;
  padding: 10px 14px;
  display: flex; gap: 10px; align-items: flex-start;
}
.r-label { font-size: 11px; font-weight: 700; color: var(--muted); min-width: 100px; flex-shrink: 0; }
.r-value { font-size: 13px; color: var(--text); flex: 1; word-break: break-word; }

.review-layout {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 0;
  height: 100%;
}

.export-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 6px;
  background: #f5f5f5;
  border-right: 1px solid #ddd;
  min-width: 56px;
  flex-shrink: 0;
}
.btn-export {
  width: 44px; height: 44px; padding: 0;
  background: var(--accent); color: white;
  border: none; border-radius: 8px;
  font-size: 11px; font-weight: 700;
  cursor: pointer; font-family: inherit;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 2px;
}
.btn-export-excel {
  width: 100%; padding: 15px;
  background: var(--primary); color: white;
  border: none; border-radius: 10px;
  font-size: 16px; font-weight: 700;
  cursor: pointer; font-family: inherit;
}

/* ── TOAST ───────────────────────────────── */
.toast {
  position: fixed;
  top: 70px; left: 50%;
  transform: translateX(-50%);
  background: #1e293b; color: white;
  padding: 10px 20px; border-radius: 24px;
  font-weight: 600; font-size: 14px;
  z-index: 500; opacity: 0; pointer-events: none;
  transition: opacity 0.3s; white-space: nowrap;
  max-width: 90vw; text-align: center;
}
.toast.show { opacity: 1; }

/* ═══════════════════════════════════════════
   SAVED INSPECTIONS SCREEN
   ═══════════════════════════════════════════ */
.saved-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 12px;
  padding-bottom: 32px;
}
.saved-card {
  background: white;
  border-radius: var(--radius);
  margin-bottom: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  overflow: hidden;
  display: flex;
  align-items: stretch;
}
.saved-card-main {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  cursor: pointer;
  min-width: 0;
}
.saved-card-main:active { background: var(--bg); }
.saved-icon { font-size: 24px; flex-shrink: 0; }
.saved-details { flex: 1; min-width: 0; }
.saved-addr { font-size: 14px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.saved-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.saved-edit { font-size: 12px; color: var(--primary2); font-weight: 600; flex-shrink: 0; }
.btn-delete-saved {
  background: #fff5f5;
  border: none;
  border-left: 1px solid var(--border);
  color: var(--red);
  font-size: 20px;
  padding: 0 18px;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s;
}
.btn-delete-saved:active { background: #fee2e2; }
.empty-saved {
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  padding: 48px 24px;
  line-height: 1.8;
}

/* ── LANDING UPDATES ─────────────────────── */
.btn-view-all {
  width: 100%;
  padding: 13px;
  background: white;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--primary2);
  cursor: pointer;
  font-family: inherit;
  text-align: center;
  margin-top: 4px;
}

/* ── HOME BUTTON IN TOP BAR ──────────────── */
.btn-home-top {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 20px;
  color: white;
  font-size: 13px;
  font-weight: 700;
  padding: 5px 12px;
  cursor: pointer;
  white-space: nowrap;
}

/* ── REVIEW TAB — SAVE FLOW ──────────────── */
.btn-save-main {
  width: 44px; height: 44px; padding: 0;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 2px;
}
.save-success {
  background: white;
  border-radius: var(--radius);
  padding: 24px 20px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
  margin-top: 8px;
}
.save-success-icon  { font-size: 48px; margin-bottom: 10px; }
.save-success-title { font-size: 20px; font-weight: 800; color: var(--primary); margin-bottom: 4px; }
.save-success-sub   { font-size: 14px; color: var(--muted); margin-bottom: 20px; }
.btn-after-home {
  display: block; width: 100%; padding: 14px;
  background: var(--primary); color: white;
  border: none; border-radius: 10px;
  font-size: 15px; font-weight: 700;
  cursor: pointer; font-family: inherit;
  margin-bottom: 10px;
}
.btn-after-new {
  display: block; width: 100%; padding: 14px;
  background: var(--green); color: white;
  border: none; border-radius: 10px;
  font-size: 15px; font-weight: 700;
  cursor: pointer; font-family: inherit;
  margin-bottom: 10px;
}
.btn-after-export {
  display: block; width: 100%; padding: 12px;
  background: none; color: var(--muted);
  border: 1.5px solid var(--border); border-radius: 10px;
  font-size: 14px; font-weight: 600;
  cursor: pointer; font-family: inherit;
}

/* ── UTILS ───────────────────────────────── */
@media (max-width: 360px) {
  .type-grid { grid-template-columns: 1fr 1fr 1fr; }
  .num-btn { width: 34px; height: 34px; font-size: 12px; }
}

/* ══ SKETCH TOOL ════════════════════════════════════════════════ */

/* Top toolbar */
.sketch-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  background: #f0f4f8;
  border-radius: 10px;
  padding: 10px 12px;
}
.sketch-label {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.sketch-floors {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.floor-btn {
  padding: 5px 10px;
  border-radius: 6px;
  border: 1.5px solid #c5d0db;
  background: #fff;
  font-size: 12px;
  font-weight: 600;
  color: #546e7a;
  cursor: pointer;
  transition: all 0.15s;
}
.floor-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.sketch-scale {
  display: flex;
  align-items: center;
  gap: 6px;
}
.sketch-select {
  padding: 5px 8px;
  border-radius: 6px;
  border: 1.5px solid #c5d0db;
  font-size: 12px;
  background: #fff;
  color: #37474f;
}
.sketch-tool-btn {
  padding: 5px 10px;
  border-radius: 6px;
  border: 1.5px solid #c5d0db;
  background: #fff;
  font-size: 12px;
  font-weight: 600;
  color: #546e7a;
  cursor: pointer;
  transition: all 0.15s;
}
.sketch-tool-btn.active {
  background: #e3f2fd;
  border-color: #1976d2;
  color: #1565c0;
}

/* Canvas wrap */
.sketch-canvas-wrap {
  width: 100%;
  height: 70vh;
  min-height: 320px;
  border-radius: 10px;
  overflow: hidden;
  background: #f8fafc;
  border: 1.5px solid #d0dae4;
  cursor: crosshair;
  touch-action: none;
  position: relative;
}
.sketch-canvas-wrap canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* Action bar */
.sketch-actionbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.sketch-action-btn {
  flex: 1;
  min-width: 90px;
  padding: 9px 12px;
  border-radius: 8px;
  border: 1.5px solid #c5d0db;
  background: #fff;
  font-size: 13px;
  font-weight: 600;
  color: #37474f;
  cursor: pointer;
  transition: background 0.15s;
}
.sketch-action-btn:hover  { background: #f0f4f8; }
.sketch-close-btn         { border-color: #1976d2; color: #1565c0; background: #e3f2fd; }
.sketch-flip-btn          { border-color: #00897b; color: #00695c; background: #e0f2f1; }
.sketch-lock-btn          { border-color: #7b1fa2; color: #6a1b9a; background: #f3e5f5; }
.sketch-clear-btn         { border-color: #e53935; color: #c62828; }

/* Room palette */
.sketch-palette {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 4px;
}
.room-chip {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: grab;
  user-select: none;
  border: 1.5px solid rgba(0,0,0,0.10);
  background: #e8f4fd;
  color: #1565c0;
  transition: transform 0.1s, box-shadow 0.1s;
}
.room-chip:active {
  transform: scale(1.08);
  box-shadow: 0 3px 10px rgba(0,0,0,0.18);
  cursor: grabbing;
}

/* Room summary table */
.sketch-summary-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.sketch-summary-table th {
  text-align: left;
  padding: 5px 8px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  border-bottom: 1px solid #e2e8f0;
}
.sketch-summary-table td {
  padding: 5px 8px;
  border-bottom: 1px solid #f0f4f8;
}
.sketch-summary-table tfoot td {
  border-top: 2px solid #d0dae4;
  border-bottom: none;
  font-weight: 700;
  color: #0d47a1;
}
.sketch-no-rooms {
  font-size: 13px;
  color: var(--muted);
  font-style: italic;
  margin: 4px 0;
}

/* Add to report button */
.btn-sketch-report {
  width: 100%;
  padding: 14px;
  border-radius: 10px;
  border: 2px solid #1976d2;
  background: #e3f2fd;
  color: #1565c0;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-sketch-report:hover { background: #bbdefb; }

/* Toast */
.sketch-toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #323232;
  color: #fff;
  padding: 10px 20px;
  border-radius: 24px;
  font-size: 13px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 9999;
  white-space: nowrap;
}
.sketch-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ══ PDF REPORT RENDERER ════════════════════════════════════════════ */

.pdf-print-btn {
  width: 44px; height: 44px; padding: 0;
  background: var(--primary2); color: white;
  border: none; border-radius: 8px;
  font-size: 11px; font-weight: 700;
  cursor: pointer; font-family: inherit;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 2px;
}
.pdf-print-btn:active { background: var(--primary); }
.btn-icon { font-size: 16px; line-height: 1; }
.btn-lbl  { font-size: 9px; font-weight: 700; line-height: 1; }

.pdf-preview { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 0; padding: 16px; background: #d0d0d0; overflow-y: auto; }

/* Wrapper shrinks the A4 page visually — keeps actual pixel size for PDF export */
.pdf-page-wrap {
  width:  calc(794px * 0.62);   /* ≈ 492px visible */
  height: calc(1122px * 0.62);  /* ≈ 696px visible */
  flex-shrink: 0;
  margin-bottom: 12px;
  overflow: hidden;
}
.pdf-page-wrap .pdf-page {
  transform: scale(0.62);
  transform-origin: top left;
}

/* During html2pdf export — added to #pdfPreview container so ancestor CSS reaches all pages */
.pdf-exporting {
  display:    block   !important;
  width:      794px   !important;
  padding:    0       !important;
  background: none    !important;
  gap:        0       !important;
  overflow:   visible !important;
}
.pdf-exporting .pdf-page {
  box-shadow:    none    !important;
  border-radius: 0       !important;
  margin:        0       !important;
  width:         794px   !important;
  height:        1122px  !important;
  min-height:    unset   !important;
  padding:       53px 38px 45px 38px !important;
  overflow:      hidden  !important;
  position:      relative !important;
}
.pdf-exporting .pdf-cover-page {
  padding-left: 108px !important;
  padding-top:  44px  !important;
}
.pdf-exporting .pdf-cover-page::before {
  left:  14px !important;
  width: 78px !important;
}

/* Each A4 page ─────────────────────────────── */
.pdf-page {
  background: white;
  box-shadow: 0 2px 14px rgba(0,0,0,0.13);
  font-family: Calibri, Arial, sans-serif;
  font-size: 8.5pt;
  line-height: 1.35;
  color: #000;
  position: relative;
  padding: 16px 14px 28px 16px;
  overflow: hidden;
  width: 794px;
  height: 1122px;
  flex-shrink: 0;
}

/* Cover page: grey decorative rectangle on left (only page 1) */
.pdf-cover-page {
  padding-left: 108px; /* 14px white gap + 78px bar + 16px content margin */
  padding-top: 44px;
}
.pdf-cover-page::before {
  content: '';
  position: absolute;
  left: 14px;
  top: 0;
  width: 78px;
  height: 100%;
  background: #b8b8b8;
  z-index: 0;
}

/* Section bordered box ─────────────────────── */
.pdf-section { border: 1.5px solid #000; margin-bottom: 28px; width: 100%; }

/* Section header (numbered 1–9) ────────────── */
.pdf-sec-hdr {
  background: #fff; color: #000;
  font-weight: 700; font-size: 9.5pt;
  padding: 3px 6px;
  border-bottom: 0.5px solid #ccc;
}

/* Tables ───────────────────────────────────── */
.pdf-tbl { width: 100%; border-collapse: collapse; font-size: 6.75pt; }
.pdf-tbl th, .pdf-tbl td {
  border: 1px solid #ccc;
  padding: 2px 5px;
  vertical-align: top;
  font-size: 6.75pt;
}
.pdf-tbl th {
  background: #fff; color: #000;
  font-weight: 700; text-align: left;
}

/* Right-aligned bold label cells ───────────── */
.pdf-lbl { font-weight: 700; font-size: 5.9pt; text-align: right; color: #000; white-space: nowrap; padding-right: 5px; }

/* Risk colour cells ────────────────────────── */
.risk-cell { text-align: center; font-weight: 700; font-size: 7.5pt; padding: 2px 3px !important; }
.rc-2 { background: #c6efce !important; color: #276221 !important; }
.rc-3 { background: #ffeb9c !important; color: #9c5700 !important; }
.rc-4 { background: #ffc000 !important; color: #000 !important; }
.rc-5 { background: #ff0000 !important; color: #fff !important; }

/* Market Value row — only label/MUR/amount cells are blue */
.pdf-mv-cell     { background: #1f3864 !important; color: white !important; font-weight: 700; font-size: 8pt !important; border-color: #1f3864 !important; }
.pdf-mv-cell-comp{ background: #4472c4 !important; color: white !important; font-weight: 700; font-size: 8pt !important; border-color: #4472c4 !important; }

/* Disclosure sub-headers & body ────────────── */
.pdf-disc-hdr { font-weight: 700; font-size: 8.5pt; padding: 4px 0 2px; }
.pdf-disc-body { font-size: 8pt; line-height: 1.4; margin-bottom: 4px; }

/* Page number ──────────────────────────────── */
.pdf-pgnum { position: absolute; bottom: 8mm; right: 10mm; font-size: 8pt; color: #555; }

/* Valuer details — pinned to bottom of page 2 */
.pdf-valuer-section { position: absolute; bottom: 28px; left: 14px; right: 14px; width: auto; }

/* ── Cover page ─────────────────────────────── */
.pdf-cover-header { display: flex; justify-content: space-between; align-items: flex-start; }
.pdf-cover-title  { font-size: 34pt; font-weight: 700; color: #808080; white-space: nowrap; }
.pdf-cover-sub    { font-size: 18pt; font-weight: 700; color: #000; margin-top: 6px; }
.pdf-cover-logo   { max-height: 138px; max-width: 250px; object-fit: contain; }
.pdf-cover-logo-ph {
  border: 1px solid #ccc; padding: 8px 16px; font-size: 7pt; color: #aaa;
  text-align: center; min-width: 110px; min-height: 50px;
  display: flex; align-items: center; justify-content: center;
}
.pdf-cover-photo-wrap { width: 100%; margin: 110px 0 0; text-align: center; }
.pdf-cover-photo  { max-width: 85%; max-height: 600px; object-fit: cover; display: inline-block; }
.pdf-cover-nophoto {
  width: 85%; height: 560px; margin: 0 auto; display: flex;
  align-items: center; justify-content: center;
  background: #f0f0f0; border: 1px dashed #bbb; font-size: 8pt; color: #aaa;
}
.pdf-cover-footer { position: absolute; bottom: 60px; left: 108px; right: 20px; }
.pdf-cover-frow { display: flex; justify-content: space-between; align-items: flex-start; font-size: 8.5pt; margin-bottom: 10px; padding: 0 10px; gap: 16px; }
.pdf-cover-frow > div { max-width: 48%; word-break: break-word; }
.pdf-cover-frow span { font-weight: 700; white-space: nowrap; }

/* ── Print media ─────────────────────────────── */
@media print {
  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
  #screen-landing, #screen-setup, #screen-saved { display: none !important; }
  #screen-inspect {
    display: block !important;
    height: auto !important; max-height: none !important;
    overflow: visible !important;
    grid-template-columns: unset !important;
    grid-template-rows: unset !important;
    grid-template-areas: unset !important;
  }
  .top-bar, .tab-bar { display: none !important; }
  .tab-panels { display: block !important; overflow: visible !important; position: static !important; }
  .tab-panel { display: none !important; position: static !important; overflow: visible !important; }
  #panel-review { display: block !important; padding: 0 !important; overflow: visible !important; }
  .review-layout { display: block !important; }
  .pdf-print-btn, .export-actions, .save-success, .cover-thumb { display: none !important; }
  .pdf-preview { flex: none !important; gap: 0; padding: 0; background: none; overflow: visible !important; }
  .pdf-page {
    width: 210mm !important; min-height: 297mm !important;
    padding: 14mm 10mm 12mm 10mm !important;
    box-shadow: none !important; border-radius: 0 !important;
    page-break-after: always !important; break-after: page !important;
    margin: 0 !important; overflow: visible !important;
  }
  .pdf-cover-page {
    padding-left: 40mm !important; /* 3mm gap + 27mm bar + 10mm content margin */
  }
  .pdf-cover-page::before {
    left: 3mm !important;   /* white gap from page edge */
    width: 27mm !important;
    height: 100% !important; /* full A4 height */
  }
  .pdf-page:last-child { page-break-after: avoid !important; break-after: avoid !important; }
  .pdf-pgnum { position: fixed; bottom: 8mm; right: 10mm; }
}
@page { size: A4 portrait; margin: 0; }

/* Tablet: taller canvas */
@media (min-width: 768px) {
  .sketch-canvas-wrap { height: 78vh; }
  #panel-sketch.active {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    align-items: start;
  }
}

/* ══ CALCULATION TOOL ═══════════════════════════════════════════════ */

.calc-module-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  background: var(--bg);
  border-radius: 10px;
  padding: 10px;
}
.calc-mod-btn {
  padding: 6px 10px;
  border-radius: 6px;
  border: 1.5px solid var(--border);
  background: white;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  color: var(--muted);
  transition: all 0.15s;
  white-space: nowrap;
}
.calc-mod-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}
.calc-mod-btn.primary {
  border-color: var(--accent);
  color: var(--primary);
  font-size: 12px;
  padding: 8px 12px;
}
.calc-mod-btn.primary.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

/* Dual valuation slots */
.calc-slot-label {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  margin-bottom: 4px;
  margin-top: 6px;
}
.calc-slot-label.primary { color: var(--primary2); }

.calc-add-method-btn {
  width: 100%;
  margin: 20px 0 4px;
  padding: 10px;
  border: 1.5px dashed var(--border);
  border-radius: 8px;
  background: none;
  color: var(--primary2);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}
.calc-add-method-btn:active { background: #f0f6ff; }

/* Primary slot — light navy blue when paired with secondary */
.calc-primary-slot { }
.calc-primary-slot.has-secondary {
  background: #eef4fb;
  border-radius: 10px;
  padding: 14px;
  margin: 0 -14px;
  border: 1.5px solid #c7daf0;
}
.calc-primary-slot.has-secondary .calc-section-title {
  background: #dbeafe;
  border-left-color: var(--primary2);
}

/* Secondary slot wrapper — light purple tint */
.calc-secondary-slot {
  background: #f3f0ff;
  border-radius: 10px;
  padding: 14px;
  margin: 0 -14px;
  border: 1.5px solid #d4c8f8;
}
.calc-secondary-slot .calc-section-title {
  background: #ede9fe;
  border-left-color: #7c3aed;
}
.calc-secondary-slot .calc-result-value { color: #5b21b6; }
.calc-secondary-slot .calc-result-value.main { color: #6d28d9; }

.calc-slot-divider {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 32px -14px 16px;
  padding: 14px 16px;
  background: #7c3aed;
  border-top: 6px solid #f0f4f8;
  font-size: 13px;
  font-weight: 800;
  color: white;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}
.calc-rm-slot-btn {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 5px;
  color: white;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  padding: 2px 6px;
  font-family: inherit;
}

.calc-report-selector {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 16px 0 4px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}
.calc-report-btn {
  padding: 6px 14px;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  background: white;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}
.calc-report-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

/* Section titles — full-width coloured band bleeding to card edges */
.calc-section-title {
  display: block;
  background: #EFF6FF;
  border-left: 4px solid var(--primary);
  padding: 7px 12px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--primary);
  margin: 20px -14px 14px;
  border-radius: 0;
}
.calc-section-title:first-child { margin-top: -2px; }

/* Two-column field grid */
.calc-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* Individual field */
.calc-field { margin-bottom: 10px; }
.calc-field label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 4px;
}

/* Inputs */
.calc-input {
  width: 100%;
  padding: 8px 10px;
  border: 1.5px solid var(--border);
  border-radius: 7px;
  font-size: 14px;
  color: var(--text);
  background: white;
  font-family: inherit;
  -webkit-appearance: none;
  transition: border-color 0.2s;
}
.calc-input:focus { outline: none; border-color: var(--primary2); box-shadow: 0 0 0 3px rgba(37,99,168,0.1); }
.calc-input.label-inp { font-size: 12px; }

/* Row tables (area components, added items) */
.calc-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 4px;
}
.calc-table th {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--muted);
  padding: 4px 4px 6px;
  text-align: left;
  border-bottom: 1.5px solid var(--border);
}
.calc-table td {
  padding: 3px 2px;
  vertical-align: middle;
}
.calc-table .calc-input {
  padding: 6px 7px;
  font-size: 13px;
}
.calc-computed {
  font-size: 11px;
  color: var(--muted);
  text-align: right;
  white-space: nowrap;
  padding-right: 2px;
}

/* Add row button */
.btn-calc-add {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 7px;
  border: 1.5px dashed var(--border);
  border-radius: 7px;
  background: none;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 6px;
  font-family: inherit;
  transition: background 0.15s;
}
.btn-calc-add:hover { background: var(--bg); color: var(--text); }

/* Remove row button */
.btn-calc-rm {
  width: 24px; height: 24px;
  border: none;
  background: #fee2e2;
  color: var(--red);
  border-radius: 50%;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}

/* Mod10 — GDR hint banner */
.calc-gdr-hint {
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 7px;
  padding: 7px 10px;
  margin: 4px 0 10px;
  text-align: center;
}

/* Mod10 — cost rows table (label | type | value | computed | ×) */
.calc-cost-table { width: 100%; border-collapse: collapse; margin-bottom: 4px; }
.calc-cost-table th {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--muted);
  padding: 4px 3px 6px;
  text-align: left;
  border-bottom: 1.5px solid var(--border);
}
.calc-cost-table td { padding: 3px 2px; vertical-align: middle; }
.calc-cost-table .calc-input { padding: 5px 6px; font-size: 12px; }
.calc-cost-type {
  width: 100%;
  padding: 5px 4px;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  font-size: 10px;
  font-weight: 600;
  color: var(--text);
  background: white;
  font-family: inherit;
  -webkit-appearance: none;
}
.calc-cost-amount {
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
  text-align: right;
  white-space: nowrap;
  min-width: 80px;
}
.calc-subtotal-row td {
  font-size: 11px;
  font-weight: 800;
  color: var(--text);
  border-top: 1.5px solid var(--border);
  padding-top: 6px;
}
.calc-subtotal-row .calc-cost-amount { color: var(--red); }

/* Results block */
.calc-results-block {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 2px solid var(--border);
}
.calc-result-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--bg);
}
.calc-result-row:last-child { border-bottom: none; }
.calc-result-label { font-size: 12px; color: var(--muted); flex: 1; }
.calc-result-value { font-size: 13px; font-weight: 700; color: var(--primary); text-align: right; white-space: nowrap; margin-left: 8px; }
.calc-result-value.main { font-size: 17px; color: #16a34a; }
.calc-result-value.sub  { font-size: 12px; color: var(--amber); }
.calc-result-value.neg  { color: var(--red); }
.calc-result-sep { border: none; border-top: 1px solid var(--border); margin: 4px 0; }
.calc-purpose-badge {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px;
  padding: 4px 8px; border-radius: 5px; margin-bottom: 8px; display: inline-block;
}
.calc-purpose-badge.secured { background: #eff6ff; color: var(--primary2); }
.calc-purpose-badge.standard { background: #f0fdf4; color: #16a34a; }
.calc-land-hint {
  font-size: 11px;
  color: var(--muted);
  font-style: italic;
  margin: -6px 0 8px;
}

/* Currency conversion bar */
.calc-ccy-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
}
.calc-ccy-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  white-space: nowrap;
}
.calc-ccy-select {
  padding: 5px 8px;
  border: 1.5px solid var(--border);
  border-radius: 7px;
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  background: white;
  font-family: inherit;
  -webkit-appearance: none;
  cursor: pointer;
}
.calc-ccy-rate-row {
  margin-top: 8px;
  padding: 10px 12px;
  background: #f0f4ff;
  border-radius: 8px;
  border: 1px solid #bfdbfe;
}
.calc-ccy-rate-inputs {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--text);
  margin-bottom: 8px;
}
.calc-ccy-inp {
  width: 100px !important;
  padding: 5px 8px !important;
  font-size: 13px !important;
}
.calc-ccy-live-btn {
  padding: 5px 10px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}
.calc-ccy-live-btn:disabled { opacity: 0.6; }
.calc-ccy-result {
  font-size: 16px;
  font-weight: 800;
  color: #16a34a;
  text-align: center;
}

/* ══ TABLET LAYOUT — Option A (≥768px) ═══ */
@media (min-width: 768px) {

  /* Tablet: keep grid, widen sidebar to show labels */
  #screen-inspect.active {
    grid-template-columns: 1fr 90px;
    height: 100vh;
    height: 100dvh;
  }
  #screen-inspect > .tab-bar {
    width: 90px;
    padding: 12px 0;
    justify-content: space-around;
  }
  #screen-inspect > .tab-bar .tab-item {
    padding: 8px 4px;
  }
  #screen-inspect > .tab-bar .tab-label { display: block; }

  /* Tab panels: keep as scroll container for grid layout */
  .tab-panels {
    flex: 1;
    min-height: 0;
    position: relative;
    overflow: hidden;
  }

  /* Each panel: absolute fill, scrolls internally, 2-column card layout */
  .tab-panel {
    position: absolute;
    inset: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 16px 20px 28px;
    display: none;
  }
  .tab-panel.active {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    align-content: start;
    align-items: start;
  }

  /* Cards that span full width */
  .card-full,
  .btn-next-tab,
  .btn-skip-to-review {
    grid-column: span 2;
  }

  /* Gap handles spacing, remove margin-bottom */
  .tab-panel .card,
  .tab-panel .photo-zone,
  .tab-panel .auto-row,
  .tab-panel .btn-next-tab,
  .tab-panel .btn-skip-to-review {
    margin-bottom: 0;
  }

  /* Construction & room desc: 3-col inner grid */
  .construction-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 14px;
  }

  /* Evidence panel: use block so .ev-layout's own grid takes full width */
  #panel-evidence.active {
    display: block;
  }

  /* Building panel: single-column grid to avoid Safari CSS-columns overlap bugs */
  #panel-building.active {
    display: grid;
    grid-template-columns: 1fr;
  }
  #panel-building .card,
  #panel-building .btn-next-tab,
  #panel-building .btn-skip-to-review,
  #panel-building .card-full {
    grid-column: span 1;
    margin-bottom: 0;
  }

  /* Max width centered */
  #screen-inspect { max-width: 1100px; margin: 0 auto; }
}

/* ══ PHOTO SYSTEM ═════════════════════════════════════════════════════════ */

/* ── Floating camera button ──────────────────────────────────────────────── */
.btn-camera-top {
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: 20px;
  color: white;
  font-size: 20px;
  padding: 5px 12px;
  cursor: pointer;
  line-height: 1;
  flex-shrink: 0;
  transition: background 0.15s;
}
.btn-camera-top:hover { background: rgba(255,255,255,0.28); }

/* ── Photos tab panel ────────────────────────────────────────────────────── */
.photos-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--border);
  background: var(--card);
  position: sticky;
  top: 0;
  z-index: 10;
}
.photos-header-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--primary);
}
.photos-count {
  font-size: 12px;
  color: var(--muted);
  background: var(--bg);
  padding: 3px 10px;
  border-radius: 20px;
}

/* ── Empty state ─────────────────────────────────────────────────────────── */
.photos-empty {
  text-align: center;
  padding: 60px 24px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
}
.photos-empty-icon { font-size: 48px; margin-bottom: 12px; }
.photos-empty-sub  { font-size: 13px; margin-top: 6px; color: #9ca3af; }

/* ── Section groups ──────────────────────────────────────────────────────── */
.photo-section-group { padding: 0 12px 8px; }
.photo-section-hdr {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  padding: 14px 4px 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.photo-section-count {
  background: var(--primary);
  color: white;
  border-radius: 20px;
  font-size: 10px;
  padding: 1px 7px;
  font-weight: 700;
}

/* ── Photo grid (2 columns) ──────────────────────────────────────────────── */
.photo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
@media (min-width: 600px) {
  .photo-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ── Photo card ──────────────────────────────────────────────────────────── */
.photo-card {
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  display: flex;
  flex-direction: column;
}
.photo-thumb-wrap {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  cursor: pointer;
  background: #e5e7eb;
}
.photo-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.15s;
}
.photo-thumb:active { opacity: 0.8; }
.photo-cover-badge,
.photo-cloud-badge {
  position: absolute;
  top: 6px;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
}
.photo-cover-badge { left: 6px;  background: var(--accent); color: #1e2a3a; }
.photo-cloud-badge { right: 6px; background: rgba(0,0,0,0.45); color: white; }

/* ── Photo card action row ───────────────────────────────────────────────── */
.photo-card-row {
  display: flex;
  gap: 4px;
  padding: 6px 6px 0;
}
.photo-action {
  flex: 1;
  padding: 5px 2px;
  font-size: 14px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--muted);
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.photo-action:active { transform: scale(0.95); }
.photo-action.on,
.cover-btn.on { background: var(--primary); color: white; border-color: var(--primary); }
.pdf-btn.on   { background: #0369a1;        color: white; border-color: #0369a1; }
.del-btn      { color: var(--red); border-color: #fecaca; }
.del-btn:active { background: var(--red); color: white; }

/* ── Caption input ───────────────────────────────────────────────────────── */
.photo-caption {
  border: none;
  border-top: 1px solid var(--border);
  padding: 6px 8px;
  font-size: 12px;
  color: var(--text);
  background: transparent;
  width: 100%;
  margin-top: 4px;
}
.photo-caption:focus { outline: none; background: #f0f7ff; }

/* ── Lightbox ────────────────────────────────────────────────────────────── */
.photo-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.88);
  z-index: 999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.lightbox-inner {
  position: relative;
  max-width: 92vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.lightbox-img {
  max-width: 100%;
  max-height: 80vh;
  border-radius: 8px;
  object-fit: contain;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
.lightbox-caption {
  color: #e5e7eb;
  font-size: 13px;
  text-align: center;
}
.lightbox-close {
  position: absolute;
  top: -14px;
  right: -14px;
  background: white;
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* ── ZIP button (Review sidebar) ─────────────────────────────────────────── */
.btn-zip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  background: #1e3a5f;
  color: white;
  border: none;
  border-radius: 10px;
  padding: 10px 6px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  transition: background 0.15s;
  min-width: 48px;
}
.btn-zip:active { background: #142940; }
.btn-zip .btn-icon { font-size: 20px; }

/* ── PDF photo pages ─────────────────────────────────────────────────────── */
.pdf-photo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 8px;
}
.pdf-photo-cell {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.pdf-photo-img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 4px;
  border: 0.5px solid #dde4ed;
  display: block;
}
.pdf-photo-cap {
  font-size: 7pt;
  color: #555;
  text-align: center;
  font-style: italic;
  padding: 0 2px;
}

/* ── Tab badge (photo count) ─────────────────────────────────────────────── */
#tab-photos .tab-icon {
  font-size: 15px;
  white-space: nowrap;
  letter-spacing: -0.5px;
}

/* ── EVIDENCE PICKER ─────────────────────────────────────────────────────── */

/* Two-column layout: filters left, results right */
/* NOTE: do NOT set display on #panel-evidence — .tab-panel{display:none} must win */
.ev-layout        { display: grid;
                    grid-template-columns: 300px 1fr;  /* default: 2 columns */
                    gap: 14px;
                    align-items: start; }

/* Collapse to single column only on very small screens */
@media (max-width: 540px) {
  .ev-layout { grid-template-columns: 1fr; }
}

/* Grid column containment — prevent children from overflowing into the other column */
.ev-left          { min-width: 0; overflow: hidden; }
.ev-right         { min-width: 0; }

/* Filters panel */
.ev-filters       { padding: 14px; }
.ev-filter-row    { margin-bottom: 12px; }
.ev-filter-label  { font-size: 11px; font-weight: 700; text-transform: uppercase;
                    letter-spacing: 0.5px; color: var(--muted); margin-bottom: 6px; }

/* Tenure toggle */
.ev-tenure-row    { display: flex; gap: 6px; }
.ev-tenure-btn    { flex: 1; padding: 8px 4px; border: 1.5px solid var(--border);
                    border-radius: 8px; background: #fff; color: var(--text);
                    font-size: 13px; font-family: inherit; cursor: pointer;
                    transition: background 0.15s, border-color 0.15s, color 0.15s; }
.ev-tenure-btn:hover    { border-color: var(--primary); color: var(--primary); }
.ev-tenure-active       { background: var(--primary); border-color: var(--primary);
                          color: #fff !important; font-weight: 600; }

/* Suburb tags */
.ev-suburb-tags   { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.ev-tag           { display: inline-flex; align-items: center; gap: 4px;
                    background: var(--primary); color: white;
                    border-radius: 20px; padding: 4px 10px; font-size: 12px; font-weight: 600; }
.ev-tag-remove    { background: none; border: none; color: white; cursor: pointer;
                    font-size: 11px; padding: 0; line-height: 1; opacity: 0.8; }
.ev-tag-remove:hover { opacity: 1; }

/* Suburb input + autocomplete */
.ev-suburb-input-wrap { position: relative; }
.ev-suburb-input  { width: 100%; padding: 8px 12px; border: 1.5px solid var(--border);
                    border-radius: 8px; font-size: 14px; font-family: inherit;
                    box-sizing: border-box; }
.ev-suburb-input:focus { outline: none; border-color: var(--primary2); }
.ev-autocomplete  { display: none; position: absolute; top: 100%; left: 0; right: 0;
                    background: white; border: 1.5px solid var(--border);
                    border-radius: 8px; box-shadow: 0 4px 16px rgba(0,0,0,0.12);
                    z-index: 100; max-height: 200px; overflow-y: auto; }
.ev-ac-item       { display: block; width: 100%; text-align: left;
                    background: none; border: none; border-radius: 0;
                    border-bottom: 1px solid var(--border);
                    padding: 10px 14px; font-size: 13px; font-family: inherit;
                    color: var(--text); cursor: pointer; }
.ev-ac-item:last-child  { border-bottom: none; }
.ev-ac-item:active      { background: #EBF3FB; color: var(--primary); }

/* Property type multi-select dropdown */
.ev-ms-wrap       { position: relative; }
.ev-ms-trigger    { width: 100%; padding: 8px 12px; border: 1.5px solid var(--border);
                    border-radius: 8px; font-size: 14px; font-family: inherit;
                    background: white; cursor: pointer; box-sizing: border-box;
                    display: flex; justify-content: space-between; align-items: center;
                    text-align: left; color: var(--text); }
.ev-ms-trigger:hover,
.ev-ms-open       { border-color: var(--primary2) !important; }
.ev-ms-arrow      { color: var(--muted); font-size: 11px; flex-shrink: 0; margin-left: 8px; }
.ev-ms-panel      { position: absolute; top: calc(100% + 4px); left: 0; right: 0;
                    background: white; border: 1.5px solid var(--border);
                    border-radius: 8px; box-shadow: 0 4px 20px rgba(0,0,0,0.14);
                    z-index: 200; max-height: 260px; overflow-y: auto; }
.ev-ms-item       { display: flex; width: 100%; text-align: left; align-items: center;
                    gap: 8px; background: none; border: none; border-radius: 0;
                    border-bottom: 1px solid var(--border);
                    padding: 10px 14px; font-size: 13px; font-family: inherit;
                    color: var(--text); cursor: pointer; user-select: none; }
.ev-ms-item:last-child  { border-bottom: none; }
.ev-ms-item:active      { background: #EBF3FB; }
.ev-ms-on               { background: #EBF3FB; }
.ev-ms-on span:last-child { color: var(--primary); font-weight: 600; }
.ev-ms-tick       { width: 16px; font-size: 12px; font-weight: 900;
                    color: var(--primary); flex-shrink: 0; text-align: center; }

/* Date + size inputs */
.ev-date-row      { display: flex; align-items: center; gap: 8px; }
.ev-date-input    { flex: 1; min-width: 0; padding: 8px 10px; border: 1.5px solid var(--border);
                    border-radius: 8px; font-size: 13px; font-family: inherit;
                    box-sizing: border-box; }
.ev-date-sep      { color: var(--muted); font-size: 14px; flex-shrink: 0; }
.ev-size-label    { font-size: 11px; color: var(--muted); margin-top: 4px; }

/* Search button */
.ev-search-btn    { width: 100%; padding: 12px; background: var(--primary);
                    color: white; border: none; border-radius: 10px;
                    font-size: 15px; font-weight: 700; cursor: pointer;
                    margin-top: 4px; font-family: inherit; }
.ev-search-btn:hover    { background: var(--primary2); }
.ev-search-btn:disabled { opacity: 0.6; cursor: wait; }

/* Section headers */
.ev-section-hdr   { font-size: 12px; font-weight: 800; text-transform: uppercase;
                    letter-spacing: 0.5px; color: var(--primary);
                    padding: 10px 14px 6px; border-bottom: 1.5px solid var(--border);
                    display: flex; align-items: center; gap: 8px; }
.ev-sel-badge     { background: var(--primary); color: white; border-radius: 12px;
                    padding: 2px 8px; font-size: 11px; }

/* Empty state */
.ev-empty         { text-align: center; color: var(--muted); font-size: 14px;
                    padding: 60px 20px; line-height: 1.7; }
.ev-reset-link    { display: inline-block; margin-top: 10px; padding: 6px 14px;
                    background: var(--primary); color: #fff; border: none;
                    border-radius: 6px; font-size: 13px; font-family: inherit;
                    cursor: pointer; }
.ev-reset-link:hover { background: var(--primary2); }

/* Results column */
.ev-results-hdr   { font-size: 12px; font-weight: 800; text-transform: uppercase;
                    letter-spacing: 0.5px; color: var(--primary);
                    padding: 10px 4px 8px; border-bottom: 1.5px solid var(--border);
                    margin-bottom: 8px; }
.ev-results-list  { display: flex; flex-direction: column; gap: 10px; }

/* ── Rich result cards ── */
.ev-result-card   { border: 1.5px solid var(--border); border-radius: 12px;
                    background: white; overflow: hidden;
                    transition: border-color 0.15s, box-shadow 0.15s; }
.ev-result-card:hover    { border-color: var(--primary2);
                           box-shadow: 0 2px 12px rgba(26,60,94,0.10); }
.ev-result-selected      { border-color: var(--primary) !important;
                           box-shadow: 0 0 0 3px rgba(26,60,94,0.12) !important; }

/* Card click area (excludes expand button) */
.ev-card-body     { padding: 12px 14px 10px; cursor: pointer; }
.ev-result-selected .ev-card-body { background: #EBF3FB; }

/* Header row */
.ev-card-head     { display: flex; align-items: center; gap: 8px;
                    margin-bottom: 6px; flex-wrap: wrap; }
.ev-card-suburb   { font-weight: 800; font-size: 15px; color: var(--primary);
                    flex: 1; min-width: 0; white-space: nowrap;
                    overflow: hidden; text-overflow: ellipsis; }
.ev-card-date     { font-size: 12px; color: var(--muted); flex-shrink: 0; }
.ev-card-check    { color: var(--primary); font-weight: 900; font-size: 18px;
                    flex-shrink: 0; }

/* Type + complex row */
.ev-card-meta     { display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
                    margin-bottom: 10px; }
.ev-card-type-pill { font-size: 11px; font-weight: 700; padding: 2px 8px;
                     border-radius: 20px; background: #EBF3FB; color: var(--primary);
                     white-space: nowrap; }
.ev-card-complex  { font-size: 12px; color: var(--text); font-style: italic;
                    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Tenure badges */
.ev-tenure-tag    { display: inline-block; font-size: 10px; font-weight: 700;
                    padding: 2px 7px; border-radius: 20px; letter-spacing: 0.3px;
                    text-transform: uppercase; flex-shrink: 0; }
.ev-fh            { background: #e8f5e9; color: #2e7d32; }
.ev-lh            { background: #fff3e0; color: #e65100; }

/* Metrics grid */
.ev-card-metrics  { display: grid; grid-template-columns: repeat(3,1fr);
                    gap: 6px; margin-bottom: 0; }
.ev-metric        { background: #f7f9fc; border-radius: 8px; padding: 7px 10px;
                    display: flex; flex-direction: column; gap: 2px; }
.ev-metric-label  { font-size: 10px; font-weight: 700; text-transform: uppercase;
                    letter-spacing: 0.3px; color: var(--muted); }
.ev-metric-value  { font-size: 14px; font-weight: 800; color: #1a3c5e; line-height: 1.2; }
.ev-metric-value.ev-rate { color: #0a6b35; font-size: 15px; }  /* highlighted rate */
.ev-metric-sub    { font-size: 10px; color: var(--muted); }

/* Expand / details button */
.ev-card-foot     { border-top: 1px solid var(--border); background: #fafbfc; }
.ev-expand-btn    { width: 100%; padding: 7px 14px; background: none; border: none;
                    font-size: 12px; color: var(--muted); cursor: pointer;
                    text-align: left; font-family: inherit;
                    display: flex; align-items: center; gap: 6px; }
.ev-expand-btn:hover  { color: var(--primary); background: #f0f4f8; }
.ev-expand-open   { color: var(--primary) !important; }

/* Full details panel */
.ev-card-detail   { padding: 12px 14px; border-top: 1px solid var(--border);
                    background: #fafbfc; display: none; }
.ev-detail-grid   { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 16px;
                    margin-bottom: 10px; }
.ev-detail-row    { display: flex; flex-direction: column; padding: 4px 0;
                    border-bottom: 1px solid #eee; }
.ev-detail-row:last-child { border-bottom: none; }
.ev-detail-lbl    { font-size: 10px; font-weight: 700; text-transform: uppercase;
                    letter-spacing: 0.3px; color: var(--muted); }
.ev-detail-val    { font-size: 13px; color: var(--text); font-weight: 500; }
.ev-detail-notes  { margin-top: 8px; padding: 10px; background: #fff8e1;
                    border-left: 3px solid #f9a825; border-radius: 4px;
                    font-size: 13px; color: #555; white-space: pre-wrap; line-height: 1.5; }

/* Selected comparables */
.ev-selected-wrap { margin-bottom: 12px; background: white;
                    border: 1.5px solid var(--primary); border-radius: 10px;
                    overflow: hidden; }
.ev-selected-list { padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; }
.ev-sel-card      { display: flex; align-items: center; gap: 10px;
                    padding: 8px 10px; background: #EBF3FB; border-radius: 8px; }
.ev-sel-num       { width: 24px; height: 24px; background: var(--primary); color: white;
                    border-radius: 50%; font-size: 12px; font-weight: 800;
                    display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ev-sel-info      { flex: 1; min-width: 0; }
.ev-sel-addr      { font-weight: 700; font-size: 13px; color: var(--primary);
                    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev-sel-detail    { font-size: 12px; color: var(--muted); }
.ev-sel-remove    { background: none; border: none; color: var(--muted); cursor: pointer;
                    font-size: 16px; padding: 0 4px; flex-shrink: 0; }
.ev-sel-remove:hover { color: #c00; }



/* ══════════════════════════════════════════════
   LOGIN SCREEN
   ══════════════════════════════════════════════ */

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, #1e3a5f 0%, #2c5282 60%, #1a3350 100%);
  padding: 24px 16px;
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: white;
  border-radius: 20px;
  padding: 40px 32px 32px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.35);
  text-align: center;
}

.login-logo {
  margin-bottom: 12px;
}

.login-logo img {
  border-radius: 16px;
  box-shadow: 0 4px 16px rgba(30,58,95,0.25);
}

.login-brand {
  font-size: 28px;
  font-weight: 800;
  color: #1e3a5f;
  letter-spacing: -0.5px;
}

.login-subtitle {
  font-size: 13px;
  color: #8a99aa;
  margin-bottom: 28px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.login-field {
  text-align: left;
  margin-bottom: 16px;
}

.login-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #4a5568;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.login-input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid #d1dbe8;
  border-radius: 10px;
  font-size: 16px;
  color: #1e3a5f;
  background: #f7fafc;
  box-sizing: border-box;
  transition: border-color 0.15s;
  outline: none;
}

.login-input:focus {
  border-color: #1e3a5f;
  background: white;
}

.login-error {
  min-height: 20px;
  font-size: 13px;
  color: #c0392b;
  margin-bottom: 12px;
  text-align: left;
}

.login-btn {
  width: 100%;
  padding: 14px;
  background: #1e3a5f;
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  margin-bottom: 20px;
}

.login-btn:hover  { background: #2c5282; }
.login-btn:active { transform: scale(0.98); }
.login-btn:disabled { background: #8a99aa; cursor: not-allowed; }

.login-footer {
  font-size: 11px;
  color: #b0bec5;
  letter-spacing: 0.5px;
}

/* ── Auth user badge in Settings ─────────────── */

.auth-user-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #eef4fb;
  border: 1.5px solid #c8ddf0;
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 20px;
}

.auth-user-email {
  font-size: 14px;
  font-weight: 600;
  color: #1e3a5f;
}

.auth-user-role {
  font-size: 12px;
  color: #4a90a4;
  margin-top: 2px;
}

.auth-signout-btn {
  background: none;
  border: 1.5px solid #c8ddf0;
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 13px;
  color: #1e3a5f;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}

.auth-signout-btn:hover { background: #d6e8f5; }
