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

/* ── Report fonts (bundled locally so PDFs look identical on every device,
   online or offline): Inter for body, Montserrat for headlines. ── */
@font-face { font-family:'Inter'; font-style:normal; font-weight:400; font-display:swap; src:url('fonts/inter-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family:'Inter'; font-style:normal; font-weight:600; font-display:swap; src:url('fonts/inter-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family:'Inter'; font-style:normal; font-weight:700; font-display:swap; src:url('fonts/inter-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family:'Montserrat'; font-style:normal; font-weight:600; font-display:swap; src:url('fonts/montserrat-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family:'Montserrat'; font-style:normal; font-weight:700; font-display:swap; src:url('fonts/montserrat-latin-700-normal.woff2') format('woff2'); }

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

:root {
  --primary:  #1a3c5e;
  --primary2: #2563a8;
  --sel:      #234c74;   /* selected chips / top bar — the navy, a little lighter (v363) */
  --sel-text: #d6e1f6;   /* pale text on --sel */
  --accent:   #e8a838;
  --green:    #22c55e;
  --red:      #ef4444;
  --amber:    #f59e0b;
  --bg:       #cfdbe7;
  --card:     #ffffff;
  --cardface: #eef3f8;   /* card surface — faint grey so cards are not stark white */
  --text:     #1e2a3a;
  --muted:    #6b7280;
  --border:   #dde4ed;
  --radius:   12px;
  /* Subtle property-themed doodle background (self-contained SVG tile) */
  --doodle: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='340' height='340'%3E%3Cg fill='none' stroke='%231a3c5e' stroke-opacity='.12' stroke-width='1.3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath transform='translate(28 26) rotate(-8)' d='M-7 6 0 0 7 6 M-5 5 v8 h10 v-8'/%3E%3Cg transform='translate(96 40) rotate(14)'%3E%3Ccircle cx='0' cy='0' r='2.6'/%3E%3Cpath d='M2.6 0 h9 M8 0 v3 M11.6 0 v2.2'/%3E%3C/g%3E%3Cg transform='translate(170 24) rotate(-5)'%3E%3Cpath d='M0 -6 c-3.2 0 -5.4 2.4 -5.4 5.2 0 4.2 5.4 9 5.4 9 s5.4 -4.8 5.4 -9 C5.4 -3.6 3.2 -6 0 -6 z'/%3E%3Ccircle cx='0' cy='-0.8' r='1.7'/%3E%3C/g%3E%3Cg transform='translate(248 38) rotate(9)'%3E%3Crect x='-8' y='-2.5' width='16' height='5' rx='1'/%3E%3Cpath d='M-4 -2.5 v2 M0 -2.5 v3 M4 -2.5 v2'/%3E%3C/g%3E%3Cg transform='translate(310 78) rotate(-12)'%3E%3Crect x='-7' y='-5.5' width='14' height='11'/%3E%3Cpath d='M-7 0 h6 M-1 0 v5.5 M3 5.5 a4 4 0 0 1 4 -4'/%3E%3C/g%3E%3Cg transform='translate(40 96) rotate(6)'%3E%3Crect x='-5' y='-7' width='10' height='14' rx='1'/%3E%3Crect x='-2' y='-8' width='4' height='2' rx='0.5'/%3E%3Cpath d='M-3 -3 h6 M-3 0 h6 M-3 3 h4'/%3E%3C/g%3E%3Cg transform='translate(120 108) rotate(-10)'%3E%3Cpath d='M0 12 v-5'/%3E%3Ccircle cx='0' cy='2' r='5'/%3E%3C/g%3E%3Cg transform='translate(196 92)'%3E%3Ccircle cx='-2' cy='-2' r='4.2'/%3E%3Cpath d='M1 1 l5 5'/%3E%3C/g%3E%3Cg transform='translate(268 112) rotate(18)'%3E%3Cpath d='M-7 7 l1 -4 9 -9 3 3 -9 9 -4 1 z M2 -5 l3 3'/%3E%3C/g%3E%3Cg transform='translate(326 160) rotate(-6)'%3E%3Cpath d='M0 -5 v-2 M0 -5 l-4 11 M0 -5 l4 11'/%3E%3Ccircle cx='0' cy='-6' r='1.2'/%3E%3C/g%3E%3Cg transform='translate(28 168) rotate(-14)'%3E%3Crect x='-5' y='-5' width='10' height='10'/%3E%3Cpath d='M0 -5 v10 M-5 0 h10'/%3E%3C/g%3E%3Cg transform='translate(104 178) rotate(8)'%3E%3Cpath d='M-6 6 h4 v-4 h4 v-4 h4'/%3E%3C/g%3E%3Cg transform='translate(180 168) rotate(-4)'%3E%3Ccircle cx='0' cy='0' r='4.5'/%3E%3Ccircle cx='0' cy='0' r='1.2'/%3E%3Cpath d='M4.5 0 h4 v2.6'/%3E%3C/g%3E%3Cg transform='translate(256 180) rotate(5)'%3E%3Crect x='-4' y='-6.5' width='8' height='13' rx='0.5'/%3E%3Ccircle cx='2' cy='0.5' r='0.7'/%3E%3C/g%3E%3Cg transform='translate(60 238) rotate(10)'%3E%3Cpath d='M-8 5 0 -1 8 5'/%3E%3C/g%3E%3Cg transform='translate(140 246) rotate(-7)'%3E%3Cpath d='M-7 6 0 0 7 6 M-5 5 v7 h10 v-7 M-1 12 v-4 h2 v4'/%3E%3C/g%3E%3Cg transform='translate(216 240) rotate(12)'%3E%3Ccircle cx='0' cy='0' r='2.6'/%3E%3Cpath d='M2.6 0 h8 M7 0 v2.6 M10.6 0 v2'/%3E%3C/g%3E%3Cg transform='translate(292 250) rotate(-9)'%3E%3Crect x='-7' y='-5' width='14' height='10'/%3E%3Cpath d='M-7 -1 h5 M-2 -1 v6 M2 5 a3.5 3.5 0 0 1 3.5 -3.5'/%3E%3C/g%3E%3Cg transform='translate(36 306) rotate(4)'%3E%3Ccircle cx='-2' cy='-2' r='4'/%3E%3Cpath d='M1 1 l4.5 4.5'/%3E%3C/g%3E%3Cg transform='translate(112 312) rotate(-11)'%3E%3Cpath d='M0 -6 c-3 0 -5 2.2 -5 4.8 0 3.8 5 8.2 5 8.2 s5 -4.4 5 -8.2 C5 -3.8 3 -6 0 -6 z'/%3E%3Ccircle cx='0' cy='-1' r='1.5'/%3E%3C/g%3E%3Cg transform='translate(188 306) rotate(7)'%3E%3Cpath d='M0 11 v-4'/%3E%3Ccircle cx='0' cy='2.5' r='4.4'/%3E%3C/g%3E%3Cg transform='translate(258 312) rotate(-5)'%3E%3Crect x='-7.5' y='-2.4' width='15' height='4.8' rx='1'/%3E%3Cpath d='M-3.5 -2.4 v1.9 M0 -2.4 v2.8 M3.5 -2.4 v1.9'/%3E%3C/g%3E%3Cg transform='translate(318 300) rotate(15)'%3E%3Crect x='-4.5' y='-4.5' width='9' height='9'/%3E%3Cpath d='M0 -4.5 v9 M-4.5 0 h9'/%3E%3C/g%3E%3Cpath transform='translate(66 62)' d='M0 -2.4 v4.8 M-2.4 0 h4.8'/%3E%3Ccircle cx='150' cy='64' r='1.1'/%3E%3Cpath transform='translate(228 68) rotate(20)' d='M0 -2 v4 M-2 0 h4'/%3E%3Ccircle cx='72' cy='140' r='1.1'/%3E%3Cpath transform='translate(232 140) rotate(-15)' d='M0 -2.2 v4.4 M-2.2 0 h4.4'/%3E%3Ccircle cx='310' cy='214' r='1.1'/%3E%3Cpath transform='translate(20 274) rotate(12)' d='M0 -2 v4 M-2 0 h4'/%3E%3Ccircle cx='176 ' cy='218' r='1.1'/%3E%3Cpath transform='translate(96 272) rotate(-18)' d='M0 -2.2 v4.4 M-2.2 0 h4.4'/%3E%3Ccircle cx='246' cy='282' r='1.1'/%3E%3Ccircle cx='330' cy='26' r='1.1'/%3E%3Cg transform='translate(38 66) rotate(-6)'%3E%3Cpath d='M-4 6 v-9 h8 v6 h-8'/%3E%3Cpath d='M-4 -3 h8'/%3E%3C/g%3E%3Cg transform='translate(112 72) rotate(9)'%3E%3Crect x='-6' y='-4' width='12' height='8'/%3E%3Cpath d='M-6 0 h12 M0 -4 v4 M-3 0 v4 M3 0 v4'/%3E%3C/g%3E%3Cg transform='translate(192 66) rotate(-11)'%3E%3Cpath d='M-7 4 0 -2 7 4'/%3E%3C/g%3E%3Cg transform='translate(266 72) rotate(16)'%3E%3Ccircle cx='0' cy='0' r='2.2'/%3E%3Cpath d='M2.2 0 h7 M6 0 v2.2 M9.2 0 v1.8'/%3E%3C/g%3E%3Cg transform='translate(152 140) rotate(6)'%3E%3Cpath d='M-6 5 0 0 6 5 M-4 4 v6 h8 v-6'/%3E%3C/g%3E%3Cg transform='translate(206 134) rotate(-8)'%3E%3Crect x='-3.5' y='-5.5' width='7' height='11' rx='0.5'/%3E%3Ccircle cx='1.7' cy='0.4' r='0.6'/%3E%3C/g%3E%3Cg transform='translate(298 140) rotate(10)'%3E%3Cpath d='M0 -5 c-2.6 0 -4.4 2 -4.4 4.3 0 3.4 4.4 7.2 4.4 7.2 s4.4 -3.8 4.4 -7.2 C4.4 -3 2.6 -5 0 -5 z'/%3E%3Ccircle cx='0' cy='-0.7' r='1.3'/%3E%3C/g%3E%3Cg transform='translate(64 210) rotate(-9)'%3E%3Ccircle cx='0' cy='0' r='3.8'/%3E%3Ccircle cx='0' cy='0' r='1'/%3E%3Cpath d='M3.8 0 h3.4 v2.2'/%3E%3C/g%3E%3Cg transform='translate(142 216) rotate(14)'%3E%3Cpath d='M-6 6 l0.8 -3.4 7.6 -7.6 2.6 2.6 -7.6 7.6 -3.4 0.8 z'/%3E%3C/g%3E%3Cg transform='translate(224 210) rotate(-13)'%3E%3Cpath d='M-6 4 0 -1 6 4'/%3E%3C/g%3E%3Cg transform='translate(62 278) rotate(12)'%3E%3Crect x='-4' y='-4' width='8' height='8'/%3E%3Cpath d='M0 -4 v8 M-4 0 h8'/%3E%3C/g%3E%3Cg transform='translate(152 282) rotate(-6)'%3E%3Ccircle cx='-1.6' cy='-1.6' r='3.4'/%3E%3Cpath d='M0.8 0.8 l3.8 3.8'/%3E%3C/g%3E%3Cg transform='translate(226 278) rotate(8)'%3E%3Crect x='-6.5' y='-2.1' width='13' height='4.2' rx='0.9'/%3E%3Cpath d='M-3 -2.1 v1.7 M0 -2.1 v2.4 M3 -2.1 v1.7'/%3E%3C/g%3E%3Cg transform='translate(308 280) rotate(-10)'%3E%3Cpath d='M0 10 v-4'/%3E%3Ccircle cx='0' cy='2' r='3.8'/%3E%3C/g%3E%3Cg transform='translate(255 143) rotate(-6) scale(0.75) translate(-12 -13)'%3E%3Cpath d='M1 21V10l5.5-5 5.5 5v11H1z'/%3E%3Cpath d='M12 21V10l5.5-5 5.5 5v11H12z'/%3E%3Cpath d='M7 21v-5h3v5'/%3E%3Cpath d='M17 21v-5h3v5'/%3E%3C/g%3E%3Cg transform='translate(328 196) rotate(8) scale(0.72) translate(-12 -14)'%3E%3Crect x='2' y='7' width='20' height='14' rx='2'/%3E%3Cpath d='M16 7V5a2 2 0 00-2-2h-4a2 2 0 00-2 2v2'/%3E%3Cpath d='M12 12v4M2 12h20'/%3E%3C/g%3E%3Cg transform='translate(22 138) rotate(-9) scale(0.7) translate(-12 -13)'%3E%3Cpath d='M23 19a2 2 0 01-2 2H3a2 2 0 01-2-2V8a2 2 0 012-2h4l2-3h6l2 3h4a2 2 0 012 2z'/%3E%3Ccircle cx='12' cy='13' r='4'/%3E%3C/g%3E%3Cg transform='translate(258 212) rotate(5)'%3E%3Cpath d='M0 10v-3 M-5 7 0 -8 5 7z M-3.5 1 h7'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

html { font-size: 16px; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  background-image: var(--doodle);
  background-size: 424px 424px;
  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 auto 1fr;
  grid-template-areas:
    "topbar tabbar"
    "banner tabbar"
    "panels tabbar";
  height: 100vh;
  height: 100dvh;
  min-height: unset;
  max-height: 100vh;
  overflow: hidden;
}
#screen-inspect > .top-bar       { grid-area: topbar; }
#screen-inspect > #viewOnlyBanner { grid-area: banner; }
#screen-inspect > .tab-panels    { grid-area: panels; }

/* ── PHOTO STRIP (wide screens only) ──────────────────────────────────────
   A view-only column of the site photos between the form and the sidebar, so
   the asset can be described without leaving the Building tab. Below 1280px
   the button and the strip do not exist; the layout is untouched. */
.btn-photo-strip { display: none; }
#screen-inspect > .photo-strip { display: none; }
@media (min-width: 1280px) {
  .btn-photo-strip {
    display: inline-flex; align-items: center; gap: 6px;
    background: rgba(255,255,255,0.14); border: 1px solid rgba(255,255,255,0.32);
    color: #fff; border-radius: 20px; padding: 6px 12px;
    font-family: inherit; font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap;
  }
  .btn-photo-strip.on { background: #fff; color: var(--sel); border-color: #fff; }
  #screen-inspect.active.strip-open {
    grid-template-columns: 1fr 300px 68px;
    grid-template-areas:
      "topbar strip tabbar"
      "banner strip tabbar"
      "panels strip tabbar";
  }
  #screen-inspect.active.strip-open > .photo-strip {
    display: flex; flex-direction: column; min-height: 0;
    grid-area: strip;
    background: var(--cardface);
    border-left: 1.5px solid var(--border);
  }
  .photo-strip-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 12px 8px; flex: none;
    font-size: 11px; font-weight: 700; letter-spacing: 0.4px; text-transform: uppercase; color: var(--muted);
    border-bottom: 1.5px solid var(--border);
  }
  .photo-strip-close { background: none; border: none; font-size: 15px; color: var(--muted); cursor: pointer; padding: 2px 6px; }
  .photo-strip-body { flex: 1; overflow-y: auto; padding: 10px 12px 24px; }
  .photo-strip-sec { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; color: var(--muted); margin: 10px 0 6px; }
  .photo-strip-sec:first-child { margin-top: 0; }
  .photo-strip-item { margin-bottom: 10px; cursor: zoom-in; }
  .photo-strip-item img { display: block; width: 100%; border-radius: 8px; background: #dde5ee; }
  .photo-strip-cap { font-size: 11px; color: var(--text); margin-top: 4px; line-height: 1.35; }
  .photo-strip-empty { font-size: 12px; color: var(--muted); padding: 10px 2px; line-height: 1.5; }
}
/* On a wide computer screen the app is capped at 1100px and centred, leaving
   empty space either side. From 1620px the strip lives in the spare space to
   the RIGHT of the sidebar and the form keeps its full width; below that it
   falls back to the in-grid column above. */
@media (min-width: 1620px) {
  #screen-inspect.active.strip-open {
    grid-template-columns: 1fr 68px;
    grid-template-areas:
      "topbar tabbar"
      "banner tabbar"
      "panels tabbar";
  }
  #screen-inspect.active.strip-open > .photo-strip {
    position: fixed; top: 0; bottom: 0; z-index: 40;
    left: calc(50% + 550px + 14px);
    width: min(400px, calc(50% - 550px - 28px));
    border: 1.5px solid var(--border); border-top: none; border-bottom: none;
    box-shadow: 0 0 18px rgba(15,23,42,0.08);
  }
}

