
.auth-page {
  position: fixed;
  z-index: 2000;
  inset: 0;
  min-height: 100vh;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  overflow-y: auto;
  background: rgba(7, 35, 31, .58);
  backdrop-filter: blur(12px);
}

.back-to-top-button {
    position: fixed;
    bottom: 16px;
    right: 16px;
    z-index: 9999;

    background: #198754;
    color: white;

    border: none;
    border-radius: 999px;

    width: 42px;
    height: 42px;
    padding: 0;

    font-size: 14px;
    font-weight: 600;

    cursor: pointer;

    box-shadow: 0 8px 20px rgba(0,0,0,.25);

    transition: all .2s ease;
}

.back-to-top-label { display: none; }

@media (max-width: 600px) {
  .back-to-top-button {
    bottom: max(12px, env(safe-area-inset-bottom));
    right: 12px;
    width: 38px;
    height: 38px;
  }
}

.back-to-top-button:hover {
    background: #157347;
    transform: translateY(-2px);
}

.auth-card {
  position: relative;
  width: min(460px, 100%);
  max-height: calc(100vh - 40px);
  padding: 38px;
  overflow-y: auto;
  border: 1px solid #cfe2dd;
  border-radius: 28px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(14, 54, 48, .12);
}

.auth-brand-mark {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  margin-bottom: 22px;
  border-radius: 18px;
  background: #0b5d52;
  color: #fff;
  font-weight: 800;
  letter-spacing: .08em;
}

.auth-title {
  margin: 0 0 10px;
  color: #173b36;
  font-size: 2rem;
}

.auth-subtitle {
  margin-bottom: 28px;
  color: #5d736f;
  line-height: 1.6;
}

.auth-field {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
  color: #294b46;
  font-weight: 700;
}

.auth-input {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid #bdd4cf;
  border-radius: 12px;
  font-size: 1rem;
  outline: none;
}

.auth-input:focus {
  border-color: #19a58e;
  box-shadow: 0 0 0 3px rgba(25,165,142,.14);
}

.auth-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 8px;
}

.auth-primary-button,
.auth-secondary-button,
.logout-button {
  border-radius: 12px;
  padding: 12px 16px;
  font-weight: 800;
  cursor: pointer;
}

.auth-primary-button {
  border: 1px solid #0b5d52;
  background: #0b5d52;
  color: #fff;
}

.auth-secondary-button {
  border: 1px solid #0b5d52;
  background: #fff;
  color: #0b5d52;
}

.auth-link-button {
  margin-top: 14px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #0b5d52;
  font-weight: 700;
  cursor: pointer;
}

.auth-message {
  min-height: 24px;
  margin-top: 16px;
  font-weight: 700;
}

.auth-dialog-close {
  position: absolute;
  top: 15px;
  right: 15px;
  display: grid;
  width: 36px;
  height: 36px;
  padding: 0;
  place-items: center;
  border: 1px solid #d7e4e1;
  border-radius: 50%;
  color: #49625e;
  background: #f6faf9;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.auth-dialog-close:hover {
  color: #173b36;
  background: #edf5f3;
}

.auth-divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  color: #83938f;
  font-size: .72rem;
  text-transform: uppercase;
}

.auth-divider span {
  height: 1px;
  background: #dce8e5;
}

.auth-guest-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  padding: 12px 16px;
  border: 1px solid #a6d8cd;
  border-radius: 12px;
  color: #075c50;
  background: #e9f8f4;
  font-size: .95rem;
  font-weight: 850;
  cursor: pointer;
}

.auth-guest-button:hover {
  transform: translateY(-1px);
  border-color: #59b8a4;
  background: #dcf3ed;
}

.auth-guest-button > span:first-child {
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: #0b6b5d;
}

.auth-guest-note {
  margin: 10px 0 0;
  color: #718480;
  font-size: .72rem;
  line-height: 1.45;
  text-align: center;
}

.auth-error { color: #b42318; }
.auth-success { color: #087a61; }

.auth-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
  padding: 12px 28px;
  border-bottom: 1px solid #d6e5e1;
  background: #fff;
}

.signed-in-user {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #5d736f;
}

.signed-in-email {
  color: #173b36;
}

.logout-button {
  border: 1px solid #0b5d52;
  background: #fff;
  color: #0b5d52;
}

@media (max-width: 600px) {
  .auth-card { padding: 28px 22px; }
  .auth-actions { grid-template-columns: 1fr; }
  .auth-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }
}


/* Fix clipped email/password text and normalize control sizing. */
.auth-card,
.auth-card *,
.auth-toolbar,
.auth-toolbar * {
  box-sizing: border-box;
}

