:root {
  --header: #4d4d59;
  --header-dark: #3f3f49;
  --panel-bg: #f4f5f8;
  --card: #ffffff;
  --border: #d9dce5;
  --text: #242631;
  --muted: #686b78;
  --accent: #176da8;
  --accent-dark: #105580;
  --focus: #f4b942;
  --shadow: 0 2px 8px rgba(31, 35, 48, 0.12);
  --panel-width: 430px;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; font-family: Arial, Helvetica, sans-serif; color: var(--text); }
button, select, input { font: inherit; }
button { cursor: pointer; }

.app-header {
  height: 50px;
  min-height: 50px;
  background: #0d3d4f;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  box-shadow: 0 6px 20px rgba(0,0,0,.12);
  position: relative;
  z-index: 5;
}
#logo { display:flex; align-items:center; flex-shrink:0; height:38px; min-width:108px; }
#logo img { height:32px; width:auto; max-width:125px; display:block; }
#app-title { color:#fff; font-size:16px; font-weight:650; flex:1; min-width:180px; line-height:1.2; }
.header-actions { display:flex; align-items:center; gap:2px; }
.hbtn {
  display:flex; flex-direction:column; align-items:center; gap:2px;
  background:none; border:none; cursor:pointer; color:#fff; font-size:11px;
  padding:6px 8px; border-radius:6px; transition:background .15s; flex-shrink:0;
}
.hbtn:hover { background:rgba(255,255,255,.12); }
.hbtn svg { width:20px; height:20px; fill:#c8d84b; }


.app-shell { height: calc(100% - 50px); display: grid; grid-template-columns: minmax(0, 1fr) var(--panel-width); }
.map-area { position: relative; min-width: 0; }
#viewDiv { width: 100%; height: 100%; }

.side-panel { background: var(--panel-bg); border-left: 1px solid #c8cad3; display: flex; flex-direction: column; min-height: 0; }
.panel-tabs { background: var(--header); display: grid; grid-template-columns: 1fr 1fr; }
.tab { border: 0; background: transparent; color: #e8e8ec; padding: 15px 10px; font-weight: 700; border-bottom: 3px solid transparent; }
.tab.active { background: var(--header-dark); border-bottom-color: #fff; color: #fff; }
#resultCountBadge { display: inline-grid; place-items: center; min-width: 22px; height: 22px; border-radius: 11px; background: rgba(255,255,255,.18); margin-left: 4px; }
.panel-content { display: none; overflow: auto; padding: 12px; flex: 1; }
.panel-content.active { display: block; }

.section-card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 1px 3px rgba(0,0,0,.06); margin-bottom: 12px; }
.guided-search { padding: 16px; }
.section-card h2 { font-size: 20px; margin: 0 0 14px; }
.section-card label { display: block; font-size: 12px; font-weight: 700; color: #545767; text-transform: uppercase; letter-spacing: .04em; margin: 13px 0 6px; }
select, input[type="number"] { width: 100%; border: 1px solid #bfc4d0; border-radius: 7px; min-height: 42px; padding: 8px 10px; background: #fff; }
select:focus, input:focus, button:focus-visible { outline: 3px solid rgba(244,185,66,.55); outline-offset: 1px; }
.hidden, .conditional-group.hidden, .notice.hidden, .modal.hidden { display: none !important; }
.notice { margin-top: 12px; padding: 10px; background: #edf5fa; border-left: 4px solid var(--accent); font-size: 14px; }
.radius-row { display: grid; grid-template-columns: 1fr 76px; gap: 12px; align-items: end; margin-top: 10px; }
input[type="range"] { width: 100%; accent-color: var(--accent); }
.preset-row { display: flex; gap: 6px; margin: 8px 0 14px; flex-wrap: wrap; }
.preset-row button { border: 1px solid #c4c8d1; background: #f8f9fb; border-radius: 16px; padding: 5px 10px; font-size: 12px; }
.action-btn { width: 100%; border: 0; border-radius: 8px; background: var(--accent); color: #fff; font-weight: 700; padding: 12px; }
.action-btn:hover { background: var(--accent-dark); }
.action-btn:disabled { opacity: .6; cursor: wait; }
.status-text { min-height: 18px; margin: 9px 0 0; color: var(--muted); font-size: 13px; }
.section-card summary { padding: 14px 15px; font-weight: 700; cursor: pointer; list-style-position: inside; }
.details-body { padding: 0 15px 15px; }
.tier-info h3 { margin: 10px 0 4px; display: flex; align-items: center; gap: 8px; }
.tier-info p { margin: 0 0 12px; color: #4f5260; line-height: 1.45; }
.license-chip { width: 28px; height: 28px; display: inline-grid; place-items: center; border-radius: 50%; color: #fff; font-weight: 800; }
.tier1 { background: #2c7a3f; } .tier2 { background: #b06b12; } .tier3 { background: #7a3a94; }

.results-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 12px; margin-bottom: 10px; }
.results-toolbar strong, .results-toolbar small { display: block; }
.results-toolbar small { color: var(--muted); margin-top: 3px; }
.results-toolbar button { border: 1px solid var(--accent); color: var(--accent); background: #fff; border-radius: 7px; padding: 8px 10px; font-weight: 700; }
.results-toolbar button:disabled { opacity: .45; cursor: not-allowed; }
.results-list { display: grid; gap: 9px; }
.result-card { background: #fff; border: 1px solid var(--border); border-left: 5px solid var(--accent); border-radius: 10px; padding: 12px; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.result-card:hover { box-shadow: var(--shadow); }
.result-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.result-title { font-weight: 800; margin: 0; line-height: 1.25; }
.result-distance { white-space: nowrap; color: var(--accent); font-weight: 700; font-size: 13px; }
.result-type { display: flex; align-items: center; gap: 7px; margin: 8px 0; color: #4e5260; font-size: 13px; }

.result-meta { margin: 4px 0; color: #555966; font-size: 13px; overflow-wrap: anywhere; }
.result-actions { display: flex; gap: 7px; margin-top: 10px; }
.result-actions button, .result-actions a { border: 1px solid #c6cad3; background: #f8f9fb; color: #30333e; text-decoration: none; border-radius: 6px; padding: 6px 9px; font-size: 12px; font-weight: 700; }
.empty-state { text-align: center; color: var(--muted); padding: 50px 20px; }

.layer-check { display: flex; gap: 8px; align-items: center; margin: 8px 0; font-size: 13px; }
.layer-check input { width: auto; }

.modal { position: fixed; inset: 0; background: rgba(20,22,30,.55); z-index: 20; display: grid; place-items: center; padding: 20px; }
.modal-card { width: min(560px, 100%); background: #fff; border-radius: 14px; padding: 24px; position: relative; box-shadow: 0 18px 50px rgba(0,0,0,.3); }
.modal-close { position: absolute; right: 12px; top: 10px; border: 0; background: none; font-size: 28px; }
.modal-card li { margin: 8px 0; }

@media (max-width: 920px) {
  :root { --panel-width: 360px; }

}
@media (max-width: 720px) {
  .app-header { height: 50px; min-height: 50px; padding: 4px 8px; gap: 4px; }
  #logo { min-width: 82px; height: 34px; }
  #logo img { height: 28px; max-width: 95px; }
  #app-title { font-size: 13px; min-width: 90px; }
  .hbtn { padding: 4px; font-size: 9px; }
  .hbtn svg { width: 16px; height: 16px; }
  .app-shell { height: calc(100% - 50px); display: block; position: relative; }
  .map-area { height: 55%; }
  .side-panel { height: 45%; border-left: 0; border-top: 1px solid #c8cad3; }
}



#addressSearchGroup {
  margin-top: 12px;
}
#addressSearchGroup > label {
  display: block;
  margin-bottom: 6px;
}
.fall-line-hint {
 margin: 6px 0 10px;
 font-size: 12px;
 line-height: 1.5;
 color: #555;
}
.fall-line-hint strong {
 color: #092c37;
 font-weight: 600;
}
/* Classic ArcGIS Search widget */
#searchWidgetContainer {
  width: 100%;
}
#searchWidgetContainer .esri-search {
  width: 100%;
  max-width: none;
}
#searchWidgetContainer .esri-search__container {
  width: 100%;
}


/* Combined installer information / map-layer section */
.map-layer-divider {
  height: 1px;
  background: #d9dde3;
  margin: 18px 0 14px;
}
.map-layer-heading {
  margin-top: 0 !important;
}
.map-layer-note {
  margin-bottom: 10px !important;
  font-size: 0.92rem;
}
#layerListContainer {
  margin-top: 6px;
}

/* License information chips */
.license-chip.pumper { background: #176da8; }
.license-chip.manufacturer { background: #b44c4c; }


/* Unified license information + layer visibility controls */
.license-toggle-note {
  margin: 2px 0 14px !important;
  padding: 9px 10px;
  border-radius: 7px;
  background: #f4f7f9;
  color: #4f5260;
  font-size: 0.9rem;
}
.license-info-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px 0;
  border-bottom: 1px solid #e5e8ec;
}
.license-info-row:last-child { border-bottom: 0; }
.license-description h3 { margin: 1px 0 4px;font-size:16px; }
.license-description p { margin: 0 0 7px; font-size:14px; }
.license-toggle {
  border: 0;
  padding: 0;
  cursor: pointer;
  font: inherit;
  box-shadow: 0 0 0 2px rgba(255,255,255,.95), 0 0 0 3px rgba(0,0,0,.12);
  transition: opacity .15s ease, transform .15s ease, filter .15s ease;
}
.license-toggle:hover { transform: scale(1.08); }
.license-toggle:focus-visible { outline: 3px solid #1f6feb; outline-offset: 3px; }
.license-toggle[aria-pressed="false"] {
  opacity: .30;
  filter: grayscale(1);
  box-shadow: none;
}
.license-toggle[aria-pressed="false"]::after {
  content: "";
}

/* Header tools and ArcGIS basemap gallery */
.basemap-card { width: min(620px, 96vw); max-height: 82vh; overflow: auto; }
#basemapGallery { display: block; min-height: 360px; }
.share-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; }
.share-row input { width: 100%; min-height: 42px; border: 1px solid #bfc4d0; border-radius: 7px; padding: 8px 10px; }
.action-btn.compact { width: auto; white-space: nowrap; padding: 10px 14px; }
.share-native { margin-top: 10px; }
@media (max-width: 720px) {
  .header-actions { gap: 4px; }
  .header-btn { padding: 8px 9px; font-size: 12px; }
  .header-btn:not(.primary) { display: inline-block; }
  .share-row { grid-template-columns: 1fr; }
}

/* V12 compact header tools */
.tool-popover {
  position: fixed;
  top: 78px;
  right: 14px;
  z-index: 30;
  width: min(390px, calc(100vw - 28px));
  max-height: calc(100vh - 96px);
  overflow: auto;
  background: #fff;
  border: 1px solid #d7dae3;
  border-radius: 12px;
  box-shadow: 0 12px 34px rgba(25, 28, 38, .22);
  padding: 16px;
}
.tool-popover-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid #e7e9ef;
}
.tool-popover-header h2 { margin: 0; font-size: 18px; }
.tool-popover-header p { margin: 3px 0 0; color: var(--muted); font-size: 12px; line-height: 1.4; }
.tool-close {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 7px;
  background: #f2f3f6;
  color: #4c4f59;
  font-size: 22px;
  line-height: 1;
}
.tool-close:hover { background: #e6e8ed; }
.basemap-popover { width: min(400px, calc(100vw - 28px)); }
.basemap-gallery-wrap { max-height: 430px; overflow: auto; }
#basemapGallery { display: block; min-height: 260px; }
.share-popover { width: min(420px, calc(100vw - 28px)); }

.help-steps { display: grid; gap: 8px; }
.help-step {
  display: grid;
  grid-template-columns: 30px minmax(0,1fr);
  gap: 10px;
  align-items: start;
  padding: 10px;
  border: 1px solid #e2e5eb;
  border-radius: 9px;
  background: #fafbfc;
}
.help-step > span {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--header);
  color: #fff;
  font-weight: 800;
  font-size: 12px;
}
.help-step strong { display: block; font-size: 13px; margin-top: 1px; }
.help-step p { margin: 3px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.help-note {
  margin-top: 9px;
  padding: 9px 10px;
  border-radius: 8px;
  background: #f4f5f8;
  color: #565967;
  font-size: 12px;
  line-height: 1.45;
}

/* V12 refined Search / Results tabs */
.panel-tabs {
  padding: 8px;
  gap: 6px;
  background: var(--header);
}
.tab {
  border-radius: 8px;
  border-bottom: 0;
  padding: 10px 12px;
  transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}
.tab:hover { background: rgba(255,255,255,.08); }
.tab.active {
  background: #fff;
  color: var(--header);
  box-shadow: 0 2px 6px rgba(0,0,0,.16);
}
#resultCountBadge {
  min-width: 21px;
  height: 21px;
  background: rgba(255,255,255,.17);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
}
.tab.active #resultCountBadge {
  background: var(--header);
  color: #fff;
}

/* V12 refined results */
#resultsPanel { padding: 14px; }
.results-toolbar {
  position: sticky;
  top: 0;
  z-index: 2;
  border-radius: 12px;
  padding: 13px 14px;
  box-shadow: 0 2px 7px rgba(35, 39, 50, .08);
}
.results-toolbar strong { font-size: 15px; color: #252834; }
.results-toolbar small { font-size: 12px; }
.results-toolbar button {
  background: var(--header);
  border-color: var(--header);
  color: #fff;
  padding: 8px 12px;
}
.results-toolbar button:hover:not(:disabled) { background: var(--header-dark); }
.results-list { gap: 10px; }
.result-card {
  position: relative;
  border-left-width: 4px;
  border-radius: 12px;
  padding: 14px;
  box-shadow: 0 2px 6px rgba(31, 35, 48, .06);
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.result-card:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(31, 35, 48, .11); }
.result-title-row { align-items: flex-start; }
.result-title { font-size: 15px; color: #252834; }
.result-distance {
  background: #f1f3f6;
  color: #4f5260;
  border-radius: 999px;
  padding: 4px 7px;
  font-size: 11px;
}
.result-type { margin: 8px 0 10px; }
.result-license-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 800;
  background: #f2f3f6;
}
.result-meta {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  column-gap: 8px;
  margin: 5px 0;
  font-size: 12px;
  line-height: 1.4;
}
.result-meta strong { color: #383b46; }
.result-actions { padding-top: 4px; border-top: 1px solid #eef0f4; margin-top: 11px; }
.result-actions button, .result-actions a {
  background: #fff;
  border-color: #cfd3dc;
  border-radius: 7px;
  padding: 7px 10px;
}
.result-actions button:hover, .result-actions a:hover { background: #f2f4f7; }
.empty-state {
  background: #fff;
  border: 1px dashed #cfd3dc;
  border-radius: 12px;
  padding: 34px 18px;
}

@media (max-width: 720px) {
  .tool-popover { top: 68px; right: 8px; width: calc(100vw - 16px); max-height: calc(100vh - 76px); }
  .basemap-popover, .share-popover { width: calc(100vw - 16px); }
}

/* V14: header tools open inside the map, never over the search/results panel */
.map-area .tool-popover {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 20;
  width: min(390px, calc(100% - 24px));
  max-height: calc(100% - 24px);
  overflow: auto;
}
.map-area .basemap-popover { width: min(400px, calc(100% - 24px)); }
.map-area .share-popover { width: min(420px, calc(100% - 24px)); }
.map-area .basemap-gallery-wrap { max-height: min(430px, calc(100vh - 190px)); }

@media (max-width: 720px) {
  .map-area .tool-popover {
    top: 8px;
    right: 8px;
    width: calc(100% - 16px);
    max-height: calc(100% - 16px);
  }
  .map-area .basemap-popover,
  .map-area .share-popover { width: calc(100% - 16px); }
  .map-area .basemap-gallery-wrap { max-height: 240px; }
}

/* V17: header and splash aligned to Commercial Labs styling */
:root { --header:#092c37; --header-dark:#072530; }
.app-header { height:100px; min-height:100px; padding:10px 20px; gap:18px; background:#092c37; }
#logo { height:76px; min-width:280px; }
#logo img { height:73px; max-width:285px; width:auto; object-fit:contain; }
#app-title { font-size:23px; font-weight:600; min-width:0; }
.header-actions { gap:14px; }
.hbtn { font-size:14px; padding:8px 10px; gap:6px; }
.hbtn svg { width:25px; height:25px; fill:#b9bd33; }
.app-shell { height:calc(100% - 100px); }

@media(max-width:1000px) {

 .app-header { height:82px; min-height:82px; padding:8px 12px; gap:10px; }

 #logo { height:60px; min-width:195px; }

 #logo img { height:58px; max-width:195px; }

 #app-title { font-size:18px; }

 .header-actions { gap:3px; }

 .hbtn { font-size:11px; padding:5px; }

 .hbtn svg { width:20px; height:20px; }

 .app-shell { height:calc(100% - 82px); }
}

@media(max-width:720px) {

 .app-header { height:72px; min-height:72px; gap:5px; padding:5px 7px; }

 #logo { height:46px; min-width:100px; }

 #logo img { height:44px; max-width:105px; }

 #app-title { font-size:12px; min-width:0; }

 .hbtn { font-size:9px; padding:3px; }

 .hbtn svg { width:16px; height:16px; }

 .app-shell { height:calc(100% - 72px); }
}

/* OSWW startup information — same modal design system as CELMapp. */
.disclaimer-splash {
  position:fixed; inset:0; z-index:1000; display:flex;
  align-items:center; justify-content:center; padding:20px;
  background:rgba(0,0,0,.45);
}
.disclaimer-splash.hidden { display:none !important; }
.disclaimer-card {
  width:min(650px,94vw); max-height:82vh; overflow:hidden;
  display:flex; flex-direction:column; background:#103d50; color:#fff;
  border-radius:16px; box-shadow:0 20px 60px rgba(0,0,0,.32);
}
.disclaimer-heading { padding:14px 42px 8px; text-align:center; flex:none; }
.disclaimer-heading h2 { margin:0; padding:0; color:#fff; font-size:18px; line-height:1.25; font-weight:700; background:none; }
.disclaimer-content { padding:12px 26px 20px; overflow-y:auto; font-size:14px; line-height:1.45; }
.disclaimer-logo { display:block; width:210px; max-width:90%; height:76px; object-fit:contain; margin:0 auto 10px; }
.disclaimer-content p { margin:6px 0; }
.disclaimer-content h3 { color:#fff; font-size:16px; margin:14px 0 6px; padding-bottom:4px; border-bottom:1px solid rgba(255,255,255,.25); }
.disclaimer-actions { display:flex; justify-content:flex-end; margin-top:14px; }
.disclaimer-confirm { appearance:none; -webkit-appearance:none; padding:9px 24px; border:0; border-radius:6px; background:#b9bd33; color:#0d3d4f; font-size:16px; font-weight:700; cursor:pointer; }
.disclaimer-confirm:hover { background:#c9cd41; }
.disclaimer-confirm:focus-visible { outline: none; box-shadow: none; }
#runSearchBtn { background:var(--header); color:#fff; }
#runSearchBtn:hover:not(:disabled) { background:var(--header-dark); }
#radiusSlider { accent-color:var(--header); }
@media(max-width:600px) {
  .disclaimer-card { width:96vw; max-height:88vh; }
  .disclaimer-heading { padding:12px 20px 6px; }
  .disclaimer-heading h2 { font-size:16px; }
  .disclaimer-content { padding:10px 16px 16px; }
  .disclaimer-logo { width:190px; height:68px; }
}

/* Fall Line result below the existing address search (no extra search control). */
.fall-line-result { margin-top: 9px; padding: 10px 12px; border-radius: 6px; background: #e9f1f3; border-left: 4px solid #0d3d4f; color: #173b45; font-size: 13px; line-height: 1.45; }
.fall-line-result[hidden] { display: none !important; }
.fall-line-result.above { background: #eaf2eb; border-left-color: #477956; }
.fall-line-result.below { background: #e8f0f5; border-left-color: #376e90; }
.fall-line-result.review { background: #faf2e3; border-left-color: #a47928; }

/* Print panel: reuse the existing floating tool-popover style. */
.map-area .print-popover { width: min(420px, calc(100% - 24px)); }
.print-widget-wrap { padding: 10px; overflow-y: auto; max-height: min(65vh, 560px); }
.print-widget-wrap .esri-print { width: 100%; }
@media (max-width: 650px) { .map-area .print-popover { width: calc(100% - 16px); } }