/* ── VIEW-ONLY (locked by another editor) ─────────────────────────────── */
.view-only-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fef3c7;                    /* amber */
  color: #92400e;
  border-bottom: 1.5px solid #fcd34d;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
}
.view-only-banner svg { flex: none; }
/* Block all editing inside the panels; the bottom tab-bar (outside .tab-panels)
   stays active so the viewer can still browse every section. */
#screen-inspect.view-only > .tab-panels { pointer-events: none; }
#screen-inspect.view-only > .tab-panels input,
#screen-inspect.view-only > .tab-panels textarea,
#screen-inspect.view-only > .tab-panels select {
  background: #f1f2f4;
  color: #55585e;
}
/* Disable Save + camera buttons; Home (.btn-home-top) stays clickable. */
#screen-inspect.view-only .btn-camera-top { opacity: .35; pointer-events: none; }
/* Photos stay viewable in read-only: re-enable interaction on the Photos panel
   (so thumbnails can be tapped to enlarge). Edit controls are removed by
   PhotoSystem.setReadOnly() and writes are blocked in JS, so this is safe. */
#screen-inspect.view-only > .tab-panels #panel-photos { pointer-events: auto; }
#screen-inspect.view-only #panel-photos .btn-upload-photos { display: none; }
.photo-caption-ro {
  font-size: 12px;
  color: #55585e;
  padding: 4px 2px 2px;
  line-height: 1.25;
  word-break: break-word;
}
#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;
}
/* File inputs triggered by a button: keep them in the layout at opacity 0.
   Safari ignores .click() on some display:none file inputs (the landing Import
   button did nothing there), while an opacity-0 1px input always opens the picker. */
.file-input-hidden {
  position: absolute; top: 0; left: 0;
  width: 1px; height: 1px;
  opacity: 0; overflow: hidden;
  pointer-events: none;
}
#screen-inspect > .tab-bar .tab-label { display: none; }

/* ── SHARED TOP BAR ──────────────────────── */
.top-bar {
  background: var(--sel);
  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;
  display: inline-flex; align-items: center; gap: 5px;
}
.type-badge svg { stroke: white; flex-shrink: 0; }
.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(216px, 23.5vw, 296px); /* banner incl. the fade zone (24px less sky, v358) */
  overflow: hidden;
  color: white;
  /* B&W Mauritius panorama (bundled, offline-safe) replaces the cityscape.
     Crop sits lower in the picture (40%) → less sky above the mountains. */
  background: #1a3c5e url('img/landing-hero-bw.jpg') center 40% / cover no-repeat;
}
/* Navy tint over the photo — keeps the white brand + buttons legible */
.landing-header::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(160deg, rgba(26,60,94,0.72) 0%, rgba(37,99,168,0.40) 100%);
}
/* "Valoris" anchored bottom-left in the open sky */
.landing-brand {
  position: absolute;
  bottom: 128px;   /* rests on the body's top edge; the fade only starts 28px lower */
  left: 24px;
  z-index: 2;
  font-size: 42px;
  font-weight: 500;
  color: white;
  text-shadow: 0 1px 8px rgba(0,0,0,0.4);
}
.landing-skyline {
  display: none;   /* replaced by the B&W Mauritius photo banner */
}
.landing-sub {
  font-size: 13px;
  font-weight: 600;
  color: #fff;                                /* sits on the photo now */
  text-shadow: 0 1px 6px rgba(10,25,45,0.55);
  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;
}
.btn-import-json-sm {
  position: absolute;
  top: 22px; right: 70px;
  z-index: 3;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  color: white;
  font-family: inherit;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 88px;
  justify-content: center;
}

