/* ------------------------------------------------------------------------
   Header tweaks (new)
------------------------------------------------------------------------ */

header {
  background-color: #7ea253;
  padding: 0.75rem 1rem;
  text-align: center;
}

header .logo {
  display: block;
  margin: 0 auto 0.5rem;
  height: 36px;
  width: auto;
}

.header-text .site-title {
  color: white;
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.header-text .site-subtitle {
  color: #e0f4d9;
  font-size: 1rem;
  margin-bottom: 0.3rem;
}

.header-text .site-link a {
  color: #cce8c1;
  font-size: 0.85rem;
  text-decoration: none;
}

.header-text .site-link a:hover {
  text-decoration: underline;
}

/* ------------------------------------------------------------------------
   Base & Layout
------------------------------------------------------------------------ */

html, body {
  height: 100%;
  margin: 0;
}

body {
  display: flex;
  flex-direction: column;
  font-family: system-ui, sans-serif;
  background-color: #f4f4f4;
}

/* ------------------------------------------------------------------------
   Map
------------------------------------------------------------------------ */

#map {
  flex: 1;
  width: 100%;
}

/* ------------------------------------------------------------------------
   Legend container
------------------------------------------------------------------------ */

.legend {
  position: absolute;
  bottom: 24px;
  right: 18px;
  z-index: 500;
  background: white;
  border: 1px solid #d3d3d3;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.10);
  padding: 10px 14px;
  max-width: 410px;
  min-width: 210px;
  font-size: 1rem;
  color: #333;
  transition: opacity 0.15s;
}

.legend-title {
  font-size: 1.08em;
  font-weight: bold;
  color: #5a5a5a;
  margin-bottom: 0.3em;
}

/* ------------------------------------------------------------------------
   Legend “mini–box” around icon list + separator
------------------------------------------------------------------------ */

.legend-box {
  background: #fafafa;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 8px 12px;
  margin-bottom: 8px;
}

.legend-box .legend-icon {
  margin-right: 6px;
}

/* ------------------------------------------------------------------------
   Legend icons
------------------------------------------------------------------------ */

.legend-icon {
  display: inline-block;
  border-radius: 50%;
  width: 1em;
  height: 1em;
  border: 1.5px solid #222;
  vertical-align: middle;
}

