/* ECCC Canadian Weather Station Explorer styles — layered on top of /www/native-explorer.css */

#eccc-app {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  width: 100%;
  max-width: 1220px;
  margin: 1.25rem auto 2rem;
  color: #162432;
  min-width: 0;
}

#eccc-app .ce-controls-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-bottom: 0.85rem;
}

#eccc-app .ce-eyebrow {
  display: inline-block;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #0369a1;
}

#eccc-app .ce-controls-title {
  margin: 0.15rem 0 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
}

#eccc-app .ce-summary-pill {
  font-size: 0.83rem;
  color: #334155;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  padding: 0.28rem 0.75rem;
  max-width: 100%;
  overflow-wrap: break-word;
}

#eccc-app .ce-summary-title {
  font-weight: 700;
  color: #0f172a;
}

#eccc-app .ce-summary-meta {
  color: #475569;
}

#eccc-app .eccc-resolution-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-bottom: 0.8rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #e2e8f0;
}

#eccc-app .eccc-res-group {
  flex-wrap: wrap;
}

#eccc-app .eccc-controls-grid {
  display: grid;
  grid-template-columns: minmax(240px, 1.2fr) minmax(240px, 1.25fr) minmax(240px, 1.15fr) minmax(185px, 0.9fr);
  gap: 0.8rem 0.9rem;
  align-items: end;
}

#eccc-app .ce-search-dropdown:empty,
#eccc-app .ce-search-dropdown[hidden] {
  display: none;
}

#eccc-app .ce-field-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ce-muted);
  margin: 0;
}

#eccc-app .eccc-date-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
}

#eccc-app .eccc-date-pair input[type="date"] {
  width: 100%;
}

#eccc-app .ce-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0.32rem 0.75rem;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #1e293b;
  white-space: nowrap;
}

#eccc-app .ce-btn-primary {
  background: #0f172a;
  color: #ffffff;
  border-color: #0f172a;
}

#eccc-app .ce-btn-secondary:hover {
  background: #f1f5f9;
}

#eccc-app .ce-btn-sm {
  min-height: 32px;
  padding: 0.22rem 0.65rem;
  font-size: 0.79rem;
}

#eccc-app .ce-btn-xs {
  min-height: 28px;
  padding: 0.16rem 0.52rem;
  font-size: 0.75rem;
}

#eccc-app .ce-btn-neutral {
  background: #ffffff;
  color: #374151;
  border: 1px solid #cbd5e1;
}

#eccc-app .ce-btn-neutral:hover,
#eccc-app .ce-btn-neutral:focus-visible {
  background: #f3f4f6;
  color: #111827;
  border-color: #94a3b8;
}

#eccc-app .ce-option-main {
  font-weight: 600;
  color: #0f172a;
}

#eccc-app .ce-option-sub {
  font-size: 0.76rem;
  color: #64748b;
}

#eccc-app .ce-map-wrap {
  position: relative;
  width: 100%;
  min-height: 460px;
  height: 540px;
  background: #e6f1f7;
}

#eccc-app .ce-map-canvas {
  width: 100%;
  height: 100%;
}

.eccc-maplibre-popup .maplibregl-popup-content {
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  font-size: 0.82rem;
  line-height: 1.4;
  color: #102030;
  box-shadow: 0 4px 14px rgba(16, 32, 48, 0.16);
  border: 1px solid #cbd5e1;
}

.eccc-popup-kicker {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #0369a1;
}

.eccc-popup-title {
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 0.35rem;
}

.eccc-popup-stats {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.15rem 0.65rem;
  margin: 0;
  font-size: 0.79rem;
}

.eccc-popup-stats dt {
  color: #64748b;
  font-weight: 600;
}

.eccc-popup-stats dd {
  margin: 0;
  color: #0f172a;
  font-weight: 600;
  text-align: right;
}

#eccc-app .ce-map-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(248, 250, 252, 0.85);
  color: #0f172a;
  font-size: 0.92rem;
  font-weight: 600;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.18s ease;
}

#eccc-app .ce-map-loading.is-visible {
  opacity: 1;
}