.landing-body {
  flex: 1;
  position: relative;
  z-index: 2;
  margin-top: -128px;              /* photo reaches mid-way down the first card row */
  background-color: transparent;
  /* doodle tile FIRST (topmost) so the doodled canvas shows across the whole
     lower page. The gradient beneath runs from "Select property type" (28px)
     to mid-first-card (128px) with eased stops — a long, even, seamless fade
     rather than a hard white band. */
  background-image: var(--doodle), linear-gradient(180deg,
    rgba(207,219,231,0)    28px,
    rgba(207,219,231,0.18) 55px,
    rgba(207,219,231,0.45) 80px,
    rgba(207,219,231,0.75) 104px,
    #cfdbe7                128px);
  background-size: 424px 424px, auto;
  border-radius: 0;
  padding: 30px 16px 40px;
}

/* ── Staff context button (header pill) ───── */
.btn-context-user {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 88px;
  padding: 5px 12px;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 20px;
  color: white;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  transition: background 0.15s;
}
.btn-context-user:active   { background: rgba(255,255,255,0.28); }
.btn-context-user.employee {
  background: rgba(217,119,6,0.55);
  border-color: rgba(255,200,80,0.6);
}

.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;
}
@media (min-width: 700px) { .type-grid { grid-template-columns: repeat(4, 1fr); } }   /* iPad / Mac: 4 per line (v403) */
.type-card {
  background: var(--cardface); 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; display:flex; align-items:center; justify-content:center; }
.type-card .t-icon svg { color: var(--primary); }
/* SVG icons inherit button/element colour */
.btn-icon svg, .btn-home-top svg, .btn-camera-top svg,
.btn-view-all svg, .btn-primary svg, .disc-tab-btn svg,
.ev-search-btn svg, .ev-adjust-btn svg, .ev-tenure-btn svg,
.btn-after-home svg, .btn-after-new svg, .btn-after-export svg, .btn-after-pdf svg,
.btn-next-tab svg, .save-success-icon svg, .photos-empty-icon svg,
.ph-icon svg, .photo-retake svg, .modal-title svg, .pdf-attach-title svg,
.btn-modal-send svg { stroke: currentColor; }
.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: var(--cardface); 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  { width: 26px; height: 26px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; color: #1F4E79; }
.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 .job-top-grid,
.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: var(--cardface);
  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; display:flex; align-items:center; justify-content:center; }
.tab-icon svg { stroke: currentColor; }
.tab-label {
  font-size: 8.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.3px;
  font-family: inherit;
}

/* ── COVER PHOTO ─────────────────────────── */
/* ── JOB TOP GRID (photo left, GPS+Date right) ── */
.job-top-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 10px;
  min-height: 180px;
}
.job-pair-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  align-items: start;
  margin-bottom: 12px;
}
.job-pair-grid > .card {
  margin-bottom: 0;
}
.job-info-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.job-info-col .auto-card,
.job-info-col .date-pair-row {
  flex: 1;
}
.date-pair-row {
  display: flex;
  gap: 8px;
}
.date-pair-row .auto-card {
  flex: 1;
  min-width: 0;
}

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

/* ── 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); }
.btn-gps-edit {
  margin-left: auto; flex-shrink: 0;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--bg); border: 1.5px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--muted);
  transition: background 0.15s, color 0.15s;
}
.btn-gps-edit:hover { background: var(--border); color: var(--primary); }
.btn-gps-edit svg   { stroke: currentColor; }
.gps-manual-input {
  margin-top: 4px; width: 100%;
  border: 1.5px solid var(--primary2); border-radius: 7px;
  padding: 5px 9px; font-size: 12px; color: var(--text);
  background: #fff; outline: none; font-family: inherit;
}
@keyframes pulse { 0%,100% { opacity:1; } 50% { opacity:0.4; } }

/* ── CARDS ───────────────────────────────── */
.card {
  background: var(--cardface);
  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; }
/* Accommodation card — put Additional Rooms beside Bedrooms/Bathrooms to use the
   side space on tablet/desktop; stacks to one column on a narrow phone. */
.acc-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 768px) {
  .acc-grid { grid-template-columns: 1fr 1fr; gap: 22px; align-items: start; }
}
label {
  display: block;
  font-size: 11px; font-weight: 700;
  color: var(--muted); margin-bottom: 6px;
  text-transform: uppercase; letter-spacing: 0.3px;
}
label.lbl-preferred { color: var(--amber); }
/* Label with a small action on the right (e.g. "Refill from sketch") */
.label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.sk-refill {
  display: inline-flex; align-items: center; gap: 4px;
  background: none; border: none; padding: 0 0 6px; cursor: pointer;
  font-family: inherit; font-size: 10.5px; font-weight: 600;
  color: var(--primary2); white-space: nowrap;
}
.sk-refill:active { opacity: 0.6; }
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; }
.btn-add-room-subtle {
  width: auto; display: inline-flex; align-items: center; gap: 2px;
  padding: 2px 6px; margin-top: 4px;
  font-size: 10px; font-weight: 500;
  border-radius: 4px; border-width: 1px;
}
.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;
}
/* Job page only: narrower tap buttons (less dead space around labels) */
#panel-job .tap-group.tap-3col,
#panel-job .tap-group.tap-4col {
  max-width: 85%;
}
/* Purpose and Lender cards in narrow right column */
#job-purpose-inline .tap-group.tap-3col,
#job-lender-inline .tap-group.tap-3col {
  max-width: 100%;
}
#job-purpose-inline .tap-opt,
#job-lender-inline .tap-opt,
#job-ins-instruction-inline .tap-opt {
  font-size: 10px;
  padding: 5px 3px;
}
#job-ins-instruction-inline .tap-group.tap-2col {
  max-width: 100%;
}
.tap-group.tap-5col {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 5px;
}
.tap-group.tap-6col {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 5px;
}
.tap-group.tap-5col .tap-opt,
.tap-group.tap-6col .tap-opt {
  font-size: 10px;
  padding: 5px 3px;
}
.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 (Sign-In-button blue, pale text) */
.tap-opt.sel {
  background: var(--sel);
  border-color: var(--sel);
  color: var(--sel-text);
}

/* Modifier tap option — used for Gated Parcelling/Project */
.tap-opt.tap-modifier {
  border-style: dashed;
  font-style: italic;
  color: var(--muted);
}
.tap-opt.tap-modifier.sel {
  background: var(--primary2);
  border-color: var(--primary2);
  border-style: solid;
  color: white;
  font-style: normal;
}