.auth-input {
  display: block;
  width: 100%;
  min-height: 54px;
  height: 54px;
  padding: 13px 16px;
  line-height: 1.45;
  color: #173b36;
  background: #ffffff;
  font-family: inherit;
  font-size: 16px;
  overflow: visible;
  text-overflow: clip;
}

.auth-input:-webkit-autofill,
.auth-input:-webkit-autofill:hover,
.auth-input:-webkit-autofill:focus {
  -webkit-text-fill-color: #173b36;
  -webkit-box-shadow: 0 0 0 1000px #ffffff inset;
  caret-color: #173b36;
}

/* Keep long account email addresses visible. */
.signed-in-user {
  min-width: 0;
  flex-wrap: wrap;
}

.signed-in-email {
  max-width: min(460px, 65vw);
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Ensure the revealed dashboard and Leaflet map use the full width. */
#authenticated-app,
#authenticated-app .app-shell,
#authenticated-app .visualization-column,
#authenticated-app .map-card,
#authenticated-app .guardian-map,
#map {
  width: 100%;
  min-width: 0;
}

#map,
.guardian-map,
.leaflet-container {
  background: #dfe7e5;
}


/* Signed-in controls inside the green application hero. */
.hero-toolbar {
  display: flex;
  align-items: flex-end;
  flex-direction: column;
  gap: 14px;
  min-width: 250px;
}

.hero-user-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  color: rgba(255, 255, 255, 0.84);
}

.hero-user-label {
  font-size: 0.86rem;
}

.hero-user-email {
  max-width: 300px;
  color: #ffffff;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.hero-logout-button {
  padding: 9px 14px;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  font-weight: 800;
  cursor: pointer;
}

.hero-logout-button:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Make the two Plot Points panels sit beside each other on wide screens. */
.plot-tools-row > [class*="col-"] {
  display: flex;
}

.plot-tools-row .panel-card {
  width: 100%;
  height: 100%;
}

/* Give the left-side workspace enough room for side-by-side panels. */
@media (min-width: 1200px) {
  .dashboard-grid > .workspace-column {
    width: 58.333333%;
  }

  .dashboard-grid > .visualization-column {
    width: 41.666667%;
  }
}

@media (max-width: 991px) {
  .hero-toolbar {
    align-items: flex-start;
    min-width: 0;
    width: 100%;
  }

  .hero-user-controls {
    justify-content: flex-start;
  }
}


/* Prevent Chrome/autofill from visually clipping long email values. */
.auth-card {
  width: min(540px, calc(100vw - 40px));
}

.auth-field {
  min-width: 0;
}

.auth-input,
.auth-email-input {
  box-sizing: border-box;
  max-width: 100%;
  min-width: 0;
  width: 100%;
  height: 56px;
  padding: 12px 18px;
  border-radius: 12px;
  font-size: 16px;
  line-height: 24px;
  letter-spacing: normal;
  text-indent: 0;
  direction: ltr;
  white-space: nowrap;
  appearance: none;
  -webkit-appearance: none;
}

/* Keep text readable even when Chrome autofills the field. */
.auth-email-input:-webkit-autofill {
  font-size: 16px !important;
  line-height: 24px !important;
}


/* -----------------------------------------------------------------------
   Full-width dashboard and reliable hero controls
   ----------------------------------------------------------------------- */

#authenticated-app,
#authenticated-app > .app-shell,
.app-shell.container-fluid {
  width: 100% !important;
  max-width: none !important;
}

.app-shell.container-fluid {
  padding-left: clamp(16px, 2.25vw, 40px) !important;
  padding-right: clamp(16px, 2.25vw, 40px) !important;
}

/* The workspace now spans the screen. Plotted Locations and Adjust Forecast
   share the available width instead of being compressed into a side column. */
.dashboard-grid,
.dashboard-grid > .workspace-column,
.dashboard-grid > .visualization-column {
  width: 100% !important;
  max-width: 100% !important;
  flex: 0 0 100% !important;
}

.workspace-tabs,
.tab-content,
.tab-pane,
.plot-tools-row {
  width: 100%;
  max-width: none;
}

@media (min-width: 1200px) {
  .plot-tools-row > .col-xl-7 {
    flex: 0 0 58.333333% !important;
    width: 58.333333% !important;
    max-width: 58.333333% !important;
  }

  .plot-tools-row > .col-xl-5 {
    flex: 0 0 41.666667% !important;
    width: 41.666667% !important;
    max-width: 41.666667% !important;
  }
}

