*{ box-sizing:border-box; }
[hidden]{ display:none !important; }

:root{
  /* Palette — change colors here and every page follows */
  --blue:#0d47a1;
  --blue-dark:#08367c;
  --blue-soft:#eef3fb;
  --gold:#f2b705;
  --green:#2e8b57;
  --text:#1f2937;
  --sub:#4b5563;
  --muted:#5f6b7a;
  --line:#e4e8ef;
  --page-bg:#f4f6f9;
  --card-bg:rgba(255,255,255,0.94);
  --glass:rgba(255,255,255,0.80);
  --shadow:0 8px 22px rgba(0,0,0,0.08);
  --safe-bottom:env(safe-area-inset-bottom, 0px);
}

html,body{
  margin:0;
  padding:0;
  min-height:100%;
  font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;
  color:var(--text);
  background:var(--page-bg);
}

body{
  padding:12px 12px calc(92px + var(--safe-bottom));
  position:relative;
  overflow-x:hidden;
  -webkit-text-size-adjust:100%;
}
body.lock{ overflow:hidden; }

body::before{
  content:"";
  position:fixed;
  inset:0;
  background:
    linear-gradient(to bottom, rgba(255,255,255,0.25), rgba(255,255,255,0.55)),
    url("bg.webp") center 70% / cover no-repeat;
  z-index:0;
  pointer-events:none;
}
body::after{
  content:"";
  position:fixed;
  bottom:0; left:0; right:0;
  height:120px;
  background:linear-gradient(to top, rgba(255,255,255,0.7), transparent);
  z-index:1;
  pointer-events:none;
}

.app{
  max-width:480px;
  margin:0 auto;
  position:relative;
  z-index:2;
  min-height:100vh;
}

.sr-only{
  position:absolute; width:1px; height:1px; padding:0; margin:-1px;
  overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0;
}

a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, summary:focus-visible{
  outline:3px solid #7aa7ff;
  outline-offset:2px;
}

/* ---------- Hero ---------- */
.hero{
  background:var(--glass);
  border:1px solid rgba(255,255,255,0.7);
  border-radius:20px;
  padding:14px;
  text-align:center;
  box-shadow:var(--shadow);
  backdrop-filter:blur(8px);
  -webkit-backdrop-filter:blur(8px);
  margin-bottom:10px;
}
.hero img{
  width:70px; height:70px;
  display:block;
  margin:0 auto 8px;
}
.hero h1{ margin:6px 0; font-size:18px; color:var(--blue); line-height:1.2; }
.hero p{ margin:0; font-size:13px; color:var(--muted); }

/* ---------- Search bar ---------- */
.search{
  background:rgba(255,255,255,0.90);
  padding:12px;
  border-radius:20px;
  margin:10px 0 12px;
  box-shadow:var(--shadow);
  backdrop-filter:blur(8px);
  -webkit-backdrop-filter:blur(8px);
  position:sticky;
  top:calc(10px + env(safe-area-inset-top, 0px));
  z-index:10;
}
@media (max-height:620px){ .search{ position:static; } }

.field, .textarea{
  width:100%;
  padding:12px 13px;
  border-radius:12px;
  border:1px solid #d7dde8;
  background:#fff;
  font-size:16px; /* 16px stops iOS from zooming on focus */
  font-family:inherit;
  color:var(--text);
  outline:none;
  transition:border-color .15s ease, box-shadow .15s ease;
}
.field:focus, .textarea:focus{
  border-color:#7aa7ff;
  box-shadow:0 0 0 3px rgba(13,71,161,0.12);
}

.actions{ display:flex; gap:8px; margin-top:8px; }