/* 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; }

/* ── FLOOR NUMBER INPUT (unit style) ─── */
.style-floor-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}
.style-floor-input {
  width: 80px;
  padding: 7px 10px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  color: var(--text);
  background: white;
  -moz-appearance: textfield;
  text-align: center;
}
.style-floor-input::-webkit-outer-spin-button,
.style-floor-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.style-floor-input:focus { outline: none; border-color: var(--accent); }
.style-floor-input:not(:placeholder-shown) {
  background: var(--sel);
  border-color: var(--sel);
  color: var(--sel-text);
  font-weight: 700;
}
.style-floor-suffix {
  font-size: 14px;
  color: var(--text-muted, #6b7280);
  font-weight: 500;
}

/* ── 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(--sel);
  border-color: var(--sel);
  color: var(--sel-text);
}
input[type=number].num-input {
  width: 38px; height: 38px;
  padding: 0;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: white;
  font-size: 13px; font-weight: 700;
  font-family: inherit; color: var(--text);
  text-align: center;
  flex-shrink: 0;
  -moz-appearance: textfield;
}
input[type=number].num-input::-webkit-outer-spin-button,
input[type=number].num-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number].num-input:focus { outline: none; border-color: var(--primary); }
/* A typed value reads like a selected chip (the inputs carry placeholder=" "
   so :placeholder-shown flips as soon as the box holds anything) */
input[type=number].num-input:not(:placeholder-shown) {
  background: var(--sel);
  border-color: var(--sel);
  color: var(--sel-text);
}

/* ── CHIP TOGGLES ────────────────────────── */
.chip-group { display: flex; flex-wrap: wrap; gap: 5px; }
.chip {
  padding: 4px 9px;
  border-radius: 8px;      /* rounded rectangle, like the Sign In button (was a pill) */
  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(--sel);
  border-color: var(--sel);
  color: var(--sel-text); font-weight: 600;
}
/* Admin-added (permanent) and typed one-off chips look exactly like built-ins;
   the long-press-to-remove gesture must not trigger iOS text selection. */
.chip.chip-custom, .chip.chip-adhoc { -webkit-touch-callout: none; }
/* The typing chip at the end of every row */
.chip.chip-add {
  display: inline-flex; align-items: center;
  padding: 0;
  border-style: dashed;
  border-color: #9fb3c8;
  background: transparent;
  cursor: text;
}
/* input.class beats the global input[type=text] rule (same specificity, later in file) */
input.chip-add-input, input.chip-add-input:focus {
  display: block;
  width: 72px;
  height: auto;
  padding: 4px 9px;            /* same box as a .chip → same row height */
  line-height: normal;
  margin: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  box-shadow: none;
  font: inherit;
  font-size: 11px; font-weight: 500;
  color: var(--text);
  outline: none;
  box-sizing: border-box;
  -webkit-appearance: none; appearance: none;
}
input.chip-add-input::placeholder { color: #7f93a8; }
.chip.chip-add:focus-within { border-style: solid; border-color: var(--primary); background: white; }

/* ── CELL FORMULAS (number boxes that hold "=…") ── */
input.calc-input.fx-cell    { background: #eef4fb; }
input.calc-input.fx-editing { background: #fff; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
input.calc-input.fx-err, input.fx-err { color: #c00000; border-color: #e08a8a; }
input.calc-input.fx-flash   { box-shadow: 0 0 0 3px rgba(37,99,168,0.45); transition: box-shadow 0.1s; }

/* ── FREE SHEET (calc mod12) ─────────────── */
.fs-help { font-size: 11px; color: var(--muted); line-height: 1.55; margin-bottom: 8px; }
.fs-help b { color: var(--text); font-weight: 600; }
.fs-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.fs-cellname {
  min-width: 40px; text-align: center;
  font-size: 12px; font-weight: 700; color: var(--primary);
  background: #e6edf5; border-radius: 8px; padding: 9px 6px;
}
input.fs-formula, input.fs-formula:focus {
  flex: 1; width: auto; min-width: 0;
  padding: 8px 10px;
  font-size: 14px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  border: 1.5px solid var(--border); border-radius: 8px; background: white; box-shadow: none;
}
input.fs-formula:focus { border-color: var(--primary2); }
.fs-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--border); border-radius: 8px; background: white; }
.fs-table { border-collapse: collapse; table-layout: auto; min-width: 100%; }
.fs-table th {
  font-size: 10px; font-weight: 700; color: var(--muted);
  background: #e9eef4; padding: 4px; text-align: center;
  border: 1px solid var(--border); user-select: none;
}
.fs-table th.fs-rowhdr { width: 30px; }
.fs-table td { padding: 0; border: 1px solid var(--border); min-width: 96px; }
.fs-table td:nth-child(2) { min-width: 150px; }
input.fs-cell, input.fs-cell:focus {
  display: block; width: 100%; box-sizing: border-box;
  padding: 8px 7px; margin: 0;
  border: none; border-radius: 0; box-shadow: none; outline: none;
  font-size: 13px; font-family: inherit; text-align: right;
  background: white; color: var(--text);
}
input.fs-cell.text    { text-align: left; }
input.fs-cell.formula { background: #eef4fb; }
input.fs-cell.err     { color: #c00000; font-weight: 600; }
input.fs-cell.result  { background: var(--primary); color: #fff; font-weight: 700; }
/* Other tagged cells: as if completed (blue tint), reinstatement costs (amber tint) */
input.fs-cell.role-comp   { background: #dfe9f6; color: var(--primary); font-weight: 700; }
input.fs-cell.role-rc, input.fs-cell.role-rcComp { background: #f6ecd6; color: #7a5a12; font-weight: 700; }
.fs-td { position: relative; }
.fs-tag {
  position: absolute; top: 1px; left: 3px; z-index: 1; pointer-events: none;
  font-size: 7.5px; font-weight: 800; letter-spacing: 0.4px; line-height: 1;
  padding: 2px 3px; border-radius: 3px; background: rgba(255,255,255,0.85); color: var(--primary);
}
.fs-btn.fs-mini { padding: 7px 9px; font-size: 11px; }
.fs-btn.fs-mini.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.fs-btn:disabled { opacity: 0.45; cursor: default; }
/* Cells a formula points at, while it is edited — Excel-style coloured outlines */
input.fs-cell.fs-ref-0 { box-shadow: inset 0 0 0 2px #2563eb; background: #eaf1fd; }
input.fs-cell.fs-ref-1 { box-shadow: inset 0 0 0 2px #16a34a; background: #e9f7ee; }
input.fs-cell.fs-ref-2 { box-shadow: inset 0 0 0 2px #9333ea; background: #f3eafd; }
input.fs-cell.fs-ref-3 { box-shadow: inset 0 0 0 2px #ea580c; background: #fdeee4; }
input.fs-cell.fs-ref-4 { box-shadow: inset 0 0 0 2px #0d9488; background: #e6f6f4; }
.fs-menu {
  position: fixed; z-index: 10000; min-width: 150px;
  background: #fff; border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 10px 30px rgba(15,23,42,0.18); padding: 4px; display: flex; flex-direction: column;
}
.fs-menu button {
  text-align: left; background: none; border: none; border-radius: 6px;
  padding: 8px 12px; font: inherit; font-size: 13px; color: var(--text); cursor: pointer;
}
.fs-menu button:hover { background: #eef3f8; }
.fs-menu button:disabled { color: #9aa7b5; cursor: default; }
.fs-wrap { position: relative; }
.fs-fill-handle {
  position: absolute; width: 12px; height: 12px; display: none; z-index: 3;
  background: var(--primary); border: 2px solid #fff; border-radius: 2px; box-sizing: border-box;
  cursor: crosshair; touch-action: none; box-shadow: 0 0 0 1px var(--primary);
}
.fs-fill-handle::after { content: ''; position: absolute; inset: -8px; }   /* bigger finger target */
body.fs-filling { cursor: crosshair; user-select: none; -webkit-user-select: none; }
body.fs-filling input.fs-cell { pointer-events: none; }
input.fs-cell.fs-fill-target { box-shadow: inset 0 0 0 2px var(--primary2); background: #e8f0fb; }
.fs-roles { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 8px; }
.fs-roles-lbl { font-size: 11px; color: var(--muted); margin-right: 2px; }
.fs-btn.fs-role.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.fs-btn.fs-role.on b { font-weight: 700; opacity: 0.85; }
input.fs-cell.result.formula { background: var(--primary); }
input.fs-cell.active, input.fs-cell:focus { box-shadow: inset 0 0 0 2px var(--primary2); text-align: left; }
.fs-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; }
.fs-btn {
  padding: 7px 12px; border-radius: 8px;
  border: 1.5px solid var(--border); background: white;
  font-size: 12px; font-weight: 600; color: var(--text); font-family: inherit; cursor: pointer;
}
.fs-btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; white-space: nowrap; }
.fs-btn-danger  { color: #c00000; border-color: #e8bcbc; }
.fs-result-note { font-size: 11px; color: var(--muted); margin-left: auto; }

/* ── 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;
}
/* ── Disclosure tab bar ─────────────────────── */
.disc-tab-bar {
  display: flex; gap: 8px; margin: 16px 0 14px;
}
.disc-tab-btn {
  flex: 1; padding: 10px 0; font-size: 14px; font-weight: 700;
  border: 2px solid #d0d9e8; border-radius: 10px;
  background: #f0f4fb; color: var(--primary2); cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.disc-tab-btn.active {
  background: var(--primary); color: #fff; border-color: var(--primary);
}
.disc-panel { display: none; }
.disc-panel.active { display: block; }

.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;
}

/* ── PDF ATTACH BUTTON + THUMBS IN SIDEBAR ─── */
.attach-separator {
  width: 36px; height: 1px; background: #ccc; margin: 2px 0;
}
.btn-attach-doc {
  width: 44px; height: 44px; padding: 0;
  background: #fff; color: var(--primary);
  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;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
/* Attach and Import are native <label>s for their file inputs (no script in the
   path — Safari opens the picker itself); undo the form-label look they inherit. */
label.btn-attach-doc, label.btn-import-json-sm {
  text-transform: none; letter-spacing: normal; margin: 0; box-sizing: border-box;
  -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none;
}
label.btn-attach-doc { color: var(--primary); }
label.btn-import-json-sm { color: #fff; }
.btn-attach-doc .btn-icon { font-size: 16px; line-height: 1; }
.btn-attach-doc .btn-lbl  { font-size: 9px; line-height: 1; }
.attached-thumbs {
  display: flex; flex-direction: column;
  align-items: center; gap: 4px;
  width: 100%; max-height: 300px; overflow-y: auto;
}
.attached-thumb-item {
  position: relative; width: 40px;
}
.attached-thumb-item img {
  width: 40px; height: 57px; /* ~A4 aspect */
  object-fit: cover; border-radius: 3px;
  border: 1.5px solid #bbb; display: block;
}
.attached-thumb-remove {
  position: absolute; top: -4px; right: -4px;
  width: 16px; height: 16px; border-radius: 50%;
  background: #e53e3e; color: #fff;
  border: none; cursor: pointer;
  font-size: 9px; line-height: 16px; text-align: center;
  padding: 0;
}

/* ── PDF ATTACH MODAL ───────────────────────── */
.pdf-attach-sheet {
  background: #fff;
  border-radius: 18px 18px 0 0;
  width: 100%; max-width: 560px;
  max-height: 80vh;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.pdf-attach-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 16px 16px 8px;
  border-bottom: 1px solid #eee;
  flex-shrink: 0;
}
.pdf-attach-title {
  font-size: 15px; font-weight: 700; color: var(--primary);
}
.pdf-attach-filename {
  font-size: 12px; color: #666; margin-top: 2px;
  word-break: break-all;
}
.pdf-attach-close {
  background: none; border: none; cursor: pointer;
  font-size: 18px; color: #888; padding: 4px;
  flex-shrink: 0;
}
.pdf-attach-warning {
  background: #fff8e1; border-left: 3px solid #f59e0b;
  padding: 8px 12px; font-size: 12px; color: #92400e;
  flex-shrink: 0;
}
.pdf-attach-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 12px;
  overflow-y: auto;
  flex: 1;
}
.pdf-attach-thumb {
  position: relative; cursor: pointer;
  aspect-ratio: 210 / 297; /* A4 portrait */
  border-radius: 4px; overflow: hidden;
  border: 2px solid #d0d7de;
  transition: border-color 0.15s;
}
.pdf-attach-thumb img {
  width: 100%; height: 100%; object-fit: contain;
  background: #f8f8f8; display: block;
}
.pdf-attach-thumb.selected {
  border-color: #2563eb;
}
.pdf-attach-check {
  display: none;
  position: absolute; top: 4px; right: 4px;
  width: 22px; height: 22px; border-radius: 50%;
  background: #2563eb; color: #fff;
  font-size: 13px; line-height: 22px; text-align: center;
  font-weight: 700;
}
.pdf-attach-thumb.selected .pdf-attach-check { display: block; }
.pdf-attach-page-num {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: rgba(0,0,0,0.45); color: #fff;
  font-size: 10px; text-align: center; padding: 2px 0;
}
.pdf-attach-footer {
  display: flex; gap: 10px; padding: 12px 16px;
  border-top: 1px solid #eee;
  flex-shrink: 0;
}
.pdf-attach-btn-cancel {
  flex: 1; padding: 12px; border-radius: 10px;
  border: 1.5px solid #ccc; background: #fff;
  font-size: 14px; font-weight: 600;
  cursor: pointer; font-family: inherit; color: #444;
}
.pdf-attach-btn-add {
  flex: 2; padding: 12px; border-radius: 10px;
  border: none; background: #2563eb; color: #fff;
  font-size: 14px; font-weight: 700;
  cursor: pointer; font-family: inherit;
}
.pdf-attach-btn-add:disabled {
  background: #93c5fd; cursor: default;
}

/* ── 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: var(--cardface);
  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-duplicate-saved {
  background: #f0f7ff;
  border: none;
  border-left: 1px solid var(--border);
  color: #007aff;
  font-size: 18px;
  padding: 0 14px;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s;
}
.btn-duplicate-saved:active { background: #dbeeff; }
.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; }
.btn-changetype-saved {
  background: #fffbf0;
  border: none;
  border-left: 1px solid var(--border);
  color: #b45309;
  font-size: 16px;
  padding: 0 14px;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s;
}
.btn-changetype-saved:active { background: #fef3c7; }

/* ── Change Type modal ────────────────────── */
.change-type-modal-box { width: 100%; max-width: 400px; }
.change-type-body      { padding: 16px 20px 4px; }
.change-type-note {
  font-size: 12.5px;
  color: var(--muted);
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 12px;
  margin: 0 0 14px;
  line-height: 1.5;
}
.change-type-options { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.change-type-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.15s, background 0.15s;
}
.change-type-option:has(input:checked) {
  border-color: var(--primary2);
  background: #f0f7ff;
}
.change-type-option input[type="radio"] { accent-color: var(--primary2); }
.change-type-option-label { font-weight: 500; color: #1e3a5f; }
.btn-modal-confirm-change {
  padding: 9px 22px;
  background: #b45309;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}
.btn-modal-confirm-change:hover { background: #92400e; }
.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: #fff;
  color: var(--primary);
  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;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.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-pdf {
  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-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;
  margin-bottom: 10px;
}
.btn-after-home {
  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;
  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;
}

/* ── 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;
}
/* Move-floor button: dashed to read as an action, amber pulse while armed */
.floor-move-btn { border-style: dashed; font-size: 14px; }
.floor-move-btn.armed {
  background: #ff9800;
  border-color: #ff9800;
  border-style: solid;
  color: #fff;
  box-shadow: 0 0 0 3px rgba(255,152,0,0.25);
}

/* Inspection-list status — honest loading / can't-reach-cloud placeholder */
.insp-status {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 26px 16px;
  color: #546e7a;
  font-size: 13px;
  text-align: center;
}
.insp-status-err { color: #b26a00; }
.insp-status-icon { flex: none; }
.insp-spin { animation: photos-spin 0.9s linear infinite; }
.insp-status-note { font-size: 11.5px; color: #90a4ae; }
.insp-retry {
  margin-top: 2px;
  padding: 7px 18px;
  border-radius: 8px;
  border: 1.5px solid #1565c0;
  background: #fff;
  color: #1565c0;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
.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;
}

/* ── Drawing area: left strip + canvas ── */
.sketch-drawing-area {
  display: flex;
  gap: 6px;
  align-items: stretch;
}

/* Left action strip */
.sketch-action-strip {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex-shrink: 0;
}
.sketch-strip-btn {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  border: 1.5px solid #c5d0db;
  background: #fff;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  padding: 0;
}
.sketch-strip-btn:hover      { background: #f0f4f8; }
.sketch-strip-btn.sketch-close-btn { border-color: #1976d2; color: #1565c0; background: #e3f2fd; }
.sketch-strip-btn.sketch-flip-btn  { border-color: #00897b; color: #00695c; background: #e0f2f1; }
.sketch-strip-btn.sketch-lock-btn  { border-color: #7b1fa2; color: #6a1b9a; background: #f3e5f5; }
.sketch-strip-btn.sketch-clear-btn { border-color: #e53935; color: #c62828; }

/* Divider between action buttons and floor buttons in strip */
.sketch-strip-divider {
  width: 100%;
  height: 1px;
  background: #d0dae4;
  margin: 2px 0;
}

/* Floor buttons inside the left strip — match strip width */
.sketch-action-strip .floor-btn {
  width: 38px;
  height: 32px;
  padding: 0;
  font-size: 11px;
  border-radius: 6px;
}

/* Canvas wrap */
.sketch-canvas-wrap {
  flex: 1;
  min-width: 0;
  height: 52vh;
  min-height: 280px;
  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%;
}

/* ── Delete bar — floats over canvas when a shape is selected ── */
#sketchDeleteBar {
  display: none;
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  background: rgba(10, 20, 40, 0.82);
  color: #fff;
  border-radius: 8px;
  padding: 5px 12px;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  font-size: 13px;
  pointer-events: auto;
  box-shadow: 0 2px 8px rgba(0,0,0,0.35);
}
#sketchDeleteBar.visible { display: flex; }
#sketchDeleteLabel { font-weight: 600; }
.sketch-del-btn {
  background: #e53935;
  color: #fff;
  border: none;
  border-radius: 5px;
  padding: 3px 10px;
  font-size: 13px;
  cursor: pointer;
}
.sketch-del-btn:hover  { background: #b71c1c; }
.sketch-del-cancel {
  background: rgba(255,255,255,0.18);
  color: #fff;
  border: none;
  border-radius: 5px;
  padding: 3px 8px;
  font-size: 13px;
  cursor: pointer;
}
.sketch-del-cancel:hover { background: rgba(255,255,255,0.30); }

/* ── Bottom bar: room palette + summary ── */
.sketch-bottom {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  flex-wrap: wrap;
}
.sketch-palette-wrap {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  flex: 1;
  min-width: 0;
}
.sketch-summary-wrap {
  flex-shrink: 0;
  min-width: 160px;
}

/* Inline "Add to Report" button in topbar */
.sketch-report-inline {
  margin-left: auto;
  background: #e3f2fd !important;
  border-color: #1976d2 !important;
  color: #1565c0 !important;
  font-weight: 700;
}

/* Legacy action bar — hidden (replaced by strip) */
.sketch-actionbar {
  display: none;
}
.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;
}
/* Custom room type — type a name, then drag the adjacent chip */
.room-chip-custom-group { display: inline-flex; align-items: center; gap: 5px; }
.room-chip-input {
  padding: 6px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  width: 120px;
  border: 1.5px solid rgba(0,0,0,0.15);
  background: #fff;
  color: #1565c0;
  outline: none;
}
.room-chip-input::placeholder { color: #90a4ae; font-weight: 500; }
.room-chip-input:focus { border-color: #1565c0; }
.room-chip-custom { background: #fff; border-style: dashed; border-color: #1565c0; }
.room-chip-custom.room-chip-empty {
  opacity: 0.55;
  cursor: default;
  color: #90a4ae;
  border-color: rgba(0,0,0,0.20);
}

/* 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 — legacy standalone (hidden; now inline in topbar) */
.btn-sketch-report { display: none; }

/* 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: #fff; color: var(--primary);
  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;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.pdf-print-btn:active { background: #eef2f7; }
.btn-icon { font-size: 16px; line-height: 1; display:flex; align-items:center; justify-content:center; }
.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.75);   /* ≈ 596px visible */
  height: calc(1122px * 0.75);  /* ≈ 842px visible */
  flex-shrink: 0;
  margin-bottom: 12px;
  overflow: visible; /* allow last-box overflow in preview — download uses scale-to-fit */
}
.pdf-page-wrap .pdf-page {
  transform: scale(0.75);
  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: 'Inter', Calibri, Arial, sans-serif;   /* report body */
  font-size: 8.5pt;
  line-height: 1.35;
  color: #000;
  position: relative;
  padding: 53px 38px 45px 38px; /* match export padding so preview = PDF */
  overflow: hidden;
  width: 794px;
  height: 1122px;
  flex-shrink: 0;
}

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

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

/* Section header (numbered 1–9) ────────────── */
.pdf-sec-hdr {
  background: #fff; color: #000;
  font-family: 'Montserrat', Arial, sans-serif;
  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: none;
  padding: 3px 5px;
  vertical-align: top;
  font-size: 6.75pt;
  word-wrap: break-word;
  overflow-wrap: break-word;
}
.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: 6.75pt !important; border-color: #1f3864 !important; }
.pdf-mv-cell-comp{ background: #4472c4 !important; color: white !important; font-weight: 700; font-size: 6.75pt !important; border-color: #4472c4 !important; }

/* Disclosure sub-headers & body ────────────── */
.pdf-disc-hdr { font-family: 'Montserrat', Arial, sans-serif; font-weight: 700; font-size: 8.5pt; padding: 4px 0 2px; }
.pdf-disc-body { font-size: 8pt; line-height: 1.4; margin-bottom: 4px; word-wrap: break-word; overflow-wrap: break-word; }

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

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

/* ── Cover page ─────────────────────────────── */
.pdf-cover-header { display: flex; justify-content: space-between; align-items: flex-start; }
.pdf-cover-title  { font-family: 'Montserrat', Arial, sans-serif; font-size: 34pt; font-weight: 700; color: #808080; white-space: nowrap; }
.pdf-cover-sub    { font-family: 'Montserrat', Arial, sans-serif; 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%; text-align: center; }
.pdf-cover-photo  { max-width: 85%; max-height: 660px; object-fit: contain; 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: 124px; 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: 45mm !important; /* 3mm gap + 32mm bar + 10mm content margin */
  }
  .pdf-cover-page::before {
    left: 3mm !important;   /* white gap from page edge */
    width: 32mm !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: 4mm; right: 5mm; }
}
@page { size: A4 portrait; margin: 0; }

/* Tablet: taller canvas */
@media (min-width: 768px) {
  /* Canvas taller on tablet — leaves room for topbar + chips below */
  .sketch-canvas-wrap { height: 58vh; }
  /* Sketch panel: single column, no card grid override needed */
  #panel-sketch.active {
    display: block;
    overflow-y: auto;
    padding: 14px 16px 20px;
  }
  #panel-sketch .card-full { margin-bottom: 10px; }
}

/* ══ 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 — always shown with blue tint */
.calc-primary-slot {
  background: #c8dff4;
  border-radius: 10px;
  padding: 14px;
  margin: 0 -14px;
  border: 1.5px solid #82b4e0;
}
.calc-primary-slot .calc-section-title {
  background: #a8cceb;
  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 — unified sizing across table rows, depreciation fields, and all calc sections */
.calc-input {
  width: 100%;
  display: block;
  padding: 6px 8px;
  border: 1.5px solid var(--border);
  border-radius: 7px;
  font-size: 13px;
  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%;
  table-layout: fixed;
  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 {
  display: block;
  width: 100%;
  padding: 6px 8px;
  font-size: 13px;
}
/* Depreciation and standalone calc fields — match table-row input height exactly */
.calc-2col .calc-input {
  padding: 6px 8px;
  font-size: 13px;
}
.calc-computed {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  text-align: right;
  white-space: nowrap;
  padding-right: 4px;
}

/* 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.comp { font-size: 15px; 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: narrow sidebar — icon + small label */
  #screen-inspect.active {
    grid-template-columns: 1fr 68px;
    height: 100vh;
    height: 100dvh;
  }
  #screen-inspect > .tab-bar {
    width: 68px;
    padding: 8px 0;
    justify-content: space-around;
  }
  #screen-inspect > .tab-bar .tab-item {
    padding: 6px 2px;
    font-size: 15px;
  }
  #screen-inspect > .tab-bar .tab-label {
    display: block;
    font-size: 9px;
  }

  /* 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,
  .job-top-grid,
  #val-calc-wrap,
  #ins-calc-wrap,
  #job-val-instruction,
  #job-ins-instruction,
  #job-ins-assdate {
    grid-column: span 2;
  }

  /* Photos panel: single column, full width (override 2-col card grid) */
  #panel-photos.active {
    display: block !important;
  }

  /* Notes panel: always flex-column regardless of the 2-col grid override */
  #panel-notes.active {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    grid-template-columns: none !important;
  }

  /* Review panel: full-width flex-row — overrides the generic 2-col grid.
     review-layout fills all space; save-success slides in on the right only when visible. */
  #panel-review.active {
    display: flex !important;
    flex-direction: row !important;
    padding: 0 !important;
    gap: 0 !important;
    overflow: hidden !important;
    align-items: stretch !important;
  }
  #panel-review .review-layout {
    flex: 1;
    min-width: 0;
    height: 100%;
    overflow: hidden;
    align-items: stretch;
  }
  #panel-review .save-success {
    width: 260px;
    flex-shrink: 0;
    overflow-y: auto;
    margin: 0;
    border-radius: 0;
    border-left: 1px solid #e0e0e0;
    box-shadow: -3px 0 12px rgba(0,0,0,0.08);
  }

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

  /* JOB panel: block layout so restores card spacing */
  #panel-job .card,
  #panel-job .job-top-grid,
  #panel-job .btn-next-tab {
    margin-bottom: 12px;
  }

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

  /* JOB panel: single column flow — photo, GPS, cards all full-width */
  #panel-job.active {
    display: block;
  }

  /* 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;
}
.btn-upload-photos {
  display: flex; align-items: center; gap: 5px;
  padding: 5px 11px; border-radius: 20px;
  background: var(--bg); border: 1.5px solid var(--border);
  font-size: 11px; font-weight: 600; color: var(--muted);
  cursor: pointer; font-family: inherit;
  transition: background 0.15s, color 0.15s;
}
.btn-upload-photos:hover { background: var(--border); color: var(--primary); }
.btn-upload-photos svg   { stroke: currentColor; }

/* ── Sync status bar ─────────────────────────────────────────────────────── */
.photos-status-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 16px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  min-height: 32px;
}
.photos-status-icon {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.photos-status-text {
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
}
@keyframes photos-spin {
  to { transform: rotate(360deg); }
}
.photos-status-icon.spinning svg {
  animation: photos-spin 1s linear infinite;
  transform-origin: center;
}
/* Generic "action in progress" state for a button: spin its icon, dim it,
   and block further clicks until the action finishes. */
/* App version label (spot a device on stale cached code at a glance) */
.app-version-corner { position: absolute; bottom: 114px; left: 12px; z-index: 3; font-size: 10px; color: rgba(255,255,255,0.55); letter-spacing: 0.3px; pointer-events: none; }
.btn-busy { opacity: 0.65; pointer-events: none; cursor: default; }
.btn-busy svg { animation: photos-spin 0.85s linear infinite; transform-origin: center; }
.photos-sync-retry {
  margin-left: auto;
  padding: 2px 9px;
  font-size: 11px;
  font-weight: 600;
  color: #dc2626;
  background: none;
  border: 1px solid #dc2626;
  border-radius: 10px;
  cursor: pointer;
  line-height: 1.4;
  white-space: nowrap;
}
.photos-sync-retry:active { opacity: 0.7; }

/* ── 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; }

/* ════════════════════════════════════════════════════════════════════════════
   NOTES PANEL — Apple Notes-inspired
   ════════════════════════════════════════════════════════════════════════════ */
#panel-notes {
  display: none;
  flex-direction: column;
  align-items: stretch;   /* override tablet's align-items:start */
  padding: 0;
  overflow: hidden;
  background: #fffef8;
}
#panel-notes.active { display: flex; }

/* ── Text section ──────────────────────────────────────────────────────────── */
.anote-text-wrap {
  flex: 1;
  min-height: 0;
  width: 100%;           /* force full width even under align-items:start */
  position: relative;
  overflow: hidden;
}

.anote-textarea {
  display: block;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  padding: 18px 20px 18px 56px; /* left padding = space past margin rule */
  border: none;
  outline: none;
  resize: none;
  font-family: -apple-system, 'SF Pro Text', system-ui, sans-serif;
  font-size: 16px;
  line-height: 30px;              /* must match gradient step */
  color: #1c1c1e;
  caret-color: #007aff;

  /* Lined-paper background — scrolls with content */
  background-color: #fffef8;
  background-image:
    /* left red margin rule */
    linear-gradient(to right, transparent 44px, #ffd0d0 44px, #ffd0d0 45px, transparent 45px),
    /* horizontal ruled lines every 30 px */
    repeating-linear-gradient(
      to bottom,
      transparent 0px,
      transparent 29px,
      #d8e4ef 29px,
      #d8e4ef 30px
    );
  background-attachment: local, local;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.anote-textarea::placeholder {
  color: #bcc4cc;
  font-style: italic;
}

/* ── Section rule ──────────────────────────────────────────────────────────── */
.anote-rule {
  flex-shrink: 0;
  border: none;
  border-top: 1px solid #d8d6cf;
  margin: 0;
  width: 100%;
}

/* ── Drawing section ───────────────────────────────────────────────────────── */
.anote-draw-wrap {
  flex: 1;
  min-height: 0;
  width: 100%;           /* force full width even under align-items:start */
  display: flex;
  flex-direction: column;
  background: #fff;
}

.anote-canvas {
  flex: 1;
  display: block;
  width: 100%;
  touch-action: none;
  cursor: crosshair;
  background: #fff;
}

/* iOS-style floating toolbar at the bottom of the drawing area */
.anote-toolbar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: rgba(248,248,248,0.96);
  border-top: 1px solid #e0e0e0;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* Pen-type buttons */
.draw-pen-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1.5px solid transparent;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex-shrink: 0;
  transition: background 0.15s;
}
.draw-pen-btn.active {
  background: #e8f0fb;
  border-color: #007aff;
}
/* Pen nib visual — shows stroke weight */
.pen-nib {
  display: block;
  background: #1c1c1e;
  border-radius: 99px;
  width: 22px;
}
.pen-nib-sm { height: 1.5px; }
.pen-nib-md { height: 4px;   }
.pen-nib-lg { height: 9px;   }
.draw-pen-btn.active .pen-nib { background: #007aff; }

/* Eraser tool button */
.draw-eraser-tool { border-color: #d0d5dd; }
.draw-eraser-tool.active {
  background: #fff3ee;
  border-color: #e67e22;
}
/* Eraser icon — white rectangle with pink border, like a real eraser */
.eraser-icon {
  display: block;
  width: 20px;
  height: 12px;
  border-radius: 3px;
  background: #f0ede8;
  border: 2px solid #c8a882;
  position: relative;
  overflow: hidden;
}
.eraser-icon::after {
  content: '';
  position: absolute;
  left: 0; top: 0;
  width: 7px; height: 100%;
  background: #e8a090; /* pink tip */
}
.draw-eraser-tool.active .eraser-icon {
  border-color: #e67e22;
}
/* Dim colour dots while eraser is active */
.eraser-active .draw-color-btn {
  opacity: 0.3;
  pointer-events: none;
}

/* Color dots */
.draw-color-btn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2.5px solid transparent;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: transform 0.1s;
}
.draw-color-btn.active {
  border-color: #fff;
  box-shadow: 0 0 0 2.5px #007aff;
  transform: scale(1.15);
}

.anote-spacer { flex: 1; }

/* Eraser / Clear */
.draw-tool-btn {
  height: 34px;
  border-radius: 10px;
  border: 1.5px solid #d0d5dd;
  background: #f5f5f5;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  color: #3a3a3c;
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s;
}
.draw-clear-btn { font-size: 16px; padding: 0 8px; }
.draw-tool-btn:active { opacity: 0.75; }

/* ── 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 (1 column mobile, 2 columns desktop) ────────────────────── */
.photo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
@media (min-width: 768px) {
  .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;
  display: flex; align-items: center; justify-content: center;
}
.photo-action svg { stroke: currentColor; }
.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: #fff;
  color: var(--primary);
  border: none;
  border-radius: 10px;
  padding: 10px 6px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  transition: background 0.15s;
  min-width: 48px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.btn-zip:active { background: #eef2f7; }
.btn-zip .btn-icon { font-size: 20px; }

/* ── Sketch-in-PDF toggle ────────────────────────────────────────────────── */
.btn-sketch-toggle {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  background: #fff;
  color: var(--primary);
  border: none;
  border-radius: 10px;
  padding: 10px 6px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  transition: background 0.15s, opacity 0.15s;
  min-width: 48px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.btn-sketch-toggle:active { background: #eef2f7; }
/* When sketch is excluded from PDF: dim + strikethrough label */
.btn-sketch-toggle.sketch-toggle-off {
  opacity: 0.35;
  text-decoration: line-through;
}

/* ── PDF photo pages ─────────────────────────────────────────────────────── */
.pdf-photo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 8px;
}
.pdf-photo-cell {
  display: block;
  height: 300px;        /* fixed: 3 rows × 300px + gaps + padding + header = ~980px < 1024px */
  overflow: hidden;
}
/* Wrapper constrains the image to a fixed height — html2canvas respects
   max-width/max-height better than object-fit:contain + flex layout */
.pdf-photo-img-wrap {
  width: 100%;
  height: 278px;        /* cell height minus caption (16px) minus gap (6px) */
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.pdf-photo-img {
  max-width: 100%;
  max-height: 278px;
  width: auto;
  height: auto;         /* natural aspect ratio — browser scales to fit max-w/max-h */
  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;
  height: 16px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  margin-top: 6px;
}

/* ── 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; }

/* ProMap handover — the second source, under the old-database Search */
.ev-promap        { margin-top: 14px; padding-top: 12px; border-top: 1.5px solid var(--border); }
.ev-promap-or     { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
                    color: var(--muted); margin-bottom: 8px; }
.ev-promap-btn    { width: 100%; padding: 11px; background: #fff; color: var(--primary);
                    border: 1.5px solid var(--primary); border-radius: 10px;
                    font-size: 15px; font-weight: 700; cursor: pointer; font-family: inherit;
                    display: flex; align-items: center; justify-content: center; gap: 7px; }
.ev-promap-btn:hover    { background: #EBF3FB; }
.ev-promap-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.ev-promap-note   { font-size: 11px; color: var(--muted); margin-top: 6px; line-height: 1.4; }
.ev-sel-src       { font-size: 11px; color: var(--muted); margin-top: 2px;
                    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Location map block under the selected comparables */
.ev-map           { border-top: 1.5px solid var(--border); padding: 10px 12px 12px; }
.ev-map-hdr       { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.ev-map-toggle    { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700;
                    color: var(--primary); cursor: pointer; }
.ev-map-toggle input { width: 18px; height: 18px; accent-color: var(--primary); }
.ev-map-layers    { width: auto; }
.ev-map-dist      { font-size: 12px; font-weight: 600; margin-left: 10px; }
.ev-map-layers .ev-tenure-btn { padding: 6px 12px; font-size: 12px; }
.ev-map-img       { display: block; width: 100%; height: auto; margin-top: 10px;
                    border: 1px solid var(--border); border-radius: 8px; }
.ev-map-note      { font-size: 11px; color: var(--muted); margin-top: 6px; line-height: 1.4; }
.ev-src-badge     { display: inline-block; background: var(--primary); color: #fff;
                    font-size: 9px; font-weight: 800; letter-spacing: 0.3px;
                    border-radius: 4px; padding: 1px 5px; margin-right: 6px; vertical-align: middle; }

/* 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 6px; border-bottom: 1.5px solid var(--border); }
.ev-sort-bar      { display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
                    padding: 8px 0 10px; border-bottom: 1px solid var(--border);
                    margin-bottom: 8px; }
.ev-sort-label    { font-size: 10px; font-weight: 700; color: var(--muted);
                    text-transform: uppercase; letter-spacing: 0.4px; margin-right: 2px; }
.ev-sort-btn      { padding: 3px 10px; border: 1.5px solid var(--border); border-radius: 20px;
                    background: white; font-size: 11px; font-weight: 600; color: var(--muted);
                    cursor: pointer; font-family: inherit; transition: all 0.15s; }
.ev-sort-btn.active { background: var(--primary); border-color: var(--primary); color: white; }
.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; }
.ev-card-unit-ref { font-size: 11px; font-weight: 600; padding: 2px 7px;
                    border-radius: 20px; background: #ECEFF1; color: #546E7A;
                    white-space: nowrap; flex-shrink: 0; }
/* 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; }

/* Adjust toggle button in the header */
.ev-adjust-btn    { margin-left: auto; background: none; border: 1.5px solid var(--primary);
                    color: var(--primary); border-radius: 6px; font-size: 11px;
                    font-weight: 700; padding: 3px 10px; cursor: pointer;
                    font-family: inherit; transition: background 0.15s, color 0.15s; }
.ev-adjust-btn--active { background: var(--primary); color: #fff; }

/* Card — column layout so adj panel can sit below the main row */
.ev-sel-card      { display: flex; flex-direction: column;
                    background: #EBF3FB; border-radius: 8px; overflow: hidden; }
.ev-sel-card--adj { background: #fef9ef; }  /* subtle warm tint when adjusted */
.ev-sel-card-top  { display: flex; align-items: center; gap: 10px; padding: 8px 10px; }
.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; }

/* "adj" badge shown in detail line when adjustments are applied */
.ev-adj-badge     { display: inline-block; background: var(--accent); color: #fff;
                    font-size: 9px; font-weight: 800; letter-spacing: 0.3px;
                    border-radius: 4px; padding: 1px 5px; vertical-align: middle;
                    text-transform: uppercase; }

/* Adjustment panel — appears below card-top in adjust mode */
.ev-adj-panel     { border-top: 1px solid rgba(0,0,0,0.08);
                    background: rgba(255,255,255,0.7);
                    padding: 5px 10px 7px; display: flex; flex-direction: column; gap: 4px; }
.ev-adj-fields    { display: flex; gap: 4px; }
.ev-adj-field     { flex: 1; display: flex; flex-direction: column; gap: 1px; }
.ev-adj-label     { font-size: 9px; font-weight: 700; text-transform: uppercase;
                    letter-spacing: 0.4px; color: var(--muted); text-align: center;
                    line-height: 1.2; }
.ev-adj-input     { width: 100%; border: 1px solid var(--border); border-radius: 4px;
                    padding: 0; height: 26px; font-size: 11px; font-family: inherit;
                    background: #fff; color: var(--primary); text-align: center;
                    line-height: 26px; box-sizing: border-box;
                    -webkit-appearance: none; -moz-appearance: textfield; }
.ev-adj-input::-webkit-inner-spin-button,
.ev-adj-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.ev-adj-input:focus { outline: none; border-color: var(--primary2); }

/* Result line */
.ev-adj-result    { font-size: 12px; display: flex; align-items: center; gap: 4px;
                    flex-wrap: wrap; }
.ev-adj-hint      { color: var(--muted); font-style: italic; font-size: 11px; }
.ev-rate-original { color: var(--muted); text-decoration: line-through; font-size: 11px; }
.ev-rate-adjusted { color: var(--accent); font-weight: 800; font-size: 13px; }



/* ══════════════════════════════════════════════
   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: 500;
  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; }

/* ══════════════════════════════════════════════════════════════
   INSURANCE MODULE
   ══════════════════════════════════════════════════════════════ */

/* Landing tile */
.type-card-ins {
  border-color: #c8ddf0;
  background: linear-gradient(135deg, #e2edf8 0%, var(--cardface) 100%);
}
.type-card-ins:active { border-color: var(--primary2); }
.type-card-ins .t-label { color: var(--primary2); }

/* ── Insurance sub-type picker overlay ── */
#ins-picker-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,0.45);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.ins-picker-box {
  background: white; border-radius: 18px;
  padding: 28px 20px 20px; width: 100%; max-width: 380px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.18);
}
.ins-picker-title {
  font-size: 20px; font-weight: 800; color: var(--primary2);
  text-align: center; margin-bottom: 4px;
}
.ins-picker-sub {
  font-size: 13px; color: var(--muted); text-align: center; margin-bottom: 20px;
}
.ins-picker-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px;
}
.ins-type-card {
  background: var(--bg); border-radius: 12px; padding: 16px 10px;
  text-align: center; cursor: pointer; border: 2px solid transparent;
  transition: all 0.18s; user-select: none;
}
.ins-type-card:active { transform: scale(0.96); border-color: var(--primary2); }
.ins-type-icon  { font-size: 28px; margin-bottom: 6px; display:flex; align-items:center; justify-content:center; }
.ins-type-icon svg { stroke: currentColor; }
.ins-type-label { font-size: 12px; font-weight: 700; color: var(--text); line-height: 1.3; }
.ins-picker-cancel {
  width: 100%; padding: 12px; border: 1.5px solid var(--border); border-radius: 10px;
  background: none; font-size: 14px; color: var(--muted); cursor: pointer;
}
.ins-picker-cancel:active { background: var(--bg); }

/* ── Insurance calc table ── */

/* Table header row */
.ins-table-head {
  display: grid;
  grid-template-columns: 1fr 72px 72px 72px 90px 28px;
  gap: 4px; align-items: center;
  font-size: 10px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.3px;
  padding: 4px 0 6px;
  border-bottom: 1.5px solid var(--border);
  margin-bottom: 4px;
}
.ins-h-desc { }
.ins-h-num  { text-align: right; }

/* Main structure / added item rows — display handled by calc-table */
.ins-main-row, .ins-added-row { }

.ins-input {
  width: 100%; border: 1px solid var(--border); border-radius: 6px;
  padding: 5px 6px; font-size: 12px; background: white; box-sizing: border-box;
}
.ins-input:focus { border-color: var(--primary2); outline: none; }
.ins-input.ins-num { text-align: right; }

.ins-cell {
  font-size: 12px; color: var(--muted); text-align: right; padding-right: 2px;
}
.ins-cell.ins-total { color: var(--text); font-weight: 600; }

.ins-section-label {
  font-size: 11px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.4px;
  padding: 8px 0 2px;
}

.ins-del-btn {
  background: none; border: none; color: #c0392b; font-size: 14px;
  cursor: pointer; padding: 2px 4px; line-height: 1;
}
.ins-add-btn {
  background: none; border: 1.5px dashed var(--border); border-radius: 8px;
  color: var(--primary2); font-size: 13px; font-weight: 700;
  padding: 7px 14px; cursor: pointer; margin-top: 8px; width: 100%;
  transition: background 0.15s;
}
.ins-add-btn:active { background: var(--bg); }

/* NRC total row */
.ins-nrc-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 0; margin-top: 6px;
  border-top: 2px solid var(--border);
}
.ins-nrc-label { font-size: 13px; font-weight: 700; color: var(--text); }
.ins-nrc-val   { font-size: 14px; font-weight: 800; color: var(--primary2); }

/* Overhead rows — display handled by calc-table */
.ins-oh-row { }
.ins-oh-label {
  font-size: 12px; color: var(--text);
}
.ins-oh-note {
  display: block; font-size: 10px; color: var(--muted); margin-top: 1px;
}
.ins-oh-pct {
  display: flex; align-items: center; justify-content: flex-end; gap: 2px;
  font-size: 12px;
}
.ins-pct-input {
  width: 48px; border: 1px solid var(--border); border-radius: 6px;
  padding: 4px 5px; font-size: 12px; text-align: right; background: white;
  box-sizing: border-box;
  -webkit-appearance: none; -moz-appearance: textfield;
}
.ins-pct-input:focus { border-color: var(--primary2); outline: none; }
.ins-oh-amount {
  font-size: 12px; color: var(--muted); text-align: right;
}

/* Recommended sum insured row */
.ins-sum-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0; margin-top: 6px;
  border-top: 2.5px solid var(--primary2);
}
.ins-sum-label { font-size: 14px; font-weight: 800; color: var(--primary2); }
.ins-sum-val   { font-size: 18px; font-weight: 900; color: var(--primary2); }


/* Saved list badge for insurance */
.saved-badge-ins {
  background: #eef4fb; color: #2471a3;
  border: 1px solid #c8ddf0;
  font-size: 10px; font-weight: 700;
  padding: 2px 7px; border-radius: 20px;
  margin-right: 6px; white-space: nowrap;
}

/* ══════════════════════════════════════════════════════════
   EMAIL REPORT BUTTON (sidebar)
══════════════════════════════════════════════════════════ */
.btn-email-report {
  display: flex; flex-direction: column;
  align-items: center; gap: 3px;
  background: #fff; color: var(--primary);
  border: none; border-radius: 10px;
  padding: 10px 6px; cursor: pointer;
  font-size: 11px; font-weight: 600;
  transition: background 0.15s;
  min-width: 48px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.btn-email-report:active { background: #eef2f7; }
.btn-email-report .btn-icon { font-size: 20px; }
.btn-email-report .btn-lbl  { font-size: 9px; font-weight: 700; line-height: 1; }

/* ══════════════════════════════════════════════════════════
   CONTACTS SECTION (settings panel)
══════════════════════════════════════════════════════════ */
.contacts-add-row {
  display: flex; gap: 8px; align-items: center;
  margin-bottom: 10px; flex-wrap: wrap;
}
.contacts-add-row input {
  flex: 1; min-width: 120px;
  padding: 8px 10px; border: 1.5px solid #c8d8ee;
  border-radius: 8px; font-size: 13px;
  font-family: inherit; outline: none;
}
.contacts-add-row input:focus { border-color: var(--primary); }
.btn-contact-add {
  padding: 8px 14px; background: var(--primary); color: white;
  border: none; border-radius: 8px; font-size: 13px;
  font-weight: 700; cursor: pointer; white-space: nowrap;
  font-family: inherit;
}
.btn-contact-add:active { background: var(--primary-dark, #163d5c); }
.contacts-list { display: flex; flex-direction: column; gap: 4px; margin-bottom: 6px; }
.contacts-empty { font-size: 12px; color: #999; font-style: italic; padding: 4px 2px; }
.contact-row {
  display: flex; align-items: center; gap: 8px;
  background: #f5f8fc; border: 1px solid #dde8f5;
  border-radius: 8px; padding: 7px 10px;
}
.contact-name  { font-size: 13px; font-weight: 600; color: #1a3c6e; flex: 0 0 auto; }
.contact-email { font-size: 12px; color: #555; flex: 1; overflow: hidden; text-overflow: ellipsis; }
.contact-del {
  background: none; border: none; cursor: pointer;
  color: #c00; font-size: 14px; padding: 0 2px; line-height: 1;
  opacity: 0.6;
}
.contact-del:hover { opacity: 1; }

/* ══════════════════════════════════════════════════════════
   EMAIL MODAL
══════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 9000;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.modal-box {
  background: white; border-radius: 14px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.22);
  display: flex; flex-direction: column;
  max-height: 90vh; overflow: hidden;
}
.email-modal-box { width: 100%; max-width: 520px; }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px 12px; border-bottom: 1px solid #e8edf5;
}
.modal-title  { font-size: 16px; font-weight: 700; color: var(--primary); }
.modal-close  {
  background: none; border: none; font-size: 18px;
  cursor: pointer; color: #888; padding: 0 2px; line-height: 1;
}
.modal-close:hover { color: #333; }
.email-modal-body { padding: 18px 20px; overflow-y: auto; flex: 1; }
.email-field-group { margin-bottom: 14px; }
.email-label {
  display: block; font-size: 11px; font-weight: 700;
  color: var(--primary); text-transform: uppercase;
  letter-spacing: 0.5px; margin-bottom: 5px;
}
.email-to-wrap {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.email-or { font-size: 11px; color: #999; flex-shrink: 0; }
.email-select, .email-input {
  width: 100%; padding: 9px 11px;
  border: 1.5px solid #c8d8ee; border-radius: 8px;
  font-size: 13px; font-family: inherit; outline: none;
  background: white;
}
.email-to-wrap .email-select { flex: 1 1 180px; width: auto; }
.email-to-wrap .email-input  { flex: 1 1 160px; width: auto; }
.email-select:focus, .email-input:focus { border-color: var(--primary); }
.email-textarea {
  width: 100%; padding: 9px 11px;
  border: 1.5px solid #c8d8ee; border-radius: 8px;
  font-size: 13px; font-family: inherit; outline: none;
  resize: vertical; box-sizing: border-box;
}
.email-textarea:focus { border-color: var(--primary); }
.email-attach-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; background: #f5f8fc;
  border: 1px solid #dde8f5; border-radius: 8px;
}
.email-attach-label { display: flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }
.email-attach-note  { font-size: 11px; color: #888; font-style: italic; }
.modal-footer {
  display: flex; gap: 10px; justify-content: flex-end;
  padding: 12px 20px 16px; border-top: 1px solid #e8edf5;
}
.btn-modal-cancel {
  padding: 9px 18px; border: 1.5px solid #c8d8ee;
  background: white; color: #555; border-radius: 8px;
  font-size: 13px; font-weight: 600; cursor: pointer;
  font-family: inherit;
}
.btn-modal-send {
  padding: 9px 22px; background: #1a5c38; color: white;
  border: none; border-radius: 8px;
  font-size: 13px; font-weight: 700; cursor: pointer;
  font-family: inherit; transition: background 0.15s;
}
.btn-modal-send:hover    { background: #0f3d24; }
.btn-modal-send:disabled { background: #999; cursor: not-allowed; }

/* Premium PDF cover — full-bleed page (no side bar, no padding, no page number) */
.pdf-cover-premium { padding: 0 !important; }
.pdf-cover-premium::before { display: none; }
.pdf-cover-premium .pdf-pgnum { display: none; }
.pdf-exporting .pdf-cover-premium { padding: 0 !important; }
/* Review sidebar Cover button — teal accent while premium is active */
#btnCoverStyle.cover-premium-on { border-color: #4ADBCC; color: #0d9488; box-shadow: 0 0 0 2px rgba(74,219,204,0.25); }

/* Calc rounding selector */
.calc-round-btn {
  padding: 4px 10px;
  border-radius: 7px;
  border: 1.5px solid var(--border);
  background: var(--cardface);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
}
.calc-round-btn.active {
  background: var(--primary2);
  border-color: var(--primary2);
  color: #fff;
}

/* First section label (NEW INSPECTION) also sits on the photo fade */
.landing-sub + .section-label {
  color: #fff;
  text-shadow: 0 1px 6px rgba(10,25,45,0.55);
}

/* ── Review mark (saved-inspection cards): empty → ready → verified ── */
.saved-ready {
  display: inline-flex; align-items: center; justify-content: center; vertical-align: middle;
  width: 18px; height: 18px; margin-left: 10px; padding: 0; box-sizing: border-box;
  border: 1.5px solid #9aa7b5; border-radius: 4px; background: #fff; color: #fff; cursor: pointer;
}
.saved-ready.st-ready { background: #15803d; border-color: #15803d; }
.saved-ready.st-done  { background: var(--primary); border-color: var(--primary); }
.saved-ready:active { transform: scale(0.92); }
.saved-ready-badge {
  display: inline-block; margin-left: 8px; padding: 2px 8px; border-radius: 10px; vertical-align: 2px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.3px; text-transform: uppercase;
}
.saved-ready-badge.badge-ready { background: #dcfce7; color: #166534; }
.saved-ready-badge.badge-done  { background: #dbe6f5; color: var(--primary); }