/* Decorative hero layers must not block the account controls. */
.app-hero::before,
.app-hero::after,
.app-hero *::before,
.app-hero *::after {
  pointer-events: none;
}

.app-hero {
  position: relative;
}

.brand-lockup {
  position: relative;
  z-index: 2;
}

.hero-toolbar,
.hero-user-controls,
.hero-user-email,
.hero-logout-button {
  position: relative;
  z-index: 20;
  pointer-events: auto !important;
}

.hero-logout-button {
  touch-action: manipulation;
  user-select: none;
}

.hero-logout-button:disabled {
  cursor: wait;
  opacity: 0.72;
}

/* Give the map and forecast full-screen horizontal room below the controls. */
.visualization-column {
  margin-top: 8px;
}

.map-card,
.chart-card,
.forecast-graph {
  width: 100% !important;
  max-width: none !important;
}


/* Map and forecast appear before the Help / Plot Points workspace. */
.visualization-column {
  order: 1;
}

.workspace-column {
  order: 2;
  margin-top: 12px;
}

/* Results heading appears only after locations have been analyzed. */
.results-output {
  width: 100%;
}

.results-eyebrow {
  margin-top: 8px;
  margin-bottom: 4px;
}

.results-title {
  margin-bottom: 18px;
}

/* Keep the logout button visually stable while Firebase signs out. */
.hero-logout-button {
  min-width: 96px;
}


/* Dedicated results section below the map, forecast, and controls. */
.results-section {
  width: 100%;
  margin-top: 28px;
  scroll-margin-top: 24px;
}

.results-section-header {
  margin-bottom: 14px;
}

.results-section .results-card {
  width: 100%;
  max-width: none;
}

/* Arrow link in the map header that scrolls to results. */
.map-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.results-jump-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid #0b5d52;
  border-radius: 999px;
  background: #ffffff;
  color: #0b5d52;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.results-jump-link:hover {
  background: #e8f6f2;
  color: #084b43;
  text-decoration: none;
}

.results-arrow-icon {
  font-size: 1.2rem;
  line-height: 1;
}

/* Smooth scrolling for the View Results arrow. */
html {
  scroll-behavior: smooth;
}

/* The forecast controls now use the full Plot Points width. */
.plot-tools-row > [class*="col-"] {
  flex: 0 0 100% !important;
  width: 100% !important;
  max-width: 100% !important;
}

@media (max-width: 700px) {
  .map-header-actions {
    justify-content: flex-start;
  }
}


/* Message shown only after the prediction model returns data. */
.results-ready-message-container:empty {
  display: none;
}

.results-ready-message-container {
  width: 100%;
  margin: 16px 0 8px;
}

.results-ready-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: 100%;
  padding: 16px 18px;
  border: 1px solid #9fd8cc;
  border-radius: 16px;
  background: #e9f8f4;
  color: #123f38;
}

.results-ready-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.results-ready-check {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #0b6b5d;
  color: #ffffff;
  font-weight: 900;
}

.results-ready-copy {
  display: grid;
  gap: 2px;
}

.results-ready-copy strong {
  font-size: 1rem;
}

.results-ready-copy span {
  color: #4c6964;
}

.results-ready-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  padding: 10px 14px;
  border-radius: 999px;
  background: #0b6b5d;
  color: #ffffff;
  font-weight: 800;
  text-decoration: none;
}

.results-ready-link:hover {
  background: #084f46;
  color: #ffffff;
  text-decoration: none;
}

@media (max-width: 700px) {
  .results-ready-banner {
    align-items: flex-start;
    flex-direction: column;
  }
}


/* Analysis-complete banner sits above the map. */
.results-ready-message-container {
  margin: 0 0 16px;
}

/* Forecast controls sit immediately above the forecast graph. */
.visualization-column > .forecast-controls {
  width: 100%;
  margin: 20px 0 16px;
}

.visualization-column > .forecast-controls .card-body {
  width: 100%;
}

.visualization-column > .forecast-controls .control-group {
  width: 100%;
}

/* Keep the reordered sections visually separated. */
.map-card + .forecast-controls {
  margin-top: 20px;
}

.forecast-controls + .chart-card {
  margin-top: 0;
}


/* Do not reserve any space when there are no model results. */
.results-ready-message-container:empty {
  display: none !important;
  margin: 0 !important;
  padding: 0 !important;
}


/* Help is now a toolbar link instead of a tab. */
.hero-help-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 9px 14px;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  font-weight: 800;
  text-decoration: none;
  pointer-events: auto !important;
}