.btn{
  appearance:none;
  border:none;
  border-radius:12px;
  padding:0 14px;
  min-height:44px;
  font-size:14px;
  font-weight:700;
  font-family:inherit;
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:6px;
  text-decoration:none;
}
.btn:disabled{ opacity:.6; cursor:not-allowed; }
.btn svg{ width:16px; height:16px; flex:0 0 auto; }
.btn-primary{ background:var(--blue); color:#fff; flex:1; }
.btn-primary:active{ background:var(--blue-dark); }
.btn-secondary{ background:var(--blue-soft); color:var(--blue); }
.btn-secondary[aria-pressed="true"]{ background:var(--blue); color:#fff; }

.status-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  margin-top:8px;
}
#status{ font-size:13px; color:var(--muted); min-height:20px; flex:1; }

.seg{ display:inline-flex; background:var(--blue-soft); border-radius:10px; padding:2px; flex:0 0 auto; }
.seg button{
  appearance:none; border:none; background:transparent; color:var(--blue);
  font:inherit; font-size:13px; font-weight:700;
  padding:0 12px; min-height:36px; border-radius:8px; cursor:pointer;
}
.seg button[aria-pressed="true"]{ background:var(--blue); color:#fff; }

/* ---------- Result cards ---------- */
.card{
  background:var(--card-bg);
  border:1px solid var(--line);
  border-radius:16px;
  padding:12px;
  margin-bottom:10px;
  box-shadow:var(--shadow);
}
.name{ font-size:16px; font-weight:800; line-height:1.3; margin-bottom:4px; word-break:break-word; }
.owner{ font-size:14px; color:var(--sub); margin-bottom:2px; }
.nature{ font-size:14px; color:#374151; margin-bottom:6px; }
.addr{ font-size:13px; color:var(--muted); line-height:1.45; word-break:break-word; margin-bottom:6px; }
.notes{ font-size:13px; color:var(--sub); font-style:italic; margin-bottom:6px; word-break:break-word; }

.chips{ display:flex; flex-wrap:wrap; gap:6px; margin:0 0 8px; }
.chip{
  display:inline-block;
  font-size:12px; font-weight:700;
  padding:3px 9px;
  border-radius:999px;
  background:#eef0f4; color:#374151;
  line-height:1.4;
}
.chip-green{ background:#dcfce7; color:#14532d; }
.chip-amber{ background:#fef3c7; color:#78350f; }
.chip-blue{ background:#dbeafe; color:#1e3a8a; }

.banner{
  display:block; width:100%; height:150px;
  border:0; padding:0; margin:0 0 8px;
  border-radius:12px; overflow:hidden; position:relative;
  background:#e9eef6; cursor:zoom-in;
}
.banner img{ width:100%; height:100%; object-fit:cover; display:block; }
.count{
  position:absolute; right:8px; bottom:8px;
  background:rgba(0,0,0,0.65); color:#fff;
  font-size:12px; font-weight:700;
  padding:3px 8px; border-radius:999px;
}
.thumbs{ display:flex; gap:6px; margin:0 0 8px; }
.thumb{
  width:64px; height:64px; padding:0; border:1px solid var(--line);
  border-radius:10px; overflow:hidden; position:relative;
  background:#e9eef6; cursor:pointer; flex:0 0 auto;
}
.thumb img{ width:100%; height:100%; object-fit:cover; display:block; }
.thumb .more-badge{
  position:absolute; inset:0; background:rgba(0,0,0,0.55); color:#fff;
  display:flex; align-items:center; justify-content:center;
  font-weight:800; font-size:16px;
}

.btns{ margin-top:8px; display:flex; gap:6px; flex-wrap:wrap; }
.link-btn{
  min-height:44px; padding:0 14px;
  border-radius:10px;
  font-size:13px; font-weight:700; font-family:inherit;
  text-decoration:none; cursor:pointer;
  display:inline-flex; align-items:center; justify-content:center;
  border:none;
}
.link-btn.map{ background:var(--blue); color:#fff; }
.link-btn.dir{ background:#e0ecff; color:var(--blue); }
.link-btn.inspect, .link-btn.copy{ background:var(--blue-soft); color:var(--blue); }

.empty{
  background:var(--card-bg);
  border:1px dashed #cfd7e3;
  border-radius:16px;
  padding:18px 14px;
  text-align:center;
  color:var(--sub);
  font-size:14px;
  line-height:1.5;
}
.more{ width:100%; margin:2px 0 12px; }

/* ---------- Map view ---------- */
.map-wrap{ margin-bottom:12px; }
#map{
  height:62vh; min-height:320px;
  border-radius:16px; overflow:hidden;
  border:1px solid var(--line);
  box-shadow:var(--shadow);
  background:#e9eef6;
}
.map-note{ font-size:13px; color:var(--muted); margin:8px 4px 0; }
.pop{ font-size:13px; line-height:1.4; min-width:170px; }
.pop strong{ display:block; font-size:14px; margin-bottom:2px; }
.pop .pop-btns{ display:flex; gap:6px; flex-wrap:wrap; margin-top:8px; }
.pop a{
  display:inline-flex; align-items:center; min-height:36px; padding:0 10px;
  border-radius:8px; background:var(--blue-soft); color:var(--blue) !important;
  font-weight:700; text-decoration:none;
}

/* ---------- Photo viewer ---------- */
.viewer{
  position:fixed; inset:0;
  background:rgba(0,0,0,0.92);
  display:flex; align-items:center; justify-content:center;
  z-index:100;
}
.v-stage{
  position:absolute; inset:56px 0 64px;
  overflow:auto;
  display:flex; align-items:center; justify-content:center;
  -webkit-overflow-scrolling:touch;
}
.v-stage img{
  max-width:100%; max-height:100%;
  border-radius:6px;
  cursor:zoom-in;
  margin:auto;
}
.v-stage img.zoomed{ max-width:none; max-height:none; width:220%; cursor:zoom-out; }
.v-close, .v-nav{
  position:absolute; z-index:2;
  width:48px; height:48px;
  border:none; border-radius:50%;
  background:rgba(255,255,255,0.16); color:#fff;
  font-size:26px; line-height:1; cursor:pointer;
  display:flex; align-items:center; justify-content:center;
}
.v-close{ top:calc(8px + env(safe-area-inset-top, 0px)); right:8px; font-size:20px; }
.v-nav{ top:50%; transform:translateY(-50%); }
.v-prev{ left:8px; }
.v-next{ right:8px; }
.v-count, .v-cap{
  position:absolute; left:0; right:0; text-align:center; color:#fff; z-index:2;
  padding:0 64px;
}
.v-count{ top:calc(18px + env(safe-area-inset-top, 0px)); font-size:14px; font-weight:700; }
.v-cap{ bottom:calc(18px + var(--safe-bottom)); font-size:13px; opacity:.85; }
.spinner{
  position:absolute; width:36px; height:36px; margin:auto;
  border:4px solid rgba(255,255,255,0.25); border-top-color:#fff;
  border-radius:50%; animation:spin .8s linear infinite;
}
@keyframes spin{ to{ transform:rotate(360deg); } }
@media (prefers-reduced-motion:reduce){ .spinner{ animation-duration:2s; } }

/* ---------- Ads ---------- */
.ad-slot{ margin:6px 0 14px; text-align:center; overflow:hidden; min-height:0; }
.ad-slot .ad-label{ display:block; font-size:11px; color:var(--muted); margin-bottom:4px; }
.ad-slot:has(ins[data-ad-status="unfilled"]){ display:none; }

/* ---------- About / footer ---------- */
.about{
  background:rgba(255,255,255,0.92);
  border:1px solid var(--line);
  border-radius:16px;
  padding:16px;
  margin-top:16px;
  box-shadow:var(--shadow);
}
.about h2{ margin:0 0 8px; font-size:17px; color:var(--blue); }
.about h3{ margin:16px 0 6px; font-size:15px; color:var(--blue); }
.about p{ margin:0 0 10px; font-size:14px; line-height:1.55; color:var(--sub); max-width:70ch; }
.about details{ border-top:1px solid var(--line); padding:10px 0; }
.about summary{ cursor:pointer; font-weight:700; font-size:14px; color:var(--text); }
.about details p{ margin:8px 0 0; }
.foot{ text-align:center; font-size:13px; color:var(--muted); margin:14px 0 6px; }
.foot a{ color:var(--blue); font-weight:700; text-decoration:none; padding:8px 6px; display:inline-block; }

/* ---------- Toast ---------- */
.toast{
  position:fixed; left:50%; transform:translateX(-50%);
  bottom:calc(86px + var(--safe-bottom));
  background:rgba(17,24,39,0.92); color:#fff;
  font-size:13px; font-weight:700;
  padding:10px 16px; border-radius:999px; z-index:60;
  max-width:calc(100% - 32px);
}

/* ---------- Bottom nav ---------- */
.nav{
  position:fixed;
  bottom:calc(10px + var(--safe-bottom));
  left:50%;
  transform:translateX(-50%);
  width:calc(100% - 24px);
  max-width:480px;
  display:flex;
  justify-content:space-around;
  background:rgba(255,255,255,0.96);
  border:1px solid rgba(255,255,255,0.9);
  border-radius:18px;
  padding:6px 8px;
  box-shadow:0 10px 24px rgba(0,0,0,0.10);
  z-index:20;
  backdrop-filter:blur(10px);
  -webkit-backdrop-filter:blur(10px);
}
.nav a{
  flex:1;
  text-decoration:none;
  color:var(--muted);
  display:flex; flex-direction:column; align-items:center; gap:3px;
  padding:7px 6px;
  border-radius:14px;
  font-size:12px;
  font-weight:700;
}
.nav a.active{ color:var(--blue); background:var(--blue-soft); }
.nav svg{ width:22px; height:22px; display:block; }

/* ---------- Inspection form ---------- */
.form-card{
  background:rgba(255,255,255,0.90);
  border:1px solid rgba(255,255,255,0.75);
  border-radius:22px;
  box-shadow:var(--shadow);
  padding:14px;
  backdrop-filter:blur(8px);
  -webkit-backdrop-filter:blur(8px);
}
.form-title{ margin:0 0 14px; font-size:17px; font-weight:800; color:var(--blue); }
.label{ display:block; font-size:13px; font-weight:700; color:#475569; margin:0 0 6px; }
.req{ color:#b91c1c; }
.form-card .field, .form-card .textarea{ margin-bottom:12px; }
.textarea{ min-height:90px; resize:vertical; }
.row{ display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.form-actions{ display:flex; flex-direction:column; gap:10px; margin-top:4px; }
.btn-location{ background:var(--gold); color:#1f2937; }
.btn-save{ background:var(--green); color:#fff; }
.btn-map{ background:var(--blue-soft); color:var(--blue); }
.photo-add{ background:var(--blue-soft); color:var(--blue); width:100%; margin-bottom:10px; }
.photo-grid{ display:grid; grid-template-columns:repeat(3,1fr); gap:8px; margin-bottom:12px; }
.photo-item{
  position:relative; aspect-ratio:1/1;
  border-radius:12px; overflow:hidden;
  border:1px solid #d7dde8; background:#fff;
}
.photo-item img{ width:100%; height:100%; object-fit:cover; display:block; }
.photo-remove{
  position:absolute; top:4px; right:4px;
  width:32px; height:32px;
  border:none; border-radius:50%;
  background:rgba(0,0,0,0.7); color:#fff;
  font-size:14px; padding:0; cursor:pointer;
}
.status-box{ margin-top:12px; font-size:14px; color:var(--muted); min-height:20px; }
.success{ color:#166534; font-weight:700; }
.error{ color:#b91c1c; font-weight:700; }

.queue-bar{
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  background:#fef3c7; color:#78350f;
  border:1px solid #fcd34d; border-radius:14px;
  padding:10px 12px; margin-bottom:12px;
  font-size:13px; font-weight:700;
}
.queue-bar .btn{ min-height:38px; padding:0 12px; background:#fff; color:#78350f; }

/* ---------- Plain content pages (privacy) ---------- */
.doc h1{ margin:0 0 6px; font-size:22px; color:var(--blue); }
.doc h2{ margin:20px 0 6px; font-size:16px; color:var(--blue); }
.doc p, .doc li{ font-size:14px; line-height:1.6; color:var(--sub); max-width:70ch; }
.doc ul{ padding-left:20px; margin:6px 0 10px; }
.doc a{ color:var(--blue); }
.doc .meta{ font-size:13px; color:var(--muted); margin:0 0 12px; }

@media (min-width:768px){
  body{ padding:20px 20px calc(100px + var(--safe-bottom)); }
  .app{ max-width:720px; }
  .nav{ max-width:720px; }
  .hero img{ width:86px; height:86px; }
  .hero h1{ font-size:24px; }
  .banner{ height:200px; }
}

/* Discover Calamba: responsive and accessibility improvements */
.skip-link {position:fixed;top:-100px;left:12px;z-index:1000;background:#fff;color:var(--blue);padding:12px 16px;border-radius:10px;font-weight:700;box-shadow:var(--shadow)}
.skip-link:focus{top:12px}
html{scroll-padding-top:165px}
#results{min-width:0}
@media (max-width:390px){
  .search{padding:10px}
  .actions{flex-wrap:wrap}
  .actions .btn-primary{flex:1 1 100%}
  .actions .btn-secondary{flex:1 1 calc(50% - 4px)}
  #scopeSeg{display:flex;width:100%}
  #scopeSeg button{flex:1;min-width:0;padding:5px 4px;font-size:12px}
  .status-row{align-items:flex-start}
  .status-row .seg button{padding:0 9px}
}
@media (min-width:860px){
  .app,.nav{max-width:1060px}
  .hero{padding:20px}
  .hero h1{font-size:28px}
  #results{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;align-items:start}
  #results .card{margin-bottom:0;height:100%}
  .form-card{max-width:780px;margin-inline:auto}
  .form-actions{flex-direction:row;flex-wrap:wrap}
  .form-actions > *{flex:1}
}
@media (min-width:1200px){
  .app,.nav{max-width:1160px}
  #results{grid-template-columns:repeat(3,minmax(0,1fr))}
}
@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{scroll-behavior:auto!important;transition-duration:0.01ms!important;animation-duration:0.01ms!important}
}

/* v2: user-selectable theme and interface refinements */
:root {color-scheme:light;--surface-input:#fff;--surface-focus:#f8fbff}
html[data-theme="dark"]{color-scheme:dark;--blue:#90bbff;--blue-dark:#abcaff;--blue-soft:#20385a;--gold:#f8c952;--green:#57b985;--text:#eef3fc;--sub:#c4d0df;--muted:#acbdd0;--line:#33445a;--page-bg:#101824;--card-bg:#1b2939;--glass:#1b2939ed;--shadow:0 12px 30px #030b1899;--surface-input:#121f2d;--surface-focus:#23354a}
html[data-theme="dark"] body::before{background:linear-gradient(180deg,#0d1724db,#0d1724f0),url("bg.webp") center 70%/cover no-repeat}
html[data-theme="dark"] body::after{background:linear-gradient(to top,#0d1724cc,transparent)}
html[data-theme="dark"] .hero,html[data-theme="dark"] .search,html[data-theme="dark"] .form-card{background:var(--glass);border-color:var(--line)}
html[data-theme="dark"] .field,html[data-theme="dark"] .textarea,html[data-theme="dark"] input,html[data-theme="dark"] textarea,html[data-theme="dark"] select{background:var(--surface-input);color:var(--text);border-color:var(--line)}
html[data-theme="dark"] .card,html[data-theme="dark"] .about,html[data-theme="dark"] .nav,html[data-theme="dark"] .doc,html[data-theme="dark"] details,html[data-theme="dark"] .map-note{background:var(--card-bg);color:var(--text);border-color:var(--line)}
html[data-theme="dark"] .name,html[data-theme="dark"] .form-title,html[data-theme="dark"] .hero h1,html[data-theme="dark"] .doc h1,html[data-theme="dark"] .doc h2{color:var(--blue)}
html[data-theme="dark"] .label,html[data-theme="dark"] .addr,html[data-theme="dark"] .owner,html[data-theme="dark"] .nature,html[data-theme="dark"] .notes{color:var(--sub)}
html[data-theme="dark"] .nav a,html[data-theme="dark"] .seg button,html[data-theme="dark"] .link-btn{color:var(--text)}
html[data-theme="dark"] .nav a.active{background:var(--blue-soft);color:var(--blue)}
html[data-theme="dark"] .btn-primary{background:#356bcb;color:#fff}
html[data-theme="dark"] .btn-secondary,html[data-theme="dark"] .btn-map,html[data-theme="dark"] .photo-add{background:var(--blue-soft);color:var(--blue)}
html[data-theme="dark"] .queue-bar{background:#443a1e;color:#ffe0a0;border-color:#755d30}
html[data-theme="dark"] .queue-bar .btn{background:#2d3540;color:#ffe0a0}
html[data-theme="dark"] .success{color:#7ee2a9}html[data-theme="dark"] .error{color:#ff9292}
html[data-theme="dark"] .skip-link{background:var(--card-bg)}
.hero{position:relative;padding-top:18px}
.theme-toggle{display:inline-flex;align-items:center;gap:7px;min-height:38px;padding:7px 12px;border:1px solid var(--line);border-radius:999px;background:var(--card-bg);color:var(--text);cursor:pointer;font:600 13px system-ui;box-shadow:var(--shadow)}
.theme-toggle:focus-visible{outline:3px solid #7aa7ff;outline-offset:2px}
.theme-toolbar{display:flex;justify-content:flex-end;margin-bottom:10px}
.search,.form-card,.about{border:1px solid var(--line)}
#status:empty{display:none}
@media(min-width:860px){.hero{border-radius:24px}.search{border-radius:24px}.card{border-radius:18px}}

/* v3: Logo is the theme switch. No stretched theme toolbar. */
.logo-theme-button{display:inline-flex;align-items:center;justify-content:center;padding:4px;margin:0 auto;background:transparent;border:2px solid transparent;border-radius:50%;cursor:pointer;line-height:0;transition:border-color .2s,transform .2s}
.logo-theme-button img{display:block;margin:0;width:70px;height:70px;object-fit:contain}
.logo-theme-button:hover{border-color:var(--blue);transform:scale(1.04)}
.logo-theme-button:focus-visible{outline:3px solid #7aa7ff;outline-offset:3px}
@media(min-width:600px){.logo-theme-button img{width:86px;height:86px}}
@media(prefers-reduced-motion:reduce){.logo-theme-button{transition:none}.logo-theme-button:hover{transform:none}}



/* v11: a single, shared footer and no legacy layout overrides */
body{padding-bottom:calc(105px + var(--safe-bottom));}
.app{min-height:0;width:100%;}
.inspection-page .app{max-width:760px;min-height:0;}
.inspection-page .hero,.inspection-page .form-card{width:100%;max-width:760px;margin-left:auto;margin-right:auto;min-width:0;}
.inspection-page .form-card{padding:clamp(16px,3vw,28px);}
.inspection-page .form-card .row{grid-template-columns:repeat(2,minmax(0,1fr));}
.inspection-page .form-card .row>*{min-width:0;}
.inspection-page .form-card input,.inspection-page .form-card textarea{max-width:100%;min-width:0;}
.inspection-page .form-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;}
.inspection-page .form-actions .btn-save{grid-column:1/-1;}
.inspection-page .form-actions>*{width:100%;min-width:0;}
/* Single cohesive footer, independent of Search/form and background overlay. */
.jc-bottom{position:relative;z-index:2;display:block;clear:both;box-sizing:border-box;width:min(100% - 24px,1160px);max-width:1160px;margin:42px auto calc(96px + var(--safe-bottom));padding:30px clamp(18px,3vw,38px) 18px;background:#263445;color:#edf2fa;border:1px solid #3a4a60;border-radius:22px;box-shadow:0 14px 34px rgba(0,0,0,.17);}
.jc-footer-shell{display:grid;grid-template-columns:minmax(0,1fr) 176px;gap:clamp(20px,3vw,42px);align-items:start;width:100%;}
.jc-main-col,.jc-links-col,.jc-help-card{min-width:0;}
.jc-help-card{display:grid;grid-template-columns:minmax(165px,.72fr) minmax(0,1.6fr);gap:clamp(16px,2vw,32px);align-items:start;}
.jc-help-intro small{display:block;margin:3px 0 9px;font-size:10px;font-weight:800;letter-spacing:.15em;text-transform:uppercase;color:#a6c8ff;}
.jc-help-intro h2{margin:0 0 10px;color:#f5f7fe;font-size:clamp(20px,2vw,25px);line-height:1.23;}
.jc-help-intro p{margin:0;font-size:13px;line-height:1.65;color:#ced7e5;}
.jc-faq-list{display:grid;gap:9px;min-width:0;}
.jc-faq-list details{display:block;width:100%;min-width:0;overflow:hidden;background:#34465e;border:1px solid #485b76;border-radius:11px;color:#fff;}
.jc-faq-list summary{display:list-item;cursor:pointer;list-style:revert;padding:13px 14px 13px 19px;font-size:13px;font-weight:700;line-height:1.4;color:#f7faff;}
.jc-faq-list details p{padding:0 16px 15px 18px;margin:0;color:#d5e0ed;font-size:13px;line-height:1.65;}
.jc-links-col{display:flex;flex-direction:column;align-items:flex-start;gap:16px;min-width:0;}
.jc-link-list{display:flex;flex-direction:column;gap:13px;}
.jc-link-list a{color:#f3d09a;text-decoration:none;font-size:14px;line-height:1.4;}
.jc-link-list a:hover,.jc-footer-note a:hover{text-decoration:underline;}
.jc-footer-note{margin-top:26px;padding-top:17px;border-top:1px solid #46566b;color:#d9e1ec;font-size:12px;line-height:1.7;}
.jc-footer-note p{margin:0;}
.jc-footer-note strong{color:#fff;}
.jc-footer-note a{color:#f3d09a;font-weight:700;text-decoration:none;}
html[data-theme="dark"] .jc-bottom{background:#172332;border-color:#36485e;color:#f3f6fc;}
html[data-theme="dark"] .jc-faq-list details{background:#22334a;border-color:#3b526e;}
html[data-theme="dark"] .jc-footer-note{border-color:#3b526e;}
.doc{padding:clamp(16px,3vw,28px);background:var(--card-bg);border:1px solid var(--line);border-radius:20px;box-shadow:var(--shadow);}
.doc a{color:var(--blue);}
@media (max-width:850px){.jc-footer-shell{grid-template-columns:minmax(0,1fr)}.jc-links-col{padding-top:14px;border-top:1px solid #46566b}.jc-link-list{flex-direction:row;flex-wrap:wrap;gap:14px 23px}}
@media (max-width:650px){.jc-help-card{grid-template-columns:minmax(0,1fr);gap:16px}.jc-bottom{padding:24px 18px 18px;margin-top:26px;border-radius:18px}.jc-help-intro h2{font-size:23px}.inspection-page .form-card .row{grid-template-columns:minmax(0,1fr)}.inspection-page .form-actions{grid-template-columns:minmax(0,1fr)}.inspection-page .form-actions .btn-save{grid-column:auto}}
@media (prefers-reduced-motion:reduce){.jc-bottom *{transition:none!important;}}

/* FAQ narration controls: no layout impact on inspection forms */
.jc-voice-controls{display:flex;align-items:center;flex-wrap:wrap;gap:12px;margin:0 0 10px}
.jc-voice-mute{border:1px solid rgba(160,180,215,.45);background:rgba(135,170,220,.12);color:inherit;border-radius:999px;padding:8px 12px;font:700 13px system-ui;cursor:pointer;min-height:36px}
.jc-voice-note{font-size:12px;opacity:.75}
.jc-faq-list details.is-speaking{border-color:var(--blue,#7eb5ff);box-shadow:0 0 0 1px var(--blue,#7eb5ff)}
@media(max-width:560px){.jc-voice-controls{gap:6px}.jc-voice-note{font-size:11px}}

/* Inspector v13: compact, centered FAQ selector */
.jc-footer-shell{display:grid!important;grid-template-columns:minmax(210px,.8fr) minmax(0,1.9fr) minmax(165px,.7fr)!important;align-items:start!important;gap:clamp(16px,2vw,30px)!important}
.jc-footer-shell > *{min-width:0!important}
.jc-faq-select{display:block;width:100%;max-width:100%;min-height:46px;border:1px solid #637b98;background:#354961;color:#fff;border-radius:12px;padding:10px 12px;font:600 14px system-ui;margin:12px 0}
.jc-faq-list{display:block!important;min-width:0!important}
.jc-faq-list details:not([open]){display:none!important}
.jc-faq-list details[open]{display:block!important;width:100%!important;margin:0!important}
.jc-faq-list details[open] summary{display:none!important}
.jc-faq-list details[open] p{padding:14px 16px!important;margin:0!important;overflow-wrap:anywhere}
.jc-voice-controls{display:flex!important;flex-wrap:wrap;align-items:center;gap:8px}
@media(max-width:900px){.jc-footer-shell{grid-template-columns:minmax(0,1fr)!important}.jc-links-col{grid-column:auto!important;align-items:flex-start!important}.jc-link-list{justify-items:start!important}}

/* v15 tested footer grid: no extra columns, no narrow FAQ strip */
.jc-bottom{width:min(calc(100% - 24px),1160px)!important;margin:36px auto calc(106px + var(--safe-bottom))!important;padding:26px clamp(18px,3vw,34px)!important;overflow:visible!important}
.jc-footer-shell{display:grid!important;grid-template-columns:minmax(0,1fr) minmax(180px,230px)!important;gap:clamp(20px,3vw,38px)!important;align-items:start!important;width:100%!important}
.jc-main-col{min-width:0!important;width:100%!important}
.jc-help-card{display:grid!important;grid-template-columns:minmax(190px,.85fr) minmax(300px,1.5fr)!important;gap:clamp(18px,2vw,32px)!important;align-items:start!important;width:100%!important}
.jc-faq-area{min-width:0;width:100%;display:flex;flex-direction:column;gap:10px}
.jc-voice-controls{display:flex!important;align-items:center!important;flex-wrap:wrap!important;gap:10px!important;margin:0!important}
.jc-voice-note{white-space:normal;max-width:220px;line-height:1.5}
.jc-voice-mute{white-space:nowrap;flex:0 0 auto;min-width:106px}
.jc-faq-select{width:100%!important;max-width:none!important;min-width:0!important;margin:0!important;min-height:46px}
.jc-faq-list{min-width:0!important;width:100%!important}
.jc-faq-list details[open]{width:100%!important}
.jc-links-col{min-width:0!important;width:100%!important;padding:0!important;border:0!important}
.jc-link-list{display:flex!important;flex-direction:column!important;flex-wrap:nowrap!important;gap:12px!important}
.jc-footer-note{margin-top:26px!important}
@media(max-width:1050px){.jc-footer-shell{grid-template-columns:minmax(0,1fr)!important}.jc-links-col{padding-top:18px!important;border-top:1px solid #46566b!important}.jc-link-list{flex-direction:row!important;flex-wrap:wrap!important;gap:12px 22px!important}}
@media(max-width:690px){.jc-help-card{grid-template-columns:minmax(0,1fr)!important}.jc-bottom{padding:22px 18px!important}.jc-voice-note{max-width:none}}


/* ---------- BPTFO Portal Home Button & Mini Chatbot ---------- */
.hero-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  gap: 8px;
}
.home-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(13, 71, 161, 0.08);
  transition: transform 0.15s, background 0.15s, border-color 0.15s;
}
.home-pill-btn:hover {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
  transform: translateY(-1px);
}
.home-pill-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
html[data-theme="dark"] .home-pill-btn {
  background: var(--blue-soft);
  color: var(--blue);
  border-color: var(--line);
}
html[data-theme="dark"] .home-pill-btn:hover {
  background: #356bcb;
  color: #fff;
}

/* Mini Chatbot Floating Widget */
.bptfo-chat-fab {
  position: fixed;
  right: 16px;
  bottom: calc(82px + var(--safe-bottom, 0px));
  z-index: 90;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 16px;
  border-radius: 999px;
  background: linear-gradient(135deg, #0d47a1, #1565c0);
  color: #fff;
  border: 2px solid rgba(255,255,255,0.85);
  box-shadow: 0 10px 25px rgba(13, 71, 161, 0.32);
  font: 700 13px system-ui, -apple-system, sans-serif;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}
.bptfo-chat-fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(13, 71, 161, 0.42);
}
.bptfo-chat-fab svg {
  width: 19px;
  height: 19px;
  flex-shrink: 0;
}
.bptfo-chat-panel {
  position: fixed;
  right: 16px;
  bottom: calc(138px + var(--safe-bottom, 0px));
  width: min(360px, calc(100vw - 32px));
  max-height: min(510px, calc(100vh - 180px));
  background: var(--card-bg, #fff);
  color: var(--text, #1f2937);
  border: 1px solid var(--line, #e4e8ef);
  border-radius: 20px;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.22);
  z-index: 95;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.bptfo-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 15px;
  background: linear-gradient(135deg, #0d47a1, #1565c0);
  color: #fff;
}
.bptfo-chat-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 800;
}
.bptfo-chat-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(242, 183, 5, 0.25);
  color: #ffe082;
  border: 1px solid rgba(242, 183, 5, 0.5);
}
.bptfo-chat-close {
  background: rgba(255,255,255,0.16);
  color: #fff;
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.bptfo-chat-messages {
  padding: 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-height: 190px;
  max-height: 270px;
  font-size: 13px;
  line-height: 1.45;
}
.bptfo-msg {
  padding: 9px 12px;
  border-radius: 14px;
  max-width: 88%;
  word-wrap: break-word;
}
.bptfo-msg.bot {
  align-self: flex-start;
  background: var(--blue-soft, #eef3fb);
  color: var(--text, #1f2937);
  border-bottom-left-radius: 4px;
}
.bptfo-msg.user {
  align-self: flex-end;
  background: #0d47a1;
  color: #fff;
  border-bottom-right-radius: 4px;
}
.bptfo-chat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 6px 12px 8px;
  border-top: 1px solid var(--line, #e4e8ef);
}
.bptfo-chip {
  appearance: none;
  border: 1px solid var(--line, #d7dde8);
  background: var(--surface-input, #fff);
  color: var(--blue, #0d47a1);
  border-radius: 999px;
  padding: 4px 10px;
  font: 600 11px system-ui, sans-serif;
  cursor: pointer;
}
.bptfo-chip:hover {
  background: var(--blue-soft, #eef3fb);
}
.bptfo-chat-form {
  display: flex;
  gap: 6px;
  padding: 8px 12px 11px;
  border-top: 1px solid var(--line, #e4e8ef);
  background: var(--card-bg, #fff);
}
.bptfo-chat-input {
  flex: 1;
  min-width: 0;
  padding: 8px 11px;
  border-radius: 10px;
  border: 1px solid var(--line, #d7dde8);
  background: var(--surface-input, #fff);
  color: var(--text, #1f2937);
  font: 13px system-ui, sans-serif;
}
.bptfo-chat-send {
  padding: 0 13px;
  border-radius: 10px;
  border: none;
  background: #0d47a1;
  color: #fff;
  font: 700 13px system-ui, sans-serif;
  cursor: pointer;
}
