:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #16333c;
  background: #f3f8f9;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .58; cursor: progress; }
button, summary, input { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, summary:focus-visible, a:focus-visible { outline: 3px solid #ffae42; outline-offset: 3px; }
a { color: #087f8d; }
.app-shell { min-height: 100dvh; display: flex; flex-direction: column; }
.hero { color: white; padding: max(30px, env(safe-area-inset-top)) 20px 76px; background: linear-gradient(115deg,#079b81 0%,#0a9e98 44%,#279ed1 100%); }
.hero-inner { max-width: 800px; margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 15px; }
.brand-icon { width: 60px; height: 60px; border-radius: 18px; display: flex; align-items: center; justify-content: center; color: white; background: #ffffff2a; box-shadow: inset 0 1px 0 #ffffff2a; }
.brand-icon svg { width: 35px; height: 35px; }
.brand-kicker { letter-spacing: .17em; font-size: 10px; font-weight: 800; margin: 0 0 5px; color: #dcfff6; }
h1 { margin: 0; font-size: clamp(24px, 4.9vw, 34px); letter-spacing: -.042em; line-height: 1.1; }
.hero-description { margin: 20px 0 16px; max-width: 490px; color: #e5fffa; font-size: 15px; line-height: 1.55; }
.hero-bottom { display: flex; align-items: center; gap: 12px; color: #ddfff9; font-size: 12px; font-weight: 500; }
.version-tag { border: 1px solid #ffffff65; border-radius: 999px; padding: 3px 9px; }
.main-content { width: min(100%, 840px); margin: -48px auto 0; padding: 0 16px 28px; flex: 1; position: relative; }
.search-panel { background: white; border: 1px solid #deebed; border-radius: 22px; padding: 23px; box-shadow: 0 10px 32px #16475a1a; }
h2 { font-size: 22px; letter-spacing: -.035em; margin: 0; }
.search-panel h2 { margin: 0 0 21px; }
label { display: block; font-weight: 700; font-size: 13px; margin: 0 0 9px; color: #34545d; }
.search-row { display: flex; gap: 10px; }
input { height: 52px; width: 100%; border: 1.5px solid #c8dbdd; background: #fbfdfd; border-radius: 12px; padding: 0 15px; color: #153540; font-size: 17px; }
input:focus { outline: 0; border-color: #0e929d; box-shadow: 0 0 0 3px #0e929d23; }
input::placeholder { color: #849ba3; }
#postcode-input { min-width: 0; flex: 1; letter-spacing: .035em; text-transform: uppercase; font-weight: 650; }
.primary-button { display: inline-flex; justify-content: center; align-items: center; gap: 9px; border: 0; border-radius: 12px; background: #0c8d90; color: white; padding: 0 22px; font-weight: 750; min-height: 52px; }
.primary-button:not(:disabled):hover { background: #056e77; }
.primary-button svg { width: 20px; height: 20px; }
.secondary-button { border: 1.5px solid #0a9096; color: #087c84; background: #f0fbfa; padding: 12px 15px; border-radius: 12px; font-weight: 750; }
.secondary-button:hover { background: #dbf5f0; }
.field-help, .muted { color: #637a83; }
.field-help { margin: 10px 0 0; font-size: 12px; }
.status-message { margin: 15px 0 0; border-radius: 11px; padding: 12px 14px; font-size: 13px; line-height: 1.5; }
.status-message[data-kind="error"] { background: #fff1ee; color: #944237; }
.status-message[data-kind="info"] { background: #eaf7fb; color: #216478; }
.status-message[data-kind="success"] { background: #e9f7ef; color: #226b4a; }
.tab-bar { display: flex; gap: 6px; margin: 18px 0 24px; background: #e7f0f1; padding: 5px; border-radius: 14px; }
.tab { flex: 1; background: transparent; border: 0; border-radius: 10px; padding: 13px 8px; color: #58747b; font-size: 14px; font-weight: 700; white-space: nowrap; }
.tab.active { color: #076d75; background: white; box-shadow: 0 2px 8px #10343b0d; }
.tab-count { font-size: 11px; opacity: .85; padding-left: 2px; }
.view { min-height: 190px; }
.section-header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 12px; margin-bottom: 18px; }
.section-header .muted { margin: 7px 0 0; font-size: 14px; line-height: 1.5; }
.eyebrow { color: #078b88; font-size: 10px; letter-spacing: .16em; font-weight: 850; margin: 0 0 7px; }
.text-button { border: 1px solid #b4d5d8; background: #f5fbfc; color: #086f79; border-radius: 10px; padding: 10px 12px; font-weight: 700; font-size: 12px; }
.text-button:hover { background: #e6f4f5; }
.notice { background: #fff8ea; border: 1px solid #efdcb2; padding: 13px 15px; color: #785b2d; border-radius: 13px; margin-bottom: 15px; font-size: 13px; line-height: 1.55; }
.address-list, .history-list { display: flex; flex-direction: column; gap: 10px; }
.address-card, .history-card { display: flex; gap: 9px; align-items: center; background: white; border: 1px solid #e0ecee; border-radius: 15px; min-height: 82px; box-shadow: 0 2px 10px #123f5009; padding: 8px; }
.address-card:focus-within, .history-card:focus-within { border-color: #5db9bb; }
.address-main, .history-main { flex: 1; text-align: left; border: 0; background: transparent; padding: 9px 7px 9px 10px; color: inherit; min-width: 0; }
.address-main { display: flex; align-items: center; gap: 12px; }
.address-card:hover { border-color: #a5d3d2; }
.address-pin { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 13px; background: #e6f7f2; color: #0a927d; }
.address-pin svg { width: 21px; height: 21px; }
.address-title { display: block; color: #173d44; font-size: 15px; line-height: 1.35; font-weight: 780; overflow-wrap: anywhere; }
.address-subtitle { display: block; font-size: 12px; color: #71878c; margin-top: 5px; overflow-wrap: anywhere; }
.card-actions { display: flex; flex-direction: column; gap: 5px; align-items: center; justify-content: center; }
.icon-button { display: grid; place-items: center; border: 0; border-radius: 10px; background: #f2f7f8; color: #56777d; width: 34px; height: 31px; }
.icon-button:hover { background: #e1f1f0; color: #0b8286; }
.icon-button[aria-pressed="true"] { background: #fff2d9; color: #ab771b; }
.icon-button svg { width: 17px; height: 17px; }
.address-arrow { display: grid; place-items: center; width: 28px; color: #078a88; font-size: 21px; font-weight: 700; }
.empty-state { text-align: center; background: #ffffff98; border: 1px dashed #cfdee1; border-radius: 18px; padding: 34px 20px; color: #6f888f; }
.empty-icon { width: 67px; height: 67px; margin: 0 auto 14px; color: #289e9c; background: #e3f4f2; border-radius: 22px; display: grid; place-items: center; }
.empty-icon svg { width: 36px; height: 36px; }
.empty-state h3 { color: #2c4e57; margin: 0 0 8px; font-size: 16px; }
.empty-state p { margin: 0 auto; max-width: 400px; line-height: 1.6; font-size: 13px; }
.manual-details { border: 1px solid #cde4e5; border-radius: 15px; background: #f7fcfc; padding: 17px 18px; margin-top: 16px; }
.manual-details summary { font-weight: 800; color: #097985; cursor: pointer; }
.manual-details p.small { font-size: 12px; line-height: 1.55; }
.manual-form { display: flex; flex-direction: column; gap: 9px; margin-top: 17px; }
.manual-form label { margin-bottom: -3px; }
.manual-form input { height: 45px; font-size: 14px; background: white; }
.manual-form button { margin-top: 7px; align-self: start; }
.history-main { padding: 13px; }
.history-date { display: block; color: #72868d; font-size: 12px; margin-top: 5px; }
.history-action { font-size: 12px; font-weight: 750; color: #0a8788; padding: 12px; border: 0; background: #f1fafa; border-radius: 9px; margin-right: 8px; }
 .backup-panel { margin-top: 23px; border: 1px solid #cfe0e2; border-radius: 15px; padding: 17px 20px; background: #ffffffd9; }
.backup-panel summary { color: #38636d; cursor: pointer; font-size: 13px; font-weight: 800; }
.backup-panel p { font-size: 12px; color: #6b858e; line-height: 1.6; }
.backup-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 15px; }
.backup-actions button { min-height: 40px; font-size: 12px; }
.info-panel { background: #eaf3f4; border-radius: 16px; padding: 20px; margin-top: 26px; font-size: 12px; color: #526e75; line-height: 1.65; }
.info-panel p { margin: 9px 0 0; }
.info-title { display: flex; align-items: center; gap: 9px; color: #245b61; font-size: 13px; }
.info-symbol { width: 23px; height: 23px; display: inline-grid; place-items: center; border: 1.5px solid #619b9f; border-radius: 50%; font-weight: 900; }
.footer { margin: 0 auto; width: min(100%, 840px); padding: 9px 16px max(25px, env(safe-area-inset-bottom)); display: flex; gap: 12px; flex-wrap: wrap; justify-content: space-between; font-size: 11px; color: #84999d; }
[hidden] { display: none !important; }
@media (max-width: 520px) {
  .hero { padding: max(27px, env(safe-area-inset-top)) 18px 75px; }
  .brand { gap: 11px; }
  .brand-icon { width: 50px; height: 50px; border-radius: 15px; }
  .brand-icon svg { width: 30px; height: 30px; }
  .brand-kicker { font-size: 9px; letter-spacing: .12em; }
  h1 { font-size: 25px; }
  .hero-description { font-size: 13px; }
  .search-panel { padding: 18px; border-radius: 19px; }
  .search-panel h2 { font-size: 20px; }
  .primary-button { padding: 0 16px; }
  .search-row { gap: 7px; }
  .primary-button svg { display: none; }
  .tab { padding: 12px 5px; font-size: 13px; }
  .section-header h2 { font-size: 20px; }
  .address-card, .history-card { gap: 4px; }
  .address-main { gap: 9px; padding: 9px 3px 9px 6px; }
  .address-pin { width: 35px; height: 35px; }
  .address-title { font-size: 14px; }
  .address-arrow { width: 22px; }
  .info-panel { padding: 17px; }
}
@media (prefers-reduced-motion: no-preference) {
  .primary-button, .text-button, .secondary-button, .icon-button, .tab { transition: background-color .15s ease, border-color .15s ease; }
}

/* v0.2: local filter and clearly separated unverified nearby results. */
.filter-panel { margin: 0 0 14px; }
.filter-panel label { margin: 0 0 8px; }
.filter-panel input { height: 46px; font-size: 14px; }
.filter-panel p { margin-top: 6px; }
.nearby-details { border: 1px solid #e3cfa4; border-radius: 15px; background: #fffcf4; padding: 17px 18px; margin-top: 20px; }
.nearby-details summary { font-weight: 800; color: #825d18; cursor: pointer; line-height: 1.5; }
.nearby-details p.small { font-size: 12px; line-height: 1.65; }
.nearby-details .secondary-button { margin: 6px 0 10px; }
.nearby-details .address-card { border-color: #ecd8ab; }
.nearby-details .address-pin { background: #fff0c9; color: #896412; }
.nearby-details .address-subtitle { color: #8a6b32; }
.nearby-list { margin-top: 14px; }

/* v0.2.2: transparent provider diagnostics and optional personal provider. */
.provider-details { margin-top: 16px; border: 1px solid #bcd9de; border-radius: 14px; padding: 13px 15px; background: #f4fbfc; }
.provider-details summary { font-size: 13px; font-weight: 800; color: #0b747e; cursor: pointer; }
.provider-details .small { font-size: 12px; line-height: 1.6; }
.provider-diagnostic { font-size: 12px; line-height: 1.6; background: #fff; border: 1px solid #ddebed; padding: 11px 12px; border-radius: 9px; overflow-wrap: anywhere; }
.provider-diagnostic[data-kind="error"] { color: #9a4539; background: #fff3ef; border-color: #f0d6d0; }
.provider-diagnostic[data-kind="success"] { color: #1c7650; background: #e8f8ee; border-color: #cbe8d4; }
.provider-test-link { display: inline-block; margin: 0 0 10px; font-size: 12px; font-weight: 700; }
.provider-key-details { border-top: 1px solid #d5e6e7; padding-top: 14px; margin-top: 12px; }
.provider-key-details summary { font-size: 12px; }
.provider-key-details label { margin-top: 12px; }
.provider-key-details input { height: 44px; font-size: 14px; }
.provider-save { margin-top: 10px; }

/* v0.3.0: auto-expanded nearby candidates remain clearly unverified. */
#nearby-summary { font-size: 14px; }
.nearby-details[open] { box-shadow: 0 3px 13px rgba(111,77,22,.06); }
.nearby-details .address-card { background: #fffdf7; }

/* v0.4.0 — distinct official reference link and compact controls */
.lookup-links { display:flex; gap:8px; align-items:flex-start; flex-wrap:wrap; justify-content:flex-end; }
.lookup-links .text-button { font-size: 13px; line-height:1.35; padding: 9px 10px; }
.lookup-links a.text-button { text-decoration: none; }
.lookup-links a.text-button:hover { text-decoration: underline; }
.card-actions { flex-wrap:wrap; }
@media(max-width: 560px) { .lookup-links { justify-content:flex-start; } }

/* v0.5.0: optional CSV import is kept beneath the main search results. */
.import-panel { margin-top: 23px; border: 1px solid #b6d7db; border-radius: 15px; padding: 17px 20px; background: #f0f9fa; }
.import-panel summary { color: #146e75; cursor: pointer; font-size: 13px; font-weight: 800; }
.import-panel p { font-size: 12px; color: #52717a; line-height: 1.65; }
.import-panel code { overflow-wrap: anywhere; font-size: 12px; }
.import-panel .backup-actions { align-items: center; }
.import-panel button { font-size: 12px; min-height: 40px; }

/* v0.6.0: precise, personally selected doorstep pin. */
.pin-dialog { position:fixed; inset:0; margin:auto; width:min(630px,calc(100vw - 18px)); max-height:min(94dvh,850px); overflow:auto; padding:17px; border:1px solid #8fb8bd; border-radius:18px; background:#f8fbfc; color:#193c43; box-shadow:0 10px 65px #061b25b0; }
.pin-dialog::backdrop { background:rgba(3,20,25,.78); }
.pin-head { display:flex; justify-content:space-between; align-items:start; gap:12px; }
.pin-head .eyebrow { margin:0 0 3px; }
.pin-head h2 { font-size:22px; margin:0; }
.pin-close { border:1px solid #a2c4c7; color:#21464c; border-radius:11px; background:#eef4f5; width:42px; height:42px; font-size:19px; cursor:pointer; flex-shrink:0; }
.pin-property-name { font-weight:800; font-size:14px; margin:8px 0; overflow-wrap:anywhere; }
.pin-dialog .small { font-size:12px; line-height:1.55; }
.pin-map-wrap { position:relative; margin:12px 0; border-radius:13px; overflow:hidden; border:1px solid #aac9cb; background:#dce9e8; }
.pin-map { position:relative; isolation:isolate; width:100%; height:310px; overflow:hidden; background:repeating-linear-gradient(45deg,#e0e9e8,#e0e9e8 18px,#eaf0ed 18px,#eaf0ed 36px); touch-action:none; cursor:crosshair; user-select:none; }
.pin-tiles { position:absolute; inset:0; pointer-events:none; }
.pin-tile { position:absolute; width:256px; height:256px; user-select:none; pointer-events:none; }
.pin-selected-marker { position:absolute; transform:translate(-50%,-85%); font-size:37px; color:#da513c; text-shadow:0 1px 3px #fff,0 2px 6px #1c333d; pointer-events:none; z-index:2; }
.pin-zoom-controls { position:absolute; top:9px; right:9px; display:grid; gap:6px; z-index:4; }
.pin-zoom-controls button { width:43px; height:42px; border:1px solid #75969b; border-radius:9px; background:#fffffff2; color:#163d46; font-size:26px; font-weight:700; }
.pin-attribution { position:absolute; bottom:0; right:0; background:#ffffffe8; color:#16446a; padding:3px 6px; font-size:11px; z-index:4; }
.pin-position { font-weight:700; min-height:24px; }
.pin-coordinate-row { display:flex; gap:7px; align-items:center; }
.pin-coordinate-row input { flex:1; min-width:0; height:46px; font-size:14px; }
.pin-coordinate-row button { flex:none; }
.pin-error { color:#bb493e; min-height:10px; margin-bottom:3px; }
.pin-actions { display:flex; gap:8px; justify-content:space-between; flex-wrap:wrap; margin:13px 0; }
.pin-actions button { min-height:43px; font-size:12px; }
.pin-actions button:disabled { opacity:.5; cursor:not-allowed; }
.pin-actions .primary-button { display:block; }
.pin-card-hint { display:block; font-weight:700; color:#117581; font-size:11px; margin-top:3px; }
@media(max-width:520px) { .pin-dialog { padding:12px; border-radius:14px; max-height:96dvh; } .pin-map{height:280px;} .pin-head h2{font-size:18px;} .pin-actions button{padding:9px 12px;} }
