*{box-sizing:border-box}body{margin:0;font-family:Arial,Helvetica,sans-serif;background:#f4f4f2;color:#222}a{color:#2b3260}.topbar{background:#2b3260;color:white;padding:12px 18px;display:flex;gap:20px;align-items:center;flex-wrap:wrap}.topbar strong{white-space:nowrap}.topbar nav{display:flex;gap:10px;align-items:center;flex-wrap:wrap}.topbar a{color:white;text-decoration:none;padding:4px 0}.container{padding:20px;max-width:1500px;margin:0 auto}.login-card{max-width:420px;margin:8vh auto;padding:24px;background:white;border-radius:10px;box-shadow:0 3px 18px #0002}label{display:block;margin:8px 0}input,select,textarea,button{padding:8px;border:1px solid #bbb;border-radius:5px}input,select,textarea{width:100%}textarea{min-height:120px}button,.btn{background:#2b3260;color:#fff;border:0;text-decoration:none;display:inline-block;padding:8px 10px;border-radius:5px;cursor:pointer;line-height:1.2}.btn:hover,button:hover{filter:brightness(1.08)}.danger{background:#8b2222}.ok{background:#e7f5e7;border-left:4px solid #259b25;padding:10px}.error{background:#fde8e8;border-left:4px solid #a00;padding:10px}.muted{color:#666;font-size:.9em}.panel,.card{background:white;padding:16px;margin:14px 0;border-radius:10px;box-shadow:0 2px 10px #0001}.cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:12px}.card{text-decoration:none;color:#222}.gridform{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:10px;align-items:end}.table-wrap{overflow-x:auto}table{border-collapse:collapse;width:100%;background:white}td,th{border-bottom:1px solid #ddd;padding:8px;text-align:left;vertical-align:top}.swatch{display:inline-block;width:18px;height:18px;border:1px solid #999;margin-right:6px;vertical-align:middle}.split{display:grid;grid-template-columns:minmax(0,1fr) 360px;gap:16px}.admin-map{height:70vh;min-height:480px;background:#ddd;border:1px solid #aaa}.form{background:white;padding:14px;border-radius:10px}.form button{margin-top:8px}code{background:#eee;padding:2px 5px;border-radius:4px}.inlineform{display:flex;gap:5px;align-items:center;flex-wrap:wrap}.inlineform input,.inlineform select{width:auto;min-width:0}.smallcheck{font-size:12px;display:inline-flex;gap:3px;align-items:center;margin-left:6px}.smallcheck input{width:auto}pre{background:#111;color:#eee;padding:12px;overflow:auto;border-radius:6px}#app{display:grid;grid-template-columns:310px minmax(0,1fr);height:100vh;overflow:hidden}#sidebar{background:#fff;border-right:1px solid #ddd;padding:14px;overflow:auto;z-index:1000}#sidebar h1{margin-top:0}#map{height:100vh;width:100%;background:#ddd}.map-empty{padding:2rem}.leaflet-container{background:#d8d8d8}main{position:relative;min-width:0}#coordReadout{position:absolute;right:14px;bottom:14px;background:rgba(255,255,255,.92);padding:8px 10px;border-radius:6px;z-index:900;border:1px solid #bbb}.search-result{padding:8px;border-bottom:1px solid #ddd;cursor:pointer}.search-result:hover{background:#eee}#categoryFilters label{font-size:.92em}.iap-divicon{background:transparent;border:0}.os-symbol{--c:#333;display:flex;align-items:center;justify-content:center;width:26px;height:26px;color:white;background:var(--c);border:2px solid white;border-radius:50%;box-shadow:0 1px 4px #0008;font-size:15px;font-weight:bold}@media(max-width:900px){#app{grid-template-columns:1fr;grid-template-rows:auto 1fr}#sidebar{max-height:42vh;border-right:0;border-bottom:1px solid #ddd}#map{height:58vh}.split{grid-template-columns:1fr}.admin-map{height:55vh}}

.map-status{position:absolute;left:330px;top:12px;z-index:1200;background:#fff3cd;border:1px solid #e0b84d;border-radius:6px;padding:10px;max-width:620px;font-size:13px;box-shadow:0 2px 10px #0002}
@media(max-width:900px){.map-status{left:12px;top:44vh;right:12px;max-width:none}}

/* v1.4 admin/content tools */
.actions{display:flex;gap:.4rem;align-items:center;flex-wrap:wrap}.actions form{display:inline;margin:0}.btn.small,button.small{padding:.35rem .55rem;font-size:.85rem}.btn.secondary{background:#666}.icon-preview{width:28px;height:28px;object-fit:contain;vertical-align:middle}.custom-symbol{width:28px;height:28px;object-fit:contain;filter:drop-shadow(0 1px 1px rgba(0,0,0,.35))}.iap-divicon{background:transparent;border:0}.check{display:flex;gap:.5rem;align-items:center}.check input{width:auto}.gridform small,.form small{display:block;color:#666;font-size:.8rem;margin-top:.2rem}.area-point-list{max-height:160px;overflow:auto;background:#f6f6f6;border:1px solid #ddd;padding:.5rem}.muted{color:#666}.ok{background:#e8f6ec;border-left:4px solid #29834a;padding:.6rem}.error{background:#fdeaea;border-left:4px solid #b42318;padding:.6rem}
.filter-category{border-top:1px solid #ddd;padding:8px 0}.filter-category-title{display:block;margin-bottom:4px}.filter-types{padding-left:18px;display:grid;gap:3px}.filter-types label{font-size:13px}.gridform small{display:block;color:#666;margin-top:3px}.split .panel{min-width:0}

/* v1.6 public theme layout */
body.map-theme{background:#111;overflow:hidden}.map-topbar{height:125px;background:#1d243f;color:#fff;display:flex;align-items:center;gap:16px;padding:0 18px 0 0;border-bottom:3px solid #a25801;box-shadow:0 2px 12px #0005;position:relative;z-index:1500}.map-logo{width:300px;height:125px;display:block;flex:0 0 300px;background:#2b3260}.map-logo img{display:block;width:300px;height:125px;object-fit:contain}.toolbar-link{color:#fff;text-decoration:none;background:#2b3260;border:1px solid rgba(255,255,255,.25);padding:10px 14px;border-radius:6px;white-space:nowrap}.toolbar-link:hover,.filter-dropbtn:hover{filter:brightness(1.1)}.toolbar-select{display:flex;align-items:center;gap:8px;color:#fff;margin:0;min-width:230px}.toolbar-select span{font-weight:bold}.toolbar-select select{width:170px;max-width:220px;background:#fff;color:#222;border:0}.filter-dropdown{position:relative;display:inline-flex}.filter-dropbtn{background:#2b3260;border:1px solid rgba(255,255,255,.25);color:#fff;border-radius:6px;padding:10px 14px;min-width:150px;text-align:left}.filter-menu{display:none;position:absolute;top:calc(100% + 8px);left:0;width:300px;max-height:58vh;overflow:auto;background:#fff;color:#222;border:1px solid #bbb;border-radius:8px;box-shadow:0 10px 30px #0005;padding:10px;z-index:2000}.filter-menu.open{display:block}.filter-menu-head{display:flex;align-items:center;justify-content:space-between;gap:10px;padding-bottom:8px;border-bottom:1px solid #ddd;margin-bottom:8px}.filter-menu-head button{padding:5px 8px;background:#666}.dropdown-check{display:flex;align-items:center;gap:8px;margin:4px 0;font-size:14px}.dropdown-check input{width:auto}.type-filter-group{border-top:1px solid #e2e2e2;padding:8px 0}.type-filter-group:first-child{border-top:0}.type-filter-title{font-weight:bold;color:#2b3260;margin-bottom:4px}#mapShell{position:relative;height:calc(100vh - 125px);min-width:0}.map-theme #map{height:calc(100vh - 125px);width:100%;background:#d8d8d8}.floating-search{position:absolute;top:16px;right:16px;width:340px;max-width:calc(100vw - 120px);z-index:1000;background:rgba(255,255,255,.94);border:1px solid #c7c7c7;border-radius:10px;padding:10px;box-shadow:0 4px 18px #0003}.floating-search input{width:100%}.grid-mode-row{margin-top:8px}.grid-mode-row label{display:flex;align-items:center;gap:8px;margin:0;font-size:13px}.grid-mode-row select{width:auto;flex:1}.floating-tools{position:absolute;left:16px;top:50%;transform:translateY(-50%);display:flex;flex-direction:column;gap:10px;z-index:1000}.tool-icon{width:46px;height:46px;border-radius:12px;border:1px solid rgba(255,255,255,.75);background:rgba(43,50,96,.95);color:#fff;font-size:24px;font-weight:bold;display:flex;align-items:center;justify-content:center;box-shadow:0 4px 14px #0004;position:relative}.tool-icon.active{background:#a25801}.tool-icon::after{content:attr(data-tip);display:none;position:absolute;left:58px;top:50%;transform:translateY(-50%);width:240px;background:#111;color:#fff;border-radius:7px;padding:8px 10px;font-size:13px;font-weight:normal;line-height:1.25;box-shadow:0 4px 14px #0005;text-align:left}.tool-icon:hover::after,.tool-icon:focus::after{display:block}.admin-float{position:absolute;left:16px;bottom:16px;z-index:1000;background:rgba(255,255,255,.92);color:#2b3260;border:1px solid #bbb;border-radius:6px;padding:7px 10px;text-decoration:none}body.map-theme #coordReadout{right:16px;bottom:16px}.map-theme .map-status{left:16px;top:16px;max-width:540px}.map-theme .search-result{font-size:13px;background:#fff}.map-theme .search-result:hover{background:#eee}
@media(max-width:1050px){.map-topbar{height:auto;min-height:125px;flex-wrap:wrap;padding:0 10px 10px 0;gap:10px}.map-logo{margin-right:4px}#mapShell,.map-theme #map{height:calc(100vh - 155px)}.filter-menu{left:auto;right:0}.floating-search{top:12px;right:12px;width:300px}.floating-tools{top:auto;bottom:66px;transform:none}.tool-icon::after{left:54px;width:210px}}
@media(max-width:760px){.map-topbar{align-items:flex-start}.map-logo,.map-logo img{width:180px;height:75px}.toolbar-link,.filter-dropbtn{padding:8px 10px}.toolbar-select{min-width:180px}.toolbar-select select{width:130px}#mapShell,.map-theme #map{height:calc(100vh - 175px)}.floating-search{left:12px;right:12px;width:auto;max-width:none}.floating-tools{left:12px;bottom:58px}.tool-icon{width:42px;height:42px}.tool-icon::after{display:none!important}body.map-theme #coordReadout{left:12px;right:12px;text-align:center}}

/* v1.7 theme customisation */
:root{
  --primary-colour:#2b3260;
  --secondary-colour:#a25801;
  --page-bg-colour:#f4f4f2;
  --toolbar-text-colour:#ffffff;
  --panel-bg-colour:#ffffff;
  --tool-colour:#2b3260;
  --tool-active-colour:#a25801;
  --link-colour:#2b3260;
}
body{background:var(--page-bg-colour)}
a{color:var(--link-colour)}
.topbar{background:var(--primary-colour);color:var(--toolbar-text-colour)}
.topbar a{color:var(--toolbar-text-colour)}
button,.btn{background:var(--primary-colour)}
.btn.secondary{background:#666}.danger{background:#8b2222}
.panel,.card,.login-card{background:var(--panel-bg-colour)}
body.map-theme{background:var(--page-bg-colour)}
.map-topbar{background:var(--primary-colour);color:var(--toolbar-text-colour);border-bottom-color:var(--secondary-colour)}
.map-logo{background:var(--primary-colour)}
.toolbar-link,.filter-dropbtn{background:var(--primary-colour);color:var(--toolbar-text-colour)}
.toolbar-select{color:var(--toolbar-text-colour)}
.type-filter-title{color:var(--primary-colour)}
.tool-icon{background:var(--tool-colour)}
.tool-icon.active{background:var(--tool-active-colour)}
.admin-float{color:var(--primary-colour)}
.os-symbol{background:var(--c)}
.theme-logo-preview{width:300px;height:125px;object-fit:contain;background:#eee;border:1px solid #bbb;border-radius:6px;padding:4px}
.theme-colour-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(230px,1fr));gap:10px;margin:12px 0}.colour-field{display:grid;grid-template-columns:1fr 48px auto;gap:8px;align-items:center;background:#f8f8f8;border:1px solid #ddd;border-radius:8px;padding:8px}.colour-field input{width:48px;height:34px;padding:2px}.colour-field code{white-space:nowrap}


/* v1.8 responsive logo and auto-height toolbar */
.map-topbar{
  height:auto;
  min-height:60px;
  align-items:center;
  gap:16px;
  padding:10px 18px;
  flex-wrap:wrap;
}
.map-logo{
  width:auto;
  height:auto;
  max-width:var(--logo-max-width, 600px);
  max-height:var(--logo-max-height, 125px);
  flex:0 0 auto;
  display:flex;
  align-items:center;
  justify-content:center;
  background:transparent;
  overflow:visible;
}
.map-logo img{
  display:block;
  width:auto;
  height:auto;
  max-width:var(--logo-max-width, 600px);
  max-height:var(--logo-max-height, 125px);
  object-fit:contain;
}
#mapShell{
  height:calc(100vh - var(--toolbar-current-height, 100px));
}
.map-theme #map{
  height:100%;
}
.theme-logo-preview{
  width:auto;
  height:auto;
  max-width:600px;
  max-height:180px;
  object-fit:contain;
}
@media(max-width:1050px){
  .map-topbar{min-height:60px;padding:10px;}
  #mapShell,.map-theme #map{height:calc(100vh - var(--toolbar-current-height, 130px));}
}
@media(max-width:760px){
  .map-logo,.map-logo img{
    width:auto;
    height:auto;
    max-width:min(var(--logo-max-width, 600px), 80vw);
    max-height:var(--logo-max-height, 125px);
  }
  #mapShell,.map-theme #map{height:calc(100vh - var(--toolbar-current-height, 170px));}
}

/* v1.9 visual polish */
:root{
  --public-map-bg-colour:#d8d8d8;
}
#map,
.map-theme #map,
.leaflet-container{
  background:var(--public-map-bg-colour)!important;
}
.toolbar-button{
  border:1px solid rgba(255,255,255,.25);
  cursor:pointer;
  font:inherit;
}
body.theme-dark{
  color:#e9e9e9;
  background:#151515;
}
body.theme-dark .floating-search,
body.theme-dark .filter-menu,
body.theme-dark #coordReadout,
body.theme-dark .admin-float,
body.theme-dark .map-status{
  background:rgba(28,28,28,.94);
  color:#eee;
  border-color:#555;
}
body.theme-dark .search-result{background:#242424;color:#eee;border-bottom-color:#444}
body.theme-dark .search-result:hover{background:#333}
body.theme-dark input,
body.theme-dark select,
body.theme-dark textarea{background:#191919;color:#eee;border-color:#555}
body.theme-dark .type-filter-title{color:#ddd}
.search-pulse{
  animation:iapSearchPulse 1.15s ease-out infinite;
  stroke:var(--secondary-colour,#a25801);
  fill:var(--secondary-colour,#a25801);
}
@keyframes iapSearchPulse{
  0%{stroke-width:3;stroke-opacity:1;fill-opacity:.16;r:10}
  70%{stroke-width:7;stroke-opacity:.25;fill-opacity:.04;r:28}
  100%{stroke-width:3;stroke-opacity:1;fill-opacity:.16;r:10}
}
.custom-symbol[src$='.svg']{width:30px;height:30px;object-fit:contain}


/* v2.0 public saved filters, favourites and admin data tools */
.public-user-tools{margin-top:8px;border-top:1px solid #ddd;padding-top:8px;display:grid;gap:6px}
.tool-row{display:flex;gap:6px;align-items:center}
.tool-row button{padding:6px 8px;font-size:12px;white-space:nowrap}
.tool-row select{min-width:0;flex:1;padding:6px;font-size:12px}
body.theme-dark .public-user-tools{border-top-color:#444}
.import-help{font-size:.9em;color:#666}.nowrap{white-space:nowrap}

/* v2.1 public user account controls */
.user-toolbar{display:flex;align-items:center;gap:.5rem;margin-left:auto;flex-wrap:wrap}
.user-chip{display:inline-flex;align-items:center;padding:.35rem .6rem;border-radius:999px;background:rgba(255,255,255,.15);font-size:.9rem;white-space:nowrap}
.user-tools-note{font-size:.82rem;color:var(--muted-text,#666);padding:.25rem 0 .4rem 0}
.public-user-tools select:disabled,.public-user-tools button:disabled{opacity:.55;cursor:not-allowed}
.success{color:#126b2f;background:#e9f7ee;border:1px solid #bde4c8;padding:.6rem;border-radius:6px}
@media(max-width:900px){.user-toolbar{width:100%;margin-left:0}.user-chip{max-width:100%;overflow:hidden;text-overflow:ellipsis}}

/* v2.2 Regions & Administrative Areas */
.area-layer-box{margin-top:10px;padding:10px;border-top:1px solid rgba(0,0,0,.12);display:grid;gap:6px;font-size:.92rem}
.area-layer-box label{display:flex;gap:6px;align-items:center}
.area-map-label{pointer-events:none;text-align:center;text-transform:uppercase;font-weight:800;letter-spacing:.12em;text-shadow:0 1px 2px #fff,0 -1px 2px #fff,1px 0 2px #fff,-1px 0 2px #fff;white-space:nowrap;transform:translate(-50%,-50%)}
.theme-dark .area-map-label{text-shadow:0 1px 2px #000,0 -1px 2px #000,1px 0 2px #000,-1px 0 2px #000}
.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.area-form textarea{min-height:120px}
@media(max-width:800px){.form-grid{grid-template-columns:1fr}.area-layer-box{font-size:.85rem}}

/* v2.3.1 admin left sidebar layout */
.admin-body{background:var(--page-bg-colour,#f4f4f2);min-height:100vh;}
.admin-shell{display:grid;grid-template-columns:260px minmax(0,1fr);min-height:100vh;}
.admin-sidebar{background:var(--primary-colour,#2b3260);color:var(--toolbar-text-colour,#fff);border-right:4px solid var(--secondary-colour,#a25801);padding:16px 12px;position:sticky;top:0;height:100vh;overflow:auto;box-shadow:2px 0 18px #0002;}
.admin-brand{display:flex;flex-direction:column;align-items:center;gap:10px;color:var(--toolbar-text-colour,#fff);text-decoration:none;text-align:center;padding:8px 8px 18px;margin-bottom:12px;border-bottom:1px solid rgba(255,255,255,.22);}
.admin-brand img{display:block;max-width:210px;max-height:110px;width:auto;height:auto;object-fit:contain;}
.admin-brand strong{font-size:1.05rem;letter-spacing:.02em;}
.admin-nav{display:flex;flex-direction:column;gap:6px;}
.admin-nav a{display:block;color:var(--toolbar-text-colour,#fff);text-decoration:none;padding:10px 12px;border-radius:8px;background:rgba(255,255,255,.06);border:1px solid rgba(255,255,255,.08);}
.admin-nav a:hover{background:rgba(255,255,255,.16);}
.admin-main{max-width:none;margin:0;padding:24px;}
.admin-body .topbar{display:none;}
body.theme-dark .admin-sidebar{background:#171b2c;}
body.theme-dark .admin-nav a{background:rgba(255,255,255,.08);}
@media(max-width:900px){.admin-shell{grid-template-columns:1fr}.admin-sidebar{position:relative;height:auto;border-right:0;border-bottom:4px solid var(--secondary-colour,#a25801)}.admin-nav{display:grid;grid-template-columns:repeat(auto-fit,minmax(140px,1fr))}.admin-main{padding:16px}.admin-brand{flex-direction:row;justify-content:center}.admin-brand img{max-height:70px;max-width:150px}}
.admin-role-badge{display:block;margin:12px 10px 0;padding:8px 10px;border-radius:8px;background:rgba(255,255,255,.08);font-size:12px;opacity:.85}
.inlineform{display:inline-flex;gap:6px;align-items:center;flex-wrap:wrap;margin:2px 0}

/* v2.4.1 dark mode form/table contrast fix (restores v2.3.2 coverage) */
body.theme-dark,
body.theme-dark.admin-body{
  background:#151515;
  color:#e9e9e9;
}
body.theme-dark .admin-main,
body.theme-dark .container{
  color:#e9e9e9;
}
body.theme-dark .panel,
body.theme-dark .card,
body.theme-dark .login-card,
body.theme-dark .form,
body.theme-dark .colour-field,
body.theme-dark .area-point-list,
body.theme-dark .table-wrap,
body.theme-dark table,
body.theme-dark fieldset,
body.theme-dark .admin-box,
body.theme-dark .content-box{
  background:#202020!important;
  color:#e9e9e9!important;
  border-color:#444!important;
  box-shadow:0 2px 10px rgba(0,0,0,.35);
}
body.theme-dark th,
body.theme-dark td{
  color:#e9e9e9!important;
  border-bottom-color:#444!important;
}
body.theme-dark thead th{
  background:#252525!important;
}
body.theme-dark tr:nth-child(even) td{
  background:#242424!important;
}
body.theme-dark tr:hover td{
  background:#2b2b2b!important;
}
body.theme-dark input,
body.theme-dark select,
body.theme-dark textarea,
body.theme-dark input[type="text"],
body.theme-dark input[type="email"],
body.theme-dark input[type="password"],
body.theme-dark input[type="number"],
body.theme-dark input[type="url"],
body.theme-dark input[type="search"],
body.theme-dark input[type="file"]{
  background:#171717!important;
  color:#f1f1f1!important;
  border-color:#555!important;
}
body.theme-dark input::placeholder,
body.theme-dark textarea::placeholder{
  color:#aaa!important;
}
body.theme-dark input[type="color"]{
  background:#303030!important;
  padding:2px;
}
body.theme-dark option,
body.theme-dark optgroup{
  background:#171717!important;
  color:#f1f1f1!important;
}
body.theme-dark label,
body.theme-dark .muted,
body.theme-dark small,
body.theme-dark .gridform small,
body.theme-dark .form small,
body.theme-dark .import-help{
  color:#c6c6c6!important;
}
body.theme-dark code{
  background:#111!important;
  color:#f0f0f0!important;
  border:1px solid #444;
}
body.theme-dark .ok,
body.theme-dark .success{
  background:#102518!important;
  color:#d9f7e2!important;
  border-color:#2f7d4b!important;
}
body.theme-dark .error{
  background:#2b1212!important;
  color:#ffdcdc!important;
  border-color:#9d3333!important;
}
body.theme-dark .theme-logo-preview,
body.theme-dark .icon-preview-box,
body.theme-dark .preview-box{
  background:#111!important;
  border-color:#555!important;
}
body.theme-dark hr{
  border-color:#444;
}
body.theme-dark a:not(.btn):not(.toolbar-link):not(.admin-brand):not(.admin-nav a){
  color:#9fb2ff;
}

/* v2.5 operational tools */
.ops-panel{
  position:absolute;
  left:78px;
  top:50%;
  transform:translateY(-50%);
  z-index:1100;
  width:280px;
  max-width:calc(100vw - 110px);
  background:var(--panel-bg-colour,#fff);
  color:var(--toolbar-text-colour,#222);
  border:1px solid rgba(0,0,0,.22);
  border-radius:10px;
  padding:12px;
  box-shadow:0 6px 22px rgba(0,0,0,.28);
}
.ops-panel strong{display:block;margin-bottom:8px;color:var(--link-colour,#2b3260)}
.ops-panel p{margin:6px 0 10px}
.ops-panel label{display:block;margin:7px 0;font-size:13px}
.ops-panel input[type="checkbox"]{width:auto;margin-right:6px}
.ops-panel input,.ops-panel select{width:100%;margin-top:3px}
.ops-panel button{margin-top:8px;width:100%}
.route-panel ol{margin:8px 0 0 20px;padding:0;max-height:140px;overflow:auto}
.gridline-minor{stroke:#111;stroke-opacity:.25}
.gridline-major{stroke:#000;stroke-opacity:.55}
body.theme-dark .ops-panel{background:#242424;color:#eee;border-color:#555}
body.theme-dark .ops-panel strong{color:#9db4ff}
body.theme-dark .gridline-minor{stroke:#fff;stroke-opacity:.22}
body.theme-dark .gridline-major{stroke:#fff;stroke-opacity:.5}
@media(max-width:760px){.ops-panel{left:64px;top:auto;bottom:76px;transform:none;width:260px}.floating-tools{transform:none;top:auto!important}}

/* v2.6 professional atlas features */
.gazetteer-panel{
  position:absolute;right:16px;top:96px;z-index:1150;width:420px;max-width:calc(100vw - 32px);max-height:70vh;overflow:hidden;
  background:var(--panel-bg-colour,#fff);color:#222;border:1px solid rgba(0,0,0,.25);border-radius:12px;box-shadow:0 10px 34px rgba(0,0,0,.35);padding:12px;display:grid;grid-template-rows:auto auto minmax(0,1fr);gap:8px;
}
.gazetteer-head{display:flex;justify-content:space-between;align-items:center;border-bottom:1px solid #ddd;padding-bottom:8px}.gazetteer-head button{width:auto;padding:4px 9px}.gazetteer-results{overflow:auto;border:1px solid #ddd;border-radius:8px}.gazetteer-row{padding:9px 10px;border-bottom:1px solid #e3e3e3;cursor:pointer;background:#fff}.gazetteer-row:hover{background:#eee}.gazetteer-row small{color:#666}.settlement-capital.os-symbol,.custom-symbol.settlement-capital{width:40px!important;height:40px!important;font-size:21px;border-width:3px}.settlement-city.os-symbol,.custom-symbol.settlement-city{width:34px!important;height:34px!important;font-size:18px}.settlement-town.os-symbol,.custom-symbol.settlement-town{width:29px!important;height:29px!important}.settlement-village.os-symbol,.custom-symbol.settlement-village{width:24px!important;height:24px!important;font-size:13px}.grid-label{color:#111;font-size:11px;font-weight:bold;text-shadow:0 1px 2px #fff,0 -1px 2px #fff,1px 0 2px #fff,-1px 0 2px #fff;white-space:nowrap;pointer-events:none}.stat-cards{grid-template-columns:repeat(auto-fit,minmax(140px,1fr))}.stat-card strong{display:block;color:#666}.stat-card span{display:block;font-size:2rem;font-weight:bold;color:var(--primary-colour,#2b3260);margin-top:.25rem}.marker-cluster-small,.marker-cluster-medium,.marker-cluster-large{background-color:rgba(43,50,96,.28)}.marker-cluster-small div,.marker-cluster-medium div,.marker-cluster-large div{background-color:rgba(43,50,96,.88);color:#fff}
body.theme-dark .gazetteer-panel,body.theme-dark .gazetteer-row{background:#242424;color:#eee;border-color:#555}body.theme-dark .gazetteer-row:hover{background:#333}body.theme-dark .gazetteer-row small{color:#c6c6c6}body.theme-dark .gazetteer-head{border-bottom-color:#555}body.theme-dark .gazetteer-results{border-color:#555}body.theme-dark .grid-label{color:#fff;text-shadow:0 1px 2px #000,0 -1px 2px #000,1px 0 2px #000,-1px 0 2px #000}body.theme-dark .stat-card strong{color:#ccc}body.theme-dark .stat-card span{color:#9fb2ff}
@media print{.map-topbar,.floating-search,.floating-tools,.ops-panel,.admin-float,.gazetteer-panel,.leaflet-control-zoom{display:none!important}body.map-theme{overflow:visible!important;background:#fff!important}#mapShell,.map-theme #map{height:100vh!important;width:100vw!important}#coordReadout{right:10px;bottom:10px;background:#fff;color:#000}.leaflet-container{print-color-adjust:exact;-webkit-print-color-adjust:exact}}
@media(max-width:760px){.gazetteer-panel{left:12px;right:12px;top:86px;width:auto}}

/* v2.6.1 compact admin sidebar/menu polish */
.admin-shell{
  grid-template-columns:230px minmax(0,1fr);
}
.admin-sidebar{
  padding:12px 9px;
  position:sticky;
  top:0;
  height:100vh;
  overflow:auto;
  scrollbar-width:thin;
}
.admin-brand{
  gap:7px;
  padding:6px 6px 12px;
  margin-bottom:8px;
}
.admin-brand img{
  max-width:176px;
  max-height:82px;
}
.admin-brand strong{
  font-size:.92rem;
  line-height:1.1;
}
.admin-brand span{
  display:block;
  font-size:11px;
  line-height:1.15;
  opacity:.82;
  font-weight:normal;
}
.admin-nav{
  gap:3px;
}
.admin-nav a,
.admin-nav-link{
  display:flex!important;
  align-items:center;
  gap:7px;
  min-height:32px;
  padding:6px 8px!important;
  border-radius:6px!important;
  font-size:13px;
  line-height:1.15;
}
.admin-nav-icon{
  width:20px;
  min-width:20px;
  text-align:center;
  font-size:14px;
  line-height:1;
  opacity:.96;
}
.admin-nav-text{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.admin-nav a.active,
.admin-nav-link.active{
  background:rgba(255,255,255,.22)!important;
  border-color:rgba(255,255,255,.24)!important;
  box-shadow:inset 3px 0 0 var(--secondary-colour,#a25801);
}
.admin-nav-spacer{
  height:1px;
  margin:7px 5px;
  background:rgba(255,255,255,.22);
}
.admin-main{
  padding:18px;
}
.admin-main h1{
  font-size:1.55rem;
  margin-top:0;
}
.admin-main h2{
  font-size:1.25rem;
}
.admin-main .btn,
.admin-main button,
.admin-main input,
.admin-main select,
.admin-main textarea{
  font-size:13px;
}
.admin-main .btn,
.admin-main button{
  padding:6px 9px;
}
.admin-main td,
.admin-main th{
  padding:6px 7px;
  font-size:13px;
}
body.theme-dark .admin-nav-spacer{
  background:rgba(255,255,255,.16);
}
@media(max-width:900px){
  .admin-shell{grid-template-columns:1fr;}
  .admin-sidebar{position:relative;height:auto;padding:10px;border-right:0;border-bottom:4px solid var(--secondary-colour,#a25801);}
  .admin-brand{flex-direction:row;justify-content:flex-start;text-align:left;}
  .admin-brand img{max-height:54px;max-width:120px;}
  .admin-nav{display:grid;grid-template-columns:repeat(auto-fit,minmax(132px,1fr));gap:5px;}
  .admin-nav-spacer{display:none;}
  .admin-main{padding:14px;}
}


/* v2.6.4 Categories & Types layout fix */
.category-stack-form{
  grid-template-columns:1fr !important;
  align-items:stretch;
}
.category-stack-form label,
.category-stack-form input,
.category-stack-form button{
  width:100%;
}
.category-stack-form .btn.secondary{
  text-align:center;
}


/* v2.6.5 Categories & Types equal-width panels */
.category-type-split{
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(0,1fr);
  gap:16px;
  align-items:start;
}
.category-type-split .panel{
  width:100%;
  min-width:0;
}
@media(max-width:900px){
  .category-type-split{
    grid-template-columns:1fr;
  }
}

/* v2.7 public map polish: suggestions, scale, compass, loading */
.search-result.suggestion-row{
  display:grid;
  grid-template-columns:28px minmax(0,1fr);
  gap:8px;
  align-items:center;
}
.suggestion-icon{
  width:24px;height:24px;border-radius:50%;display:flex;align-items:center;justify-content:center;
  background:var(--secondary-colour,#a25801);color:#fff;font-size:12px;font-weight:bold;
}
.suggestion-title{font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.suggestion-meta{font-size:11px;opacity:.8;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.marker-popup-title{font-size:1.08rem;font-weight:800;margin-bottom:3px;}
.marker-popup-meta,.marker-popup-grid,.marker-popup-region{font-size:.9rem;margin:2px 0;}
.marker-popup-description{margin:.55rem 0;line-height:1.35;}
.marker-popup-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:.55rem;}
.marker-popup-actions a,.marker-popup-actions button{font-size:12px;}
.map-scale-bar{
  position:absolute;right:18px;bottom:26px;z-index:850;background:var(--panel-bg,#fff);color:var(--text-colour,#222);
  border:1px solid var(--border-colour,#bbb);border-radius:6px;padding:6px 8px;box-shadow:0 3px 10px rgba(0,0,0,.18);font-size:12px;pointer-events:none;
}
.map-scale-line{height:8px;border-left:2px solid currentColor;border-right:2px solid currentColor;border-bottom:2px solid currentColor;margin-bottom:3px;}
.map-scale-label{text-align:center;font-weight:700;}
.compass-rose{
  position:absolute;right:18px;top:calc(var(--toolbar-current-height,90px) + 18px);z-index:850;width:54px;height:54px;border-radius:50%;
  background:var(--panel-bg,#fff);color:var(--text-colour,#222);border:1px solid var(--border-colour,#bbb);box-shadow:0 3px 10px rgba(0,0,0,.18);
  display:flex;align-items:center;justify-content:center;font-weight:900;pointer-events:none;
}
.compass-rose::before{content:'▲';position:absolute;top:5px;font-size:20px;color:var(--secondary-colour,#a25801);}
.compass-rose span{position:absolute;bottom:6px;font-size:18px;letter-spacing:.03em;}
.map-loading{
  position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);z-index:1100;background:var(--panel-bg,#fff);color:var(--text-colour,#222);
  border:1px solid var(--border-colour,#bbb);border-radius:10px;padding:12px 16px;box-shadow:0 6px 24px rgba(0,0,0,.22);display:none;align-items:center;gap:10px;font-weight:700;
}
.map-loading.is-visible{display:flex;}
.map-spinner{width:18px;height:18px;border:3px solid rgba(128,128,128,.35);border-top-color:var(--secondary-colour,#a25801);border-radius:50%;animation:iapspin .8s linear infinite;}
@keyframes iapspin{to{transform:rotate(360deg)}}
.leaflet-tooltip.marker-hover-tooltip{background:var(--panel-bg,#fff);color:var(--text-colour,#222);border:1px solid var(--border-colour,#bbb);box-shadow:0 2px 8px rgba(0,0,0,.18);}
@media(max-width:700px){.compass-rose{width:42px;height:42px;right:10px}.map-scale-bar{right:10px;bottom:18px}.floating-search{max-width:calc(100vw - 20px)}}


/* v2.7.1 public map UI layout fix */
.map-topbar{
  gap:8px;
  padding:7px 12px;
}
.toolbar-link,
.toolbar-button,
.filter-dropbtn{
  padding:6px 9px;
  font-size:13px;
  border-radius:5px;
  min-height:31px;
  line-height:1.15;
}
.filter-dropbtn{min-width:118px;}
.toolbar-select{
  min-width:180px;
  gap:5px;
  font-size:13px;
}
.toolbar-select select{
  width:138px;
  padding:5px 7px;
  font-size:13px;
}
.user-toolbar{display:flex;align-items:center;gap:6px;flex-wrap:wrap;}
.user-chip{font-size:12px;opacity:.95;}
.top-search{display:flex;align-items:center;gap:5px;position:relative;}
.top-search-input{
  display:none;
  width:0;
  min-width:0;
  max-width:280px;
  padding:6px 9px;
  font-size:13px;
  border-radius:5px;
  border:1px solid rgba(255,255,255,.35);
  background:rgba(255,255,255,.96);
  color:#111;
  transition:width .16s ease;
}
.top-search.open .top-search-input{
  display:block;
  width:260px;
}
.top-search-close{
  display:none;
  min-height:31px;
  padding:5px 9px;
  border-radius:5px;
  background:rgba(255,255,255,.18);
  color:var(--toolbar-text-colour,#fff);
  border:1px solid rgba(255,255,255,.25);
}
.top-search.open .top-search-close{display:inline-block;}
body.theme-dark .top-search-input{background:#191919;color:#eee;border-color:#555;}

/* The detailed search/filter panel opens only when search is active. */
.floating-search{display:none;}
body.search-active .floating-search{display:block;}
.floating-search > #searchBox{display:none;}
#searchResults:empty{display:none;}
body.search-active #searchResults:not(:empty){display:block;}

/* Keep map furniture clear of the search panel and coordinate readout. */
.map-scale-bar{
  left:50%!important;
  right:auto!important;
  bottom:18px!important;
  transform:translateX(-50%);
  z-index:760;
}
.compass-rose{
  left:18px!important;
  right:auto!important;
  top:18px!important;
  z-index:760;
}
body.map-theme #coordReadout{z-index:900;}

/* Area layer checkboxes: tidy, left-aligned two-column rows. */
.area-layer-box{
  text-align:left;
}
.area-layer-box strong{display:block;margin-bottom:6px;}
.area-layer-box label{
  display:grid!important;
  grid-template-columns:22px minmax(0,1fr);
  align-items:center;
  justify-content:start;
  justify-items:start;
  gap:8px;
  margin:4px 0;
  text-align:left;
}
.area-layer-box input[type="checkbox"]{
  width:14px;
  height:14px;
  margin:0;
  justify-self:start;
}
.area-layer-box label span,
.area-layer-box label{white-space:normal;}

@media(max-width:1050px){
  .top-search.open .top-search-input{width:210px;}
  .toolbar-select{min-width:150px;}
  .toolbar-select select{width:120px;}
}
@media(max-width:760px){
  .map-topbar{gap:6px;padding:7px;}
  .toolbar-link,.toolbar-button,.filter-dropbtn{padding:6px 8px;font-size:12px;}
  .top-search{order:10;flex-basis:100%;}
  .top-search.open .top-search-input{width:min(100%, calc(100vw - 120px));flex:1;}
  .floating-search{left:10px;right:10px;top:10px;width:auto;max-width:none;}
  .compass-rose{left:10px!important;top:10px!important;width:42px;height:42px;}
  .map-scale-bar{bottom:48px!important;}
}

/* v2.7.2 layout fix: align compass, Leaflet zoom and map tool buttons on one vertical centre line. */
:root{
  --map-left-control-centre:39px;
  --map-compass-size:54px;
  --map-tool-size:46px;
  --map-zoom-width:34px;
}

.compass-rose{
  left:calc(var(--map-left-control-centre) - (var(--map-compass-size) / 2))!important;
  right:auto!important;
  top:18px!important;
  width:var(--map-compass-size)!important;
  height:var(--map-compass-size)!important;
  z-index:860!important;
}

/* Leaflet's default zoom control is 34px wide. Move it below the compass and centre it on the same axis. */
.leaflet-left .leaflet-control-zoom{
  margin-left:calc(var(--map-left-control-centre) - (var(--map-zoom-width) / 2))!important;
}
.leaflet-top .leaflet-control-zoom{
  margin-top:84px!important;
}
.leaflet-control-zoom{
  z-index:850!important;
}

.floating-tools{
  left:calc(var(--map-left-control-centre) - (var(--map-tool-size) / 2))!important;
}
.tool-icon{
  width:var(--map-tool-size)!important;
  height:var(--map-tool-size)!important;
}

@media(max-width:760px){
  :root{
    --map-left-control-centre:33px;
    --map-compass-size:42px;
    --map-tool-size:42px;
    --map-zoom-width:34px;
  }
  .compass-rose{
    left:calc(var(--map-left-control-centre) - (var(--map-compass-size) / 2))!important;
    top:10px!important;
  }
  .leaflet-left .leaflet-control-zoom{
    margin-left:calc(var(--map-left-control-centre) - (var(--map-zoom-width) / 2))!important;
  }
  .leaflet-top .leaflet-control-zoom{
    margin-top:64px!important;
  }
  .floating-tools{
    left:calc(var(--map-left-control-centre) - (var(--map-tool-size) / 2))!important;
  }
}

/* v2.8 map info, templates, bulk edit and duplicate detection */
.warning{background:#fff5d6;border-left:4px solid #c28100;padding:10px;border-radius:6px;color:#3b2a00}
.map-info-panel{position:absolute;top:16px;right:16px;width:min(760px,calc(100vw - 120px));max-height:78vh;overflow:auto;z-index:1350;background:rgba(255,255,255,.96);color:#222;border:1px solid #bbb;border-radius:10px;box-shadow:0 8px 30px #0005;padding:12px}
.map-info-head{display:flex;align-items:center;justify-content:space-between;gap:10px;border-bottom:1px solid #ddd;margin-bottom:10px;padding-bottom:8px}.map-info-head button{width:auto;padding:4px 9px;background:#666}.map-info-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px}.map-info-grid h3{margin:.4rem 0}.text-block{background:rgba(0,0,0,.035);border:1px solid rgba(0,0,0,.08);border-radius:8px;padding:10px;line-height:1.35;max-height:220px;overflow:auto}.mini-stats{font-size:13px}.completion-bars{display:grid;gap:7px}.completion-row{display:grid;grid-template-columns:110px 1fr 42px;gap:8px;align-items:center;font-size:13px}.completion-track{height:10px;border-radius:999px;background:#ddd;overflow:hidden}.completion-track i{display:block;height:100%;background:var(--secondary-colour,#a25801)}
.completion-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(140px,1fr));gap:10px}.bulk-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:10px;align-items:end}.marker-form select#markerTemplate{font-weight:bold}.admin-nav-link .admin-nav-text{white-space:nowrap}
body.theme-dark .warning{background:#3b2d0b;color:#ffe6a6;border-left-color:#d99821}
body.theme-dark .map-info-panel{background:rgba(28,28,28,.96);color:#eee;border-color:#555}.theme-dark .map-info-head{border-bottom-color:#444}.theme-dark .text-block{background:#181818;border-color:#444}.theme-dark .completion-track{background:#444}.theme-dark .mini-stats th,.theme-dark .mini-stats td{border-color:#444}
@media(max-width:900px){.map-info-panel{left:12px;right:12px;width:auto;top:72px}.map-info-grid{grid-template-columns:1fr}.completion-row{grid-template-columns:90px 1fr 38px}}

/* v2.8.2 dynamic map dimensions admin layout */
.maps-table .map-settings-form { margin: 0; }
.maps-table .mini-grid { display: grid; grid-template-columns: repeat(2, minmax(110px, 1fr)); gap: 6px; align-items: end; }
.maps-table .mini-grid label { display: flex; flex-direction: column; gap: 2px; font-size: 11px; }
.maps-table .mini-grid input { width: 100%; box-sizing: border-box; padding: 5px 6px; font-size: 12px; }
.maps-table .mini-grid .smallcheck { flex-direction: row; align-items: center; gap: 6px; margin-top: 16px; }
@media (max-width: 1100px) { .maps-table .mini-grid { grid-template-columns: 1fr; } }