.hero-help-link:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  text-decoration: none;
}

.hero-help-button {
  appearance: none;
  font: inherit;
  cursor: pointer;
}

/* Remove any remaining tab navigation from view. */
.workspace-tabs {
  display: none !important;
}

/* Standalone help section below the analysis areas. */
.help-section {
  width: 100%;
  margin-top: 24px;
  scroll-margin-top: 24px;
}

.help-section .panel-card {
  width: 100%;
  max-width: none;
}
html {
    scroll-behavior: smooth;
}

.hero-account-row,
.hero-navigation-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.hero-navigation-row {
    margin-top: 10px;
}

.results-card-toolbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.clear-analysis-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;

    flex: 0 0 auto;
    padding: 9px 15px;

    border: 1px solid #b42318;
    border-radius: 10px;

    background: #ffffff;
    color: #b42318;

    font-size: 14px;
    font-weight: 800;

    cursor: pointer;
    transition:
        background 0.2s ease,
        color 0.2s ease,
        transform 0.2s ease;
}

.clear-analysis-button:hover {
    background: #b42318;
    color: #ffffff;
    transform: translateY(-1px);
}

#interactive-map-section,
#collision-forecast-section,
#help-section {
    scroll-margin-top: 24px;
}

@media (max-width: 700px) {
    .hero-account-row,
    .hero-navigation-row {
        justify-content: flex-start;
    }

    .results-card-toolbar {
        flex-direction: column;
    }

    .clear-analysis-button {
        width: 100%;
    }
}
/* AVI Energy bird logo — shared with the native apps. */
img.auth-brand-mark {
  object-fit: cover;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: hidden;
}

.turbine-layer-controls {
  margin: 16px 0;
  padding: 16px;
  border: 1px solid #d9dee8;
  border-radius: 14px;
  background: #f8fafc;
}

.turbine-control-heading,
.turbine-layer-summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.turbine-layer-toggle label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 800;
  color: #183b33;
}

.turbine-filter-disclosure {
  margin: 12px 0;
  border: 1px solid #d7e0e7;
  border-radius: 10px;
  background: #ffffff;
  overflow: visible;
}

.turbine-filter-summary {
  display: flex;
  align-items: center;
  gap: 10px 16px;
  min-height: 44px;
  padding: 10px 14px;
  color: #183b33;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.turbine-filter-summary::-webkit-details-marker {
  display: none;
}

.turbine-filter-summary::after {
  content: "+ Show";
  margin-left: auto;
  color: #0b7667;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.turbine-filter-disclosure[open] .turbine-filter-summary::after {
  content: "− Hide";
}

.turbine-filter-summary-title {
  font-size: 14px;
  font-weight: 850;
}

.turbine-filter-summary-help {
  color: #64748b;
  font-size: 12px;
  font-weight: 600;
}

.turbine-filter-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) repeat(3, minmax(160px, 1fr));
  gap: 12px;
  margin: 0;
  padding: 14px;
  border-top: 1px solid #e2e8f0;
  align-items: end;
}

.turbine-filter-field label {
  display: block;
  margin-bottom: 6px;
  color: #475569;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.turbine-filter-field input {
  box-sizing: border-box;
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
}

.turbine-capacity-range {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.turbine-year-filter {
  grid-column: span 2;
  padding: 0 8px 4px;
}

.turbine-reset-button {
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid #64748b;
  border-radius: 8px;
  background: #fff;
  color: #334155;
  font-weight: 700;
}

.turbine-counts {
  color: #0f172a;
  font-weight: 800;
}

.dataset-version-label {
  display: flex;
  gap: 8px 14px;
  flex-wrap: wrap;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

.turbine-status-note {
  width: 100%;
  margin: 6px 0 0;
  color: #64748b;
  font-size: 12px;
  line-height: 1.45;
}

.methodology-modal .modal-content {
  overflow: hidden;
  border: 0;
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.24);
}

.methodology-modal .modal-header,
.methodology-modal .modal-footer {
  border-color: #e2e8f0;
}

.methodology-modal-content .section-title {
  margin-bottom: 4px;
}

.methodology-close-button {
  min-width: 96px;
  padding: 9px 16px;
  border: 0;
  border-radius: 9px;
  background: #0b7667;
  color: #ffffff;
  font-weight: 800;
}

@media (max-width: 980px) {
  .turbine-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .turbine-filter-grid {
    grid-template-columns: 1fr;
  }

  .turbine-year-filter {
    grid-column: span 1;
  }

  .turbine-filter-summary-help {
    display: none;
  }
}
