/* LHA BRMA Map v26.1
   Refactored CSS split from the old single-file build.
   Website: https://lha.rustytech.uk
*/

html, body { height: 100%; margin: 0; font-family: Arial, sans-serif; }
    #map { height: 100%; width: 100%; }
    .panel {
      position: absolute; top: 12px; left: 12px; z-index: 1000;
      background: white; padding: 12px 14px; border-radius: 10px;
      box-shadow: 0 2px 12px rgba(0,0,0,.25); width: 390px; max-width: calc(100vw - 48px);
    }
    .panel h1 { font-size: 18px; margin: 0 0 8px; }
    .panel p { font-size: 13px; margin: 6px 0; line-height: 1.35; }
    .row { margin-top: 8px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
    label { font-size: 13px; font-weight: bold; }
    select, input, button { font-size: 14px; padding: 7px; border: 1px solid #bbb; border-radius: 6px; background: white; }
    input { width: 170px; }
    select { max-width: 245px; }
    button { cursor: pointer; background: #f3f3f3; }
    button:hover { background: #e8e8e8; }
    .legend {
      position: absolute; bottom: 22px; right: 12px; z-index: 1000;
      background: white; padding: 10px 12px; border-radius: 10px;
      box-shadow: 0 2px 12px rgba(0,0,0,.25); font-size: 12px;
    }
    .legend div { margin: 4px 0; }
    .swatch { display: inline-block; width: 18px; height: 12px; margin-right: 6px; vertical-align: middle; border: 1px solid #555; }
    .status { color: #444; font-size: 12px; max-height: 70px; overflow: auto; }
    .accessibility-note { font-size: 11px; color: #555; margin-top: 6px; line-height: 1.35; }
    .legend .legend-note { margin-top: 6px; color: #555; font-size: 11px; line-height: 1.3; }
    .legend-mode-row { margin: 8px 0 6px; }
    .legend-mode-btn {
      width: 100%;
      border: 1px solid #a8b3c2;
      background: #f8fbff;
      border-radius: 8px;
      padding: 7px 8px;
      font-size: 12px;
      font-weight: 700;
      cursor: pointer;
      text-align: center;
    }
    .legend-mode-btn.on {
      background: #e7f0ff;
      border-color: #5f8fd6;
      color: #073f8f;
    }
    .small { font-size: 11px; color: #666; }
    .popup-title { font-weight: bold; font-size: 15px; margin-bottom: 6px; }
    table.rates { border-collapse: collapse; width: 100%; font-size: 12px; }
    table.rates td { padding: 3px 6px; border-bottom: 1px solid #eee; }
    table.rates td:last-child { text-align: right; font-weight: bold; }
    .boundary-label {
      font-size: 11px; font-weight: bold; color: #111; background: rgba(255,255,255,.78);
      padding: 2px 4px; border-radius: 4px; border: 1px solid rgba(0,0,0,.35);
      text-align: center; white-space: nowrap;
    }
    .leaflet-tooltip.boundary-label:before { display: none; }
    .marker-label { font-weight: bold; }
    .selected-info { margin-top: 10px; padding: 8px; border: 1px solid #ddd; border-radius: 8px; background:#fafafa; }
    .selected-info .popup-title { margin-bottom: 4px; }
    .selected-info table.rates { font-size: 12px; }

    .titlebar { display:flex; align-items:center; justify-content:space-between; gap:10px; }
    .titlebar h1 { margin:0; }
    .collapse-btn { padding:4px 8px; min-width:34px; font-weight:bold; }
    .panel.collapsed { width:auto; max-width:calc(100vw - 48px); padding:10px 12px; }
    .panel.collapsed .panel-body { display:none; }
    .legend .legend-head { display:flex; align-items:center; justify-content:space-between; gap:10px; font-weight:bold; margin-bottom:4px; }
    .legend.collapsed .legend-body { display:none; }
    .legend.collapsed { padding:8px 10px; }
    @media (max-width: 600px) {
      .panel { width: calc(100vw - 44px); max-height: 72vh; overflow:auto; }
      .panel h1 { font-size:16px; }
      .row { gap:6px; }
      input { width: 160px; }
      .legend { max-width: calc(100vw - 48px); }
    }
  
/* Disclaimer modal */
.disclaimer-short {
  margin-top: 8px;
  font-size: 12px;
  color: #5f6368;
  line-height: 1.35;
}
.disclaimer-btn {
  margin-top: 8px;
  padding: 7px 10px;
  border: 1px solid #bbb;
  background: #f7f7f7;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
}
.disclaimer-btn:hover {
  background: #ececec;
}
.disclaimer-modal-backdrop {
  display: none;
  position: fixed;
  z-index: 99999;
  inset: 0;
  background: rgba(0,0,0,0.45);
  align-items: center;
  justify-content: center;
  padding: 18px;
}
.disclaimer-modal-backdrop.show {
  display: flex;
}
.disclaimer-modal {
  width: min(560px, 94vw);
  max-height: 82vh;
  overflow-y: auto;
  background: #fff;
  color: #222;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.35);
  padding: 18px 20px;
  line-height: 1.45;
}
.disclaimer-modal h2 {
  margin: 0 0 10px 0;
  font-size: 20px;
}
.disclaimer-modal p {
  margin: 0 0 10px 0;
}
.disclaimer-modal .close-disclaimer {
  float: right;
  border: 0;
  background: transparent;
  font-size: 26px;
  cursor: pointer;
  line-height: 1;
  padding: 0 2px;
}
.disclaimer-modal .disclaimer-actions {
  text-align: right;
  margin-top: 14px;
}
.disclaimer-modal .ok-disclaimer {
  padding: 8px 14px;
  border: 1px solid #999;
  background: #f2f2f2;
  border-radius: 6px;
  cursor: pointer;
}
@media (max-width: 600px) {
  .disclaimer-modal {
    font-size: 14px;
    padding: 16px;
  }
}


/* v15 additions */
.action-row-v15{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px}
.action-btn-v15{padding:7px 10px;border:1px solid #bbb;background:#f7f7f7;border-radius:6px;cursor:pointer;font-size:13px}
.action-btn-v15:hover{background:#ececec}
.share-status-v15{font-size:12px;color:#4b5563;margin-top:6px;line-height:1.3}
.sources-modal-backdrop{display:none;position:fixed;z-index:99999;inset:0;background:rgba(0,0,0,.45);align-items:center;justify-content:center;padding:18px}
.sources-modal-backdrop.show{display:flex}
.sources-modal{width:min(560px,94vw);max-height:82vh;overflow-y:auto;background:#fff;color:#222;border-radius:12px;box-shadow:0 12px 40px rgba(0,0,0,.35);padding:18px 20px;line-height:1.45}
.sources-modal h2{margin:0 0 10px 0;font-size:20px}
.sources-modal a{color:#075985;word-break:break-word}
.close-sources{float:right;border:0;background:transparent;font-size:26px;cursor:pointer;line-height:1;padding:0 2px}
.sources-actions{text-align:right;margin-top:14px}
.ok-sources{padding:8px 14px;border:1px solid #999;background:#f2f2f2;border-radius:6px;cursor:pointer}


/* v16 native image share */
.share-status-v16 {
  font-size: 12px;
  color: #4b5563;
  margin-top: 6px;
  line-height: 1.35;
}
.action-row-v16 {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.action-btn-v16 {
  padding: 7px 10px;
  border: 1px solid #bbb;
  background: #f7f7f7;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
}
.action-btn-v16:hover { background: #ececec; }


/* v21 merged guidance/result improvements */
.v21-selected-rate-row {
  background: #dff7ef !important;
  box-shadow: inset 4px 0 0 #0f766e;
}
.v21-popup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.v21-btn {
  padding: 7px 10px;
  border: 1px solid #bbb;
  background: #f7f7f7;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
}
.v21-btn:hover { background: #ececec; }
.v21-status {
  font-size: 12px;
  color: #4b5563;
  margin-top: 6px;
  line-height: 1.35;
}
.v21-guide-modal-backdrop {
  display: none;
  position: fixed;
  z-index: 100000;
  inset: 0;
  background: rgba(0,0,0,0.45);
  align-items: center;
  justify-content: center;
  padding: 18px;
}
.v21-guide-modal-backdrop.show { display: flex; }
.v21-guide-modal {
  width: min(650px, 94vw);
  max-height: 84vh;
  overflow-y: auto;
  background: #fff;
  color: #222;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.35);
  padding: 18px 20px;
  line-height: 1.45;
}
.v21-guide-modal h2 { margin: 0 0 10px 0; font-size: 20px; color: #07394d; }
.v21-guide-modal h3 { margin: 16px 0 6px 0; font-size: 16px; color: #07394d; }
.v21-guide-modal p, .v21-guide-modal li { font-size: 14px; }
.v21-guide-modal a { color: #075985; word-break: break-word; }
.v21-close-guide {
  float: right;
  border: 0;
  background: transparent;
  font-size: 26px;
  cursor: pointer;
  line-height: 1;
  padding: 0 2px;
}
.v21-guide-actions { text-align: right; margin-top: 14px; }
.v21-ok-guide {
  padding: 8px 14px;
  border: 1px solid #999;
  background: #f2f2f2;
  border-radius: 6px;
  cursor: pointer;
}
.v21-result-summary {
  margin: 8px 0 10px 0;
  padding: 10px;
  background: #eefbf7;
  border: 1px solid #b8e6d8;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.4;
}
.v21-result-summary strong { color: #07394d; }


/* v22 bedroom calculator */
.v22-calculator-modal-backdrop {
  display: none;
  position: fixed;
  z-index: 100002;
  inset: 0;
  background: rgba(0,0,0,0.45);
  align-items: center;
  justify-content: center;
  padding: 14px;
}
.v22-calculator-modal-backdrop.show { display: flex; }
.v22-calculator-modal {
  width: min(760px, 96vw);
  max-height: 88vh;
  overflow-y: auto;
  background: #fff;
  color: #222;
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.35);
  padding: 18px 20px;
  line-height: 1.42;
}
.v22-calculator-modal h2 {
  margin: 0 0 4px 0;
  color: #07394d;
  font-size: 22px;
}
.v22-calculator-modal .v22-subtitle {
  margin: 0 0 14px 0;
  color: #53646d;
  font-size: 14px;
}
.v22-close-calculator {
  float: right;
  border: 0;
  background: transparent;
  font-size: 28px;
  cursor: pointer;
  line-height: 1;
  padding: 0 2px;
}
.v22-warning {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #7c2d12;
  border-radius: 8px;
  padding: 10px;
  font-size: 13px;
  margin-bottom: 12px;
}
.v22-calc-grid {
  display: grid;
  grid-template-columns: 1fr 110px;
  gap: 10px 12px;
  align-items: center;
}
.v22-calc-grid label {
  font-size: 14px;
  color: #24343d;
}
.v22-calc-grid input {
  width: 100%;
  padding: 9px 8px;
  border: 1px solid #b8c2c8;
  border-radius: 7px;
  font-size: 16px;
}
.v22-section-title {
  margin: 16px 0 8px 0;
  color: #07394d;
  font-weight: 700;
  border-bottom: 1px solid #d9e2e6;
  padding-bottom: 5px;
}
.v22-help {
  font-size: 12px;
  color: #64748b;
  margin-top: 4px;
}
.v22-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}
.v22-btn {
  padding: 9px 12px;
  border: 1px solid #9ca3af;
  background: #f8fafc;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
}
.v22-btn-primary {
  background: #0f766e;
  color: #fff;
  border-color: #0f766e;
}
.v22-btn-danger {
  background: #fff;
  color: #991b1b;
  border-color: #fecaca;
}
.v22-result {
  display: none;
  margin-top: 14px;
  padding: 12px;
  border-radius: 10px;
  background: #eefbf7;
  border: 1px solid #b8e6d8;
}
.v22-result.show { display: block; }
.v22-result-main {
  font-size: 20px;
  font-weight: 800;
  color: #07394d;
  margin-bottom: 4px;
}
.v22-result-note {
  font-size: 13px;
  color: #475569;
}
.v22-error {
  display: none;
  margin-top: 10px;
  padding: 9px;
  border-radius: 8px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  font-size: 13px;
}
.v22-error.show { display: block; }
@media (max-width: 520px) {
  .v22-calc-grid {
    grid-template-columns: 1fr 86px;
  }
  .v22-calculator-modal {
    padding: 15px 14px;
  }
}


/* v23 stronger disclaimer styling */
.v23-protection-note {
  margin: 8px 0 10px 0;
  padding: 9px 10px;
  border-radius: 8px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #7c2d12;
  font-size: 12.5px;
  line-height: 1.35;
}
.v23-protection-note strong {
  color: #7c2d12;
}


/* v24: reduced disclaimer noise */
.v23-protection-note {
  display: none !important;
}
.v24-small-note {
  margin: 9px 0 8px 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid #dbe3e8;
  color: #475569;
  font-size: 12px;
  line-height: 1.35;
}
.v24-small-note strong {
  color: #07394d;
}
.v24-popup-note {
  margin: 8px 0 9px 0;
  padding: 8px 9px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid #dbe3e8;
  color: #475569;
  font-size: 12px;
  line-height: 1.35;
}
.v24-popup-note strong {
  color: #07394d;
}


/* v25: no popup disclaimer box */
.v24-popup-note {
  display: none !important;
}


/* v25.2: use one blue guidance bubble only */
.v24-small-note {
  display: none !important;
}
.v25-2-guidance-bubble {
  margin: 9px 0 10px 0;
  padding: 10px 11px;
  border-radius: 8px;
  background: #f0f7ff;
  border: 1px solid #c9dff2;
  color: #34495e;
  font-size: 12px;
  line-height: 1.35;
}
.v25-2-guidance-bubble strong {
  color: #07394d;
}


/* v25.3: disclaimer I understand button */
.v25-3-disclaimer-actions {
  text-align: right;
  margin-top: 20px;
}
.v25-3-disclaimer-ok {
  padding: 8px 14px;
  border: 1px solid #9ca3af;
  background: #f8fafc;
  border-radius: 7px;
  cursor: pointer;
  font-size: 14px;
}
.v25-3-disclaimer-ok:hover {
  background: #eef2f7;
}


/* v25.4: prevent visible grey map margins while tiles load */
.leaflet-container {
  background: #a9d8e5 !important;
}


/* v25.5: UK-wide official sources list */
.sources-modal ul {
  margin-top: 6px;
  padding-left: 22px;
}
.sources-modal li {
  margin: 5px 0;
}

/* v25.1 expanded official sources list */
.sources-modal ul {
  margin-top: 6px;
  padding-left: 22px;
}
.sources-modal li {
  margin: 5px 0;
}

/* v26.1 */
.app-version {
  font-size: 11px;
  color: #666;
  margin-top: -6px;
  margin-bottom: 8px;
}