#eccc-app .ce-chip-clear {
  border: none;
  background: rgba(15, 23, 42, 0.12);
  color: #0f172a;
  border-radius: 999px;
  width: 20px;
  height: 20px;
  line-height: 1;
  cursor: pointer;
  font-weight: 700;
}

#eccc-app #eccc-map-panel.is-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 1060;
  margin: 0;
  border-radius: 0;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  padding: max(0.75rem, env(safe-area-inset-top, 0px)) max(0.9rem, env(safe-area-inset-right, 0px)) max(0.75rem, env(safe-area-inset-bottom, 0px)) max(0.9rem, env(safe-area-inset-left, 0px));
}

#eccc-app #eccc-map-panel.is-fullscreen .ce-map-wrap {
  flex: 1 1 auto;
  height: auto;
  min-height: 240px;
}

#eccc-app #eccc-map-panel.is-fullscreen .ce-map-canvas {
  height: 100%;
}

#eccc-app .ce-map-wrap.is-globe {
  background: radial-gradient(circle at 50% 45%, #edf4f9 0%, #d8e5f0 68%, #c7d7e6 100%);
}

#eccc-app .ce-map-wrap.is-globe.is-sentinel {
  background: radial-gradient(circle at 50% 45%, #162338 0%, #0b1322 75%, #060b14 100%);
}

#eccc-app .eccc-map-legend-wrap {
  position: absolute;
  bottom: 12px;
  left: 10px;
  z-index: 15;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.3rem;
  max-width: calc(100% - 68px);
}

#eccc-app .eccc-legend-toggle {
  min-height: 28px;
  min-block-size: 28px;
  border: 1px solid #d7e1ec;
  background: rgba(255, 255, 255, 0.96);
  color: #162133;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 6px;
  padding: 0.2rem 0.55rem;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.14);
}

#eccc-app .eccc-legend-card {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid #d7e1ec;
  border-radius: 8px;
  padding: 0.45rem 0.65rem;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.16);
}

#eccc-app .eccc-legend-title {
  font-size: 0.73rem;
  font-weight: 700;
  color: #162133;
  margin-bottom: 0.25rem;
}

#eccc-app .eccc-legend-items {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.65rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: #425466;
}

#eccc-app .eccc-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  white-space: nowrap;
}

#eccc-app .eccc-legend-swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.25);
  flex-shrink: 0;
}

#eccc-app .eccc-swatch-swob { background: #7c3aed; }
#eccc-app .eccc-swatch-active { background: #10b981; }
#eccc-app .eccc-swatch-hist { background: #64748b; }
#eccc-app .eccc-swatch-selected { background: #f59e0b; border: 2px solid #0f172a; width: 11px; height: 11px; }

#eccc-app .ce-ad-anchor {
  min-height: 0;
}

#eccc-app .ce-tabs-shell {
  padding: 1rem 1.1rem;
}

#eccc-app .ce-dashboard-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  margin-top: 0.85rem;
  margin-bottom: 0.85rem;
}

#eccc-station-heading {
  margin: 0;
  font-size: 1.12rem;
  font-weight: 700;
  color: #0f172a;
}

#eccc-app .ce-banner-meta {
  font-size: 0.83rem;
  color: #475569;
  margin-top: 0.2rem;
}

#eccc-app .ce-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}

#eccc-app .ce-status-pill.is-live {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

#eccc-app .ce-status-pill.is-provenance-purple {
  background: #f5f3ff;
  color: #2e1065;
  border: 1px solid #d8b4fe;
}

#eccc-app .ce-status-pill.is-loading {
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

#eccc-app .ce-status-pill.is-error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

#eccc-app .eccc-narrative-card {
  margin-bottom: 0.85rem;
}

#eccc-app .eccc-related-stations {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.65rem;
  padding-top: 0.6rem;
  border-top: 1px dashed #cbd5e1;
  font-size: 0.82rem;
  color: #334155;
}

#eccc-app .eccc-related-label {
  font-weight: 700;
  color: #0f172a;
}

#eccc-app .eccc-related-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  min-height: 30px;
  padding: 0.18rem 0.6rem;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #0c4a6e;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

#eccc-app .eccc-related-btn:hover {
  background: #e0f2fe;
  border-color: #0369a1;
}