.legend-blue   { background: #007bff; }
.legend-orange { background: #ffa500; }
.legend-purple { background: #AA40FF; }
.legend-red    { background: #e74c3c; }

/* ------------------------------------------------------------------------
   Explanation caption
------------------------------------------------------------------------ */

.meters-caption {
  font-size: 0.95em;
  color: #486030;
  background: #edf5e7;
  padding: 6px 8px;
  border-radius: 6px;
  margin: 4px 0 9px;
  border-left: 4px solid #7ea253;
  line-height: 1.42;
  text-align: center;
}

/* ------------------------------------------------------------------------
   County sections
------------------------------------------------------------------------ */

.county-section {
  margin: 12px 0 10px;
  border-left: 6px solid #7ea253;
  border-radius: 5px 0 0 5px;
  background: #f6faef;
  padding: 7px 7px 5px 13px;
}

/* overrides for Jackson/​Josephine/​Coos */
.county-section.jackson   { border-left-color: #068D9D; background: #eaf9fa; }
.county-section.josephine { border-left-color: #53599A; background: #f2f1fb; }
.county-section.coos      { border-left-color: #e74c3c; background: #fdecea; }

.county-name {
  font-weight: 700;
  font-size: 1.04em;
  letter-spacing: 0.02em;
  margin: 2px 0 3px;
  color: #444;
}

/* ------------------------------------------------------------------------
   Tables (fixed layout for vertical alignment)
------------------------------------------------------------------------ */

.meters-table {
  width: 100%;
  border-collapse: collapse;
  margin: 4px 0 0.4em;
  font-size: 0.96em;
  table-layout: fixed;
}

.meters-table td {
  padding: 3px 7px;
}

.meters-table td:first-child {
  width: 60%;
}

.meters-table td:last-child {
  width: 40%;
  text-align: right;
}

.utility-row {
  border-bottom: 1px solid #f0f0f0;
}

.table-total {
  font-weight: bold;
  border-top: 2px solid #ddd;
  background: #fff6f6;
}

.table-total .align-right {
  color: #d12c2c;
  font-size: 1.08em;
}

/* ------------------------------------------------------------------------
   Legend toggle button
------------------------------------------------------------------------ */

.legend-toggle {
  position: absolute;
  bottom: 24px;
  right: 18px;
  z-index: 600;
  background: white;
  padding: 3px 10px 3px 7px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  font-size: 0.96em;
  border: 1px solid #d3d3d3;
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  user-select: none;
  min-width: 115px;
}

.legend-toggle input[type=checkbox] {
  accent-color: #7ea253;
  margin: 0 6px 0 0;
}

/* ------------------------------------------------------------------------
   Footer
------------------------------------------------------------------------ */

.site-footer {
  position: fixed;
  left: 0;
  bottom: 0;
  width: 100vw;
  background: #f9f9f9cc;
  color: #7ea253;
  font-size: 1rem;
  text-align: center;
  padding: 0.55em 0 0.7em;
  z-index: 50;
}

/* ------------------------------------------------------------------------
   Responsive tweaks
------------------------------------------------------------------------ */

@media (max-width: 600px) {
  .legend {
    font-size: 0.97rem;
    padding: 7px;
    bottom: 10px;
    right: 4px;
    max-width: 97vw;
  }
  .legend-toggle {
    padding: 2px 6px 2px 5px;
    bottom: 10px;
    right: 4px;
    font-size: 0.93em;
    min-width: 105px;
  }
  .county-section {
    padding: 6px 3px 4px 9px;
    margin-top: 10px;
  }
  .meters-caption {
    font-size: 0.97em;
    padding: 4px 5px;
    margin-bottom: 7px;
  }
}

/* ------------------------------------------------------------------------
   Details summary arrow
------------------------------------------------------------------------ */

summary::-webkit-details-marker { display: none; }
details summary { list-style: none; cursor: pointer; }
details summary::before {
  content: "▸"; display: inline-block; margin-right: 6px;
  transform-origin: center; transition: transform 0.2s ease;
}
details[open] summary::before { transform: rotate(90deg); }

/* ------------------------------------------------------------------------
   Map‐watermark CSS
------------------------------------------------------------------------ */

.county-watermark {
  font-size: 3.5rem;
  font-weight: 700;
  color: rgba(0, 0, 0, 0.06);
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
  transform: translate(-50%, -50%);
}

/* Readber board text */
.dms-board {
  display: inline-block;
  background: #111;
  border-radius: 5px;
  padding: 8px 12px;
  margin: 6px 0;
  font-size: 20px;
}
.dms-row {
  white-space: pre;
  font-family: 'Roboto Mono', 'Consolas', 'Courier New', monospace;
  letter-spacing: 2px;
  color: #FFD600;
  font-weight: bold;
  text-shadow: 0 0 2px #FFD600, 0 0 6px #222;
  display: block;
  line-height: 1.3;
}

/* Tabs */
.legend-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}
.legend-tab {
  background: #ededed;
  border: 1px solid #b2b2b2;
  border-radius: 6px 6px 0 0;
  padding: 2px 18px;
  cursor: pointer;
  font-weight: 600;
  color: #444;
  transition: background 0.2s;
  outline: none;
}
.legend-tab-active {
  background: #fff;
  border-bottom: 1px solid #fff;
  color: #222;
  box-shadow: 0 -1px 4px rgba(0,0,0,0.03);
}

#layers-panel label { cursor:pointer; font-size:16px; }
#layers-panel input[type="checkbox"] { margin-right: 7px; }
#layers-button button:focus { outline: 2px solid #7ea253; }