#eccc-app .eccc-normals-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem 1rem;
  padding: 0.65rem 0.85rem;
  margin-bottom: 0.85rem;
  border-radius: 10px;
  border: 1px solid #d8b4fe;
  background: #faf5ff;
}

#eccc-app .eccc-normals-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

#eccc-app .eccc-norm-select {
  min-height: 36px;
  border: 1px solid #94a3b8;
  border-radius: 8px;
  background: #ffffff;
  padding: 0.25rem 0.6rem;
  font-size: 0.84rem;
  color: #0f172a;
}

#eccc-app .eccc-dash-toolbar-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem 0.9rem;
  margin-bottom: 0.9rem;
}

#eccc-app .eccc-dash-jumpbar {
  margin: 0;
}

#eccc-app .ce-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.7rem;
  margin-bottom: 1rem;
}

#eccc-app .ce-kpi-sub {
  margin-top: 0.18rem;
  font-size: 0.76rem;
  color: #475569;
}

#eccc-app .ce-charts-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.95rem;
}

#eccc-app .ce-chart-card {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #ffffff;
  padding: 0.85rem;
  min-width: 0;
}

#eccc-app .ce-chart-card-wide {
  grid-column: 1 / -1;
}

#eccc-app .ce-chart-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
}

#eccc-app .ce-chart-card-head h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
}

#eccc-app .ce-plot-host {
  width: 100%;
  min-height: 300px;
  height: 315px;
}

#eccc-app .ce-windrose-host {
  width: 100%;
  min-height: 300px;
}

#eccc-app .ce-windrose-readout {
  font-size: 0.81rem;
  font-weight: 600;
  color: #1e293b;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 0.35rem 0.6rem;
  margin-bottom: 0.4rem;
}

#eccc-app .ce-windrose-svg {
  width: 100%;
  height: auto;
  max-height: 300px;
  display: block;
}

#eccc-app .ce-windrose-wedge {
  cursor: pointer;
  transition: opacity 0.12s ease;
}

#eccc-app .ce-windrose-wedge:hover,
#eccc-app .ce-windrose-wedge:focus {
  opacity: 0.84;
  outline: none;
}

#eccc-app .eccc-normals-tables-host {
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
  margin-top: 0.95rem;
}

#eccc-app .eccc-norm-group-card {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #ffffff;
  padding: 0.85rem;
}

#eccc-app .eccc-norm-group-title {
  margin: 0 0 0.55rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
}

#eccc-app .ce-table-scroll {
  width: 100%;
  overflow-x: auto;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

#eccc-app .ce-data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

#eccc-app .ce-data-table th,
#eccc-app .ce-data-table td {
  padding: 0.45rem 0.58rem;
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
  white-space: nowrap;
}

#eccc-app .ce-data-table thead th {
  background: #f8fafc;
  color: #0f172a;
  font-weight: 700;
}

#eccc-app .eccc-sort-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

#eccc-app .eccc-sort-btn:hover,
#eccc-app .eccc-sort-btn:focus-visible {
  color: #0369a1;
  outline: 2px solid transparent;
}

#eccc-app .eccc-sort-btn:focus-visible {
  outline: 2px solid #0369a1;
  outline-offset: 2px;
  border-radius: 4px;
}

#eccc-app .eccc-sort-ind {
  font-size: 0.72em;
  opacity: 0.55;
}

#eccc-app .eccc-sort-btn.is-sorted .eccc-sort-ind {
  opacity: 1;
  color: #0369a1;
}

#eccc-app input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}

#eccc-app .eccc-flag-badge {
  display: inline-block;
  margin-left: 0.25rem;
  padding: 0.04rem 0.32rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  background: #e2e8f0;
  color: #1e293b;
}

#eccc-app .ce-table-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.83rem;
  color: #475569;
  margin-bottom: 0.55rem;
}

#eccc-app .ce-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.7rem;
}

#eccc-app .ce-stations-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.85rem;
  margin-bottom: 0.7rem;
}

#eccc-app .ce-stations-toolbar input[type="search"] {
  flex: 1 1 260px;
  max-width: 440px;
}

#eccc-app .ce-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 0.85rem;
  margin-top: 0.95rem;
}

#eccc-app .ce-info-card {
  padding: 0.9rem 1rem;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
}

#eccc-app .ce-info-card h3 {
  margin: 0 0 0.55rem;
  font-size: 0.92rem;
  font-weight: 700;
  color: #0f172a;
}

#eccc-app .ce-kv-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.42rem;
  font-size: 0.85rem;
}

#eccc-app .ce-kv-list li {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  border-bottom: 1px dashed #f1f5f9;
  padding-bottom: 0.25rem;
}

#eccc-app .ce-kv-label {
  color: #64748b;
  font-weight: 600;
}

#eccc-app .ce-kv-val {
  color: #0f172a;
  font-weight: 600;
  text-align: right;
}

#eccc-app .ce-crosswalk-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.4rem;
}

#eccc-app .ce-crosswalk-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #0369a1;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
}

#eccc-app .ce-empty-state {
  padding: 2rem 1rem;
  text-align: center;
  color: #475569;
  font-size: 0.9rem;
}

#eccc-app .eccc-empty-msg {
  max-width: 68ch;
  margin: 0 auto 0.85rem;
  line-height: 1.5;
}

#eccc-app .eccc-empty-actions {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

#eccc-app .ce-seo-snapshot {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 0.75rem 1rem;
  background: #f8fafc;
}

#eccc-app .ce-seo-snapshot summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  color: #334155;
}

#eccc-app .ce-seo-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  list-style: none;
  padding: 0;
  margin: 0.6rem 0;
}

#eccc-app .ce-seo-chip {
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  font-size: 0.78rem;
  color: #334155;
}

#eccc-app .ce-seo-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  margin-top: 0.5rem;
}

#eccc-app .ce-seo-table th,
#eccc-app .ce-seo-table td {
  padding: 0.38rem 0.5rem;
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
}

#eccc-app .eccc-featured-section {
  padding: 0.95rem 1.1rem;
}

#eccc-app .eccc-section-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
}

#eccc-app .eccc-section-sub {
  margin: 0.2rem 0 0.7rem;
  font-size: 0.85rem;
  color: #475569;
}

#eccc-app .eccc-panel-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.85rem;
  margin-bottom: 0.75rem;
}

#eccc-app #eccc-view-map .ce-map-frame {
  margin-top: 0.85rem;
}

#eccc-app .ce-chip-open {
  min-height: 24px;
  padding: 0.1rem 0.55rem;
  font-size: 0.73rem;
}

#eccc-app .ce-preset-pill.is-active,
#eccc-app .ce-preset-pill[aria-pressed="true"] {
  background: #0f172a;
  color: #ffffff;
  border-color: #0f172a;
}

@media (max-width: 1024px) {
  #eccc-app .eccc-controls-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  #eccc-app .eccc-controls-grid,
  #eccc-app .ce-charts-grid {
    grid-template-columns: 1fr;
  }

  #eccc-app .ce-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #eccc-app .ce-map-wrap {
    height: 360px;
    min-height: 320px;
  }

  #eccc-app .ce-plot-host {
    min-height: 260px;
    height: 270px;
  }
}

@media (hover: none), (pointer: coarse), (max-width: 768px) {
  #eccc-app .modebar-container,
  #eccc-app .modebar {
    display: none !important;
  }
}

@media (pointer: coarse) {
  #eccc-app .ce-seg-btn,
  #eccc-app .ce-preset-pill,
  #eccc-app .ce-btn,
  #eccc-app .ce-tab-btn,
  #eccc-app .eccc-related-btn {
    min-height: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #eccc-app *,
  #eccc-app *::before,
  #eccc-app *::after {
    transition-duration: 0.001ms !important;
    animation-duration: 0.001ms !important;
  }
}

@media (forced-colors: active) {
  #eccc-app .ce-btn,
  #eccc-app .ce-seg-btn,
  #eccc-app .ce-preset-pill,
  #eccc-app .ce-tab-btn,
  #eccc-app .eccc-related-btn,
  #eccc-app .ce-chart-card,
  #eccc-app .ce-info-card {
    border: 1px solid CanvasText;
  }
}
