/* public/css/map.css — all styles */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  color: #1a1a1a;
}

/* ── Map ─────────────────────────────────────────────────────────────────── */

#map {
  position: absolute;
  inset: 0;
}

/* ── Region panel ────────────────────────────────────────────────────────── */

.region-panel {
  position: absolute;
  top: 16px;
  left: 16px;
  width: 360px;
  max-height: calc(100vh - 32px);
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  z-index: 10;
  display: flex;
  flex-direction: column;
}

.region-panel__search {
  height: 68px;
  padding: 22px var(--space-lg);
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.region-panel__search-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--font-family);
  font-size: 20px;
  font-weight: 400;
  letter-spacing: -0.4px;
  color: rgba(0, 0, 0, 0.5);
}

.region-panel__search-input::placeholder {
  color: rgba(0, 0, 0, 0.5);
}

.search-clear {
  display: none;
  border: none;
  background: none;
  font-size: 20px;
  color: rgba(0, 0, 0, 0.3);
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}

.search-clear--visible {
  display: block;
}

.search-result-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px var(--space-lg);
  border-bottom: 1px solid var(--color-soft-border);
  cursor: pointer;
}

.search-result-row:hover {
  background: var(--color-soft-shade);
}

.search-result-row__lockup {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.search-result-row__name {
  font-size: var(--text-region);
  font-weight: var(--weight-medium);
  color: var(--color-primary);
  letter-spacing: var(--tracking-region);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-result-row__meta {
  font-size: var(--text-subheading);
  font-weight: var(--weight-medium);
  color: var(--color-secondary);
  letter-spacing: var(--tracking-subheading);
}

.search-section-label {
  padding: 12px var(--space-lg) 4px;
  font-size: var(--text-label);
  font-weight: var(--weight-semibold);
  color: var(--color-secondary);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
}

.search-loading {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 40px 0;
}

.search-loading__dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--color-secondary);
  animation: search-pulse 1.2s ease-in-out infinite;
}

.search-loading__dot:nth-child(2) { animation-delay: 0.15s; }
.search-loading__dot:nth-child(3) { animation-delay: 0.3s; }

@keyframes search-pulse {
  0%, 80%, 100% { opacity: 0.2; }
  40% { opacity: 1; }
}

.region-panel__list {
  flex: 1;
  overflow-y: auto;
}

/* Region list items */

.region-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 80px;
  padding: var(--space-xl) var(--space-lg);
  border-bottom: 1px solid var(--color-soft-border);
  background: #fff;
  cursor: pointer;
  user-select: none;
  transition: background 0.12s;
}

.region-list-item:last-child {
  border-bottom: none;
}

.region-list-item:hover {
  background: rgba(0, 0, 0, 0.03);
}

.region-list-item.active {
  background: rgba(0, 0, 0, 0.05);
}

.region-list-item__lockup {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.region-list-item__name {
  font-family: var(--font-family);
  font-size: var(--text-region);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-region);
  color: var(--color-primary);
  line-height: normal;
}

.region-list-item__subtitle {
  font-family: var(--font-family);
  font-size: var(--text-subheading);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-subheading);
  color: var(--color-secondary);
  line-height: normal;
}

.region-list-item__avy {
  min-width: 37px;
  padding: var(--space-xs) 6px;
  border-radius: 3px;
  font-family: var(--font-family);
  font-size: var(--text-label);
  font-weight: var(--weight-semibold);
  letter-spacing: -0.18px;
  color: var(--color-primary);
  text-align: center;
  line-height: normal;
  background: var(--color-avy-moderate); /* placeholder */
}

/* ── Panel view layout ───────────────────────────────────────────────────── */

#panel-list-view {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

#panel-overview {
  display: none;
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

/* ── Subnav ──────────────────────────────────────────────────────────────── */

.subnav {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  height: 48px;
  padding: var(--space-lg);
  border-bottom: 1px solid var(--color-soft-border);
  background: var(--color-base);
  cursor: pointer;
  user-select: none;
  flex-shrink: 0;
}

.subnav__icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  display: block;
}

.subnav__label {
  font-family: var(--font-family);
  font-size: var(--text-eyebrow);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-eyebrow);
  color: var(--color-primary);
  line-height: normal;
}

/* ── Region overview ─────────────────────────────────────────────────────── */

.overview-title {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 22px var(--space-lg);
  background: var(--color-base);
  flex-shrink: 0;
}

.overview-title__name {
  font-family: var(--font-family);
  font-size: var(--text-title);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-title);
  color: var(--color-primary);
  line-height: normal;
}

.overview-title__subtitle {
  font-family: var(--font-family);
  font-size: var(--text-subheading);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-subheading);
  color: var(--color-secondary);
  line-height: var(--leading-snug);
}

.overview-avy {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: var(--space-xl) var(--space-lg);
  background: var(--color-avy-no-rating); /* placeholder */
  flex-shrink: 0;
}

.overview-avy__eyebrow {
  font-family: var(--font-family);
  font-size: var(--text-eyebrow);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-eyebrow);
  color: var(--color-primary);
  line-height: normal;
}

.overview-avy__right {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 136px;
}

.overview-avy__rating {
  font-family: var(--font-family);
  font-size: var(--text-heading);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-heading);
  color: var(--color-primary);
  line-height: normal;
}

.overview-avy__link {
  font-family: var(--font-family);
  font-size: var(--text-label);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-label);
  color: var(--color-secondary);
  line-height: normal;
}

/* Overview location rows */

.overview-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: var(--space-xl) var(--space-lg);
  border-bottom: 1px solid var(--color-soft-border);
}

.overview-row:last-child {
  border-bottom: none;
}

.overview-row__name {
  font-family: var(--font-family);
  font-size: var(--text-subheading);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-subheading);
  color: var(--color-secondary);
  line-height: var(--leading-snug);
}

.overview-row__data {
  width: 136px;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.overview-row__item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.overview-row__item--secondary {
  width: 54px;
  flex: none;
}

.overview-row__value {
  font-family: var(--font-family);
  font-size: var(--text-heading);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-heading);
  color: var(--color-primary);
  line-height: normal;
}

.overview-row__label {
  font-family: var(--font-family);
  font-size: var(--text-label);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-label);
  color: var(--color-secondary);
  line-height: normal;
}

/* ── Avalanche detail view ────────────────────────────────────────────────── */

#panel-avy-detail {
  display: none;
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

.avy-detail-title {
  padding: 22px var(--space-lg);
}

.avy-detail-title__name {
  font-size: var(--text-title);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-title);
  display: block;
}

.avy-detail-title__subtitle {
  font-size: var(--text-subheading);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-subheading);
  display: block;
  margin-top: 4px;
}

.avy-forecast-body {
  padding: var(--space-lg);
  color: var(--color-secondary);
}

.avy-forecast-date {
  font-size: var(--text-subheading);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-subheading);
  line-height: var(--leading-snug);
  margin-bottom: 8px;
}

.avy-forecast-date--expired {
  color: var(--color-avy-high);
  font-weight: var(--weight-semibold);
}

.avy-forecast-text {
  font-size: var(--text-subheading);
  font-weight: 400;
  letter-spacing: var(--tracking-subheading);
  line-height: 18px;
  margin: 0;
}

.avy-forecast-text p {
  margin: 0 0 14px;
}

.avy-forecast-text p:last-child {
  margin-bottom: 0;
}

.avy-general-info-text {
  font-family: var(--font-family);
  font-size: var(--text-subheading);
  font-weight: 400;
  letter-spacing: var(--tracking-subheading);
  line-height: 18px;
  color: var(--color-secondary);
}

.avy-general-info-text p {
  margin: 0 0 14px;
}

.avy-general-info-text p:last-child {
  margin-bottom: 0;
}

.avy-general-info-text ul {
  margin: 0 0 14px;
  padding-left: 20px;
}

.avy-general-info-text li {
  margin-bottom: 4px;
}

.avy-discussion {
  position: relative;
  overflow: clip;
  padding: var(--space-lg) var(--space-lg) var(--space-xl);
  gap: var(--space-sm);
  display: flex;
  flex-direction: column;
}

.avy-discussion__body {
  font-family: var(--font-family);
  font-size: var(--text-subheading);
  font-weight: 400;
  letter-spacing: var(--tracking-subheading);
  line-height: 18px;
  color: var(--color-secondary);
  max-height: 54px;
  overflow: hidden;
}

.avy-discussion--expanded .avy-discussion__body {
  max-height: none;
}

.avy-discussion__body p {
  margin: 0 0 14px;
}

.avy-discussion__body p:last-child {
  margin-bottom: 0;
}

.avy-discussion__body a,
.avy-general-info-text a {
  color: var(--color-secondary);
  text-decoration: underline;
}

.avy-discussion__gradient {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 78px;
  background: linear-gradient(to bottom, rgba(255,255,255,0), var(--color-base));
  pointer-events: none;
}

.avy-discussion--expanded .avy-discussion__gradient {
  display: none;
}

.avy-discussion__expand {
  padding-top: var(--space-xs);
  font-family: var(--font-family);
  font-size: var(--text-subheading);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-subheading);
  line-height: var(--leading-snug);
  color: var(--color-action);
  cursor: pointer;
}

.avy-forecast-link {
  font-size: var(--text-label);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-label);
  color: var(--color-secondary);
  text-decoration: none;
  display: inline-block;
  margin-top: 10px;
}

.avy-center-badge {
  padding: var(--space-lg) var(--space-sm) var(--space-sm);
}

.avy-center-badge__card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: var(--space-lg);
  background: var(--color-soft-border);
  border-radius: 8px;
  text-decoration: none;
  overflow: hidden;
}

.avy-center-badge__logo {
  width: 48px;
  height: 48px;
  border-radius: 5.333px;
  flex-shrink: 0;
  object-fit: cover;
}

.avy-center-badge__text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  white-space: nowrap;
}

.avy-center-badge__name {
  font-family: var(--font-family);
  font-size: var(--text-subheading);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-subheading);
  line-height: var(--leading-snug);
  color: var(--color-primary);
}

.avy-center-badge__link {
  font-family: var(--font-family);
  font-size: var(--text-label);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-label);
  color: var(--color-secondary);
}

.avy-elev-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 20px var(--space-lg);
  border-bottom: 1px solid var(--color-soft-border);
  position: relative;
}

.avy-elev-row__range {
  flex: 1;
  font-size: var(--text-subheading);
  font-weight: var(--weight-medium);
  color: var(--color-secondary);
  letter-spacing: var(--tracking-subheading);
  line-height: var(--leading-snug);
}

.avy-elev-row__data {
  width: 136px;
  flex-shrink: 0;
}

.avy-elev-row__rating {
  font-size: var(--text-heading);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-heading);
  color: var(--color-primary);
}

.avy-elev-row__level {
  font-size: var(--text-label);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-label);
  color: var(--color-secondary);
  margin-top: 2px;
}

.avy-elev-row__bar {
  position: absolute;
  right: 0;
  top: 0;
  width: 9px;
  height: 100%;
  border-radius: 0;
}

.avy-problem-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.avy-problem-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 32px 17px;
  overflow: hidden;
}

.avy-problem-cell--border-r {
  border-right: 1px solid var(--color-soft-border);
}

.avy-problem-cell--border-b {
  border-bottom: 1px solid var(--color-soft-border);
}

.avy-problem-icon-wrap {
  width: 96px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.avy-problem-icon {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.avy-problem-rose-wrap {
  width: 120px;
  height: 120px;
}

.avy-scale-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  width: 100%;
}

.avy-scale__label {
  font-size: var(--text-subheading);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-subheading);
  color: var(--color-primary);
}

.avy-scale__track {
  position: relative;
  width: 100%;
  height: 175px;
}

.avy-scale__bar {
  position: absolute;
  left: 12px;
  top: 0;
  width: 8px;
  height: 100%;
  border-radius: 1000px;
  background: rgba(0, 0, 0, 0.1);
}

.avy-scale__highlight {
  position: absolute;
  left: 12px;
  width: 8px;
  border-radius: 1000px;
  background: var(--color-primary);
}

.avy-scale__levels {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.avy-scale__level {
  flex: 1;
  display: flex;
  align-items: center;
  padding-left: 36px;
  font-size: var(--text-subheading);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-subheading);
  color: var(--color-secondary);
}

.avy-scale__level--active {
  color: var(--color-primary);
}

/* ── Panel detail view ───────────────────────────────────────────────────── */

#panel-detail {
  display: none;
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

/* Detail title block */

.detail-title {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 22px var(--space-lg);
  flex-shrink: 0;
}

.detail-title__name {
  font-family: var(--font-family);
  font-size: var(--text-title);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-title);
  color: var(--color-primary);
  line-height: normal;
}

.detail-title__subtitle {
  font-family: var(--font-family);
  font-size: var(--text-subheading);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-subheading);
  color: var(--color-secondary);
  line-height: var(--leading-snug);
}

/* Conditions section */

.detail-section-header {
  height: 51px;
  display: flex;
  align-items: center;
  padding: 20px var(--space-lg) var(--space-lg);
  background: #fff;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  flex-shrink: 0;
}

.detail-section-header__label {
  font-family: var(--font-family);
  font-size: 12px;
  font-weight: var(--weight-semibold);
  letter-spacing: -0.24px;
  color: var(--color-primary);
  line-height: normal;
}

.detail-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: var(--space-xl) var(--space-lg);
  border-bottom: 1px solid var(--color-soft-border);
}

.detail-row:last-child {
  border-bottom: none;
}

.detail-row__label-group {
  display: flex;
  align-items: center;
  gap: 4px;
}

.detail-row__label {
  font-family: var(--font-family);
  font-size: var(--text-subheading);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-subheading);
  color: var(--color-secondary);
  line-height: var(--leading-snug);
}

.detail-row__info-bug {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 6px;
  font-weight: var(--weight-semibold);
  color: rgba(0, 0, 0, 0.5);
  line-height: 1;
  flex-shrink: 0;
  cursor: default;
}

.detail-row__data {
  width: 136px;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.detail-row__item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.detail-row__item--secondary {
  width: 54px;
  flex: none;
}

.detail-row__value {
  font-family: var(--font-family);
  font-size: var(--text-heading);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-heading);
  color: var(--color-primary);
  line-height: normal;
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.detail-row__unit {
  font-size: 10px;
  font-weight: var(--weight-semibold);
  letter-spacing: 0;
  line-height: normal;
  align-self: flex-start;
}

.detail-row__sublabel {
  font-family: var(--font-family);
  font-size: var(--text-label);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-label);
  color: var(--color-secondary);
  line-height: normal;
}

/* Weather section tabs */

.detail-tabs {
  display: flex;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  flex-shrink: 0;
  padding-top: var(--space-lg);
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--color-base);
}

.detail-tab {
  display: flex;
  align-items: center;
  height: 46px;
  padding: 0 var(--space-lg);
  font-family: var(--font-family);
  font-size: 12px;
  font-weight: var(--weight-semibold);
  letter-spacing: -0.24px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: rgba(0, 0, 0, 0.54);
  cursor: pointer;
  user-select: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.12s;
}

.detail-tab:hover {
  color: var(--color-primary);
}

.detail-tab--active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

/* Weather eyebrow row (model chip area) */

.detail-weather-eyebrow {
  height: 55px;
  display: flex;
  align-items: center;
  position: sticky;
  top: 62px;
  z-index: 2;
  background: var(--color-base);
  justify-content: space-between;
  padding: 0 var(--space-lg);
  background: var(--color-soft-shade);
  border-bottom: 1px solid var(--color-soft-border);
  flex-shrink: 0;
}

.detail-weather-eyebrow__label {
  font-family: var(--font-family);
  font-size: var(--text-eyebrow);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-eyebrow);
  color: var(--color-primary);
  line-height: normal;
}

.detail-model-chip {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px 4px 12px;
  border-radius: 1000px;
  border: 1px solid rgba(0, 0, 0, 0.2);
  cursor: pointer;
  user-select: none;
  background: transparent;
  transition: background 0.12s;
}

.detail-model-chip:hover {
  background: rgba(0, 0, 0, 0.05);
}

.detail-model-chip__label {
  font-family: var(--font-family);
  font-size: 12px;
  font-weight: var(--weight-semibold);
  letter-spacing: 0;
  color: rgba(0, 0, 0, 0.6);
  line-height: normal;
}

.detail-model-chip__chevron {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  display: block;
}

/* Weather table */

.detail-table-header {
  display: flex;
  gap: 8px;
  padding: 0 var(--space-lg);
  height: 32px;
  align-items: center;
  background: var(--color-soft-shade);
  border-bottom: 1px solid var(--color-soft-border);
  flex-shrink: 0;
  position: sticky;
  top: 117px;
  z-index: 1;
}

.loc-hourly-day-header {
  padding: var(--space-lg);
  font-size: var(--text-subheading);
  font-weight: var(--weight-medium);
  color: var(--color-secondary);
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-subheading);
  border-bottom: 1px solid var(--color-soft-border);
}

.detail-table-row {
  display: flex;
  gap: 8px;
  padding: 20px var(--space-lg);
  align-items: center;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.detail-table-row:last-child {
  border-bottom: none;
}

.loc-seasonal-cur {
  background: var(--color-soft-shade);
}

/* Skeleton loading rows */

.skeleton-row .skeleton-bar {
  display: block;
  height: 12px;
  width: 60%;
  border-radius: 4px;
  background: linear-gradient(90deg, rgba(0,0,0,0.06) 25%, rgba(0,0,0,0.1) 50%, rgba(0,0,0,0.06) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
}

.skeleton-row .detail-table-cell:first-child .skeleton-bar { width: 50%; }
.skeleton-row .detail-table-cell:last-child .skeleton-bar { width: 40%; }

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-value .skeleton-bar {
  display: inline-block;
  height: 14px;
  width: 48px;
  border-radius: 4px;
  background: linear-gradient(90deg, rgba(0,0,0,0.06) 25%, rgba(0,0,0,0.1) 50%, rgba(0,0,0,0.06) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  vertical-align: middle;
}

.skeleton-value .skeleton-bar--narrow { width: 32px; }

.detail-table-cell {
  flex: 1;
  font-family: var(--font-family);
  font-size: 12px;
  font-weight: var(--weight-medium);
  letter-spacing: -0.24px;
  line-height: 16px;
  color: rgba(0, 0, 0, 0.54);
}

.detail-table-header .detail-table-cell {
  font-size: var(--text-label);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-label);
  color: var(--color-secondary);
  line-height: normal;
}

.detail-table-row .detail-table-cell:nth-child(3),
.detail-table-header .detail-table-cell:nth-child(3) {
  flex: 1.1;
}

.detail-wind-cell {
  flex: 0.9;
  display: flex;
  align-items: center;
  gap: 4px;
}

.detail-wind-cell__value {
  font-family: var(--font-family);
  font-size: 12px;
  font-weight: var(--weight-medium);
  letter-spacing: -0.24px;
  line-height: 16px;
  color: rgba(0, 0, 0, 0.54);
  width: 42px;
  flex-shrink: 0;
}

.detail-wind-arrow {
  width: 10px;
  height: 10px;
  flex-shrink: 0;
}

/* Weather placeholder (tabs with no data yet) */

.detail-weather-placeholder {
  padding: var(--space-xl) var(--space-lg);
  font-family: var(--font-family);
  font-size: var(--text-subheading);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-subheading);
  color: rgba(0, 0, 0, 0.35);
  line-height: var(--leading-snug);
}

/* Overview row clickability */

.overview-row {
  cursor: pointer;
}

.overview-row:hover {
  background: rgba(0, 0, 0, 0.03);
}

/* ── Dropdown ────────────────────────────────────────────────────────────── */

.detail-dropdown {
  position: fixed;
  z-index: 9999;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.18);
  overflow-y: auto;
  width: 250px;
}

.detail-dropdown__item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px var(--space-lg);
  cursor: pointer;
  border-bottom: 1px solid var(--color-soft-border);
  transition: background 0.1s;
}

.detail-dropdown__item:last-child {
  border-bottom: none;
}

.detail-dropdown__item:hover {
  background: rgba(0, 0, 0, 0.04);
}

.detail-dropdown__item--active {
  background: rgba(0, 0, 0, 0.05);
}

.detail-dropdown__item-label {
  font-family: var(--font-family);
  font-size: var(--text-subheading);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-subheading);
  color: var(--color-primary);
  line-height: normal;
}

.detail-dropdown__item-desc {
  font-family: var(--font-family);
  font-size: var(--text-subheading);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-subheading);
  color: var(--color-secondary);
  line-height: var(--leading-snug);
}

/* ── Map actions bar ─────────────────────────────────────────────────────── */

.map-actions {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.map-action-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: #fff;
  box-shadow: 0px 2px 12px 0px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  position: relative;
  flex-shrink: 0;
}

.map-action-layers {
  position: relative;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.map-action-btn--label {
  font-size: 11px;
  font-weight: 700;
  color: #1a1a1a;
  letter-spacing: -0.02em;
}

.map-action-btn--theme {
  padding: 0;
}

.map-action-btn--angle {
  gap: 0;
}

.angle-icons {
  display: flex;
  align-items: center;
  gap: 4px;
  transform: rotate(-90deg);
  transform-origin: center;
  will-change: transform;
}

.map-action-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.map-action-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ff6f27;
  color: #fff;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: -0.018em;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s ease;
}

.map-action-badge--hidden {
  opacity: 0;
}

/* ── Layers panel ────────────────────────────────────────────────────────── */

.layers-panel {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 10;
  background: #121212;
  border-radius: 12px;
  box-shadow: 0px 2px 12px 0px rgba(0, 0, 0, 0.2);
  width: 320px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  transform-origin: top right;
  transform: scale(0.95);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.layers-panel--open {
  transform: scale(1);
  opacity: 1;
  pointer-events: auto;
}

.layer-menu-header {
  padding: 8px 8px 8px 16px;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  letter-spacing: -0.24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.layers-panel-close {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #121212;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.layer-menu-row {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 96px;
  padding: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.layer-menu-thumb {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  background: #222;
  flex-shrink: 0;
  object-fit: cover;
}

.layer-menu-lockup {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.layer-menu-name {
  font-size: 12px;
  font-weight: 500;
  color: #fff;
  line-height: 16px;
  letter-spacing: -0.24px;
  white-space: nowrap;
}

.layer-menu-desc {
  font-size: 12px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.54);
  line-height: 16px;
  letter-spacing: -0.24px;
}

.layer-toggle {
  width: 32px;
  height: 16px;
  border-radius: 100px;
  padding: 2px;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s;
}

.layer-toggle.is-on {
  background: #fff;
}

.layer-toggle__switch {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  flex-shrink: 0;
  transition: transform 0.2s;
}

.layer-toggle.is-on .layer-toggle__switch {
  background: #000;
  transform: translateX(16px);
}

.layer-wip-badge {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  padding: 4px 6px;
  font-size: 9px;
  font-weight: 600;
  color: #fff;
  letter-spacing: -0.18px;
  white-space: nowrap;
  flex-shrink: 0;
}


/* ── Debug overlay ───────────────────────────────────────────────────────── */

#debug-overlay {
  display: none;
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  background: #000;
  color: #fff;
  font-family: 'SF Mono', 'Fira Mono', 'Consolas', monospace;
  font-size: 11px;
  line-height: 1.6;
  padding: 10px 14px;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: auto;
  user-select: text;
}

#debug-overlay.visible {
  display: block;
}

/* ── Snow legend ─────────────────────────────────────────────────────────── */

.snow-legend {
  position: absolute;
  bottom: 44px;
  right: 16px;
  z-index: 10;
  background: #fff;
  border-radius: 12px;
  padding: 12px;
  width: 236px;
  box-shadow: 0px 2px 12px 0px rgba(0, 0, 0, 0.2);
  display: none; /* shown via JS when snow layer is active */
  flex-direction: column;
  gap: 6px;
}

.snow-legend__gradient {
  height: 5px;
  border-radius: 1000px;
  background: linear-gradient(to left, rgb(218, 0, 78) 0%, rgb(166, 39, 174) 20%, rgb(86, 80, 191) 40%, rgb(0, 123, 206) 60%, rgb(0, 188, 224) 80%, rgb(84, 227, 234) 100%);
}

.snow-legend__labels {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #000;
  white-space: nowrap;
}

/* ── Focus pulse dot ─────────────────────────────────────────────────────── */

.focus-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #000;
  border: 2px solid #fff;
  box-shadow: 0 0 0 0 rgba(0, 0, 0, 0.4);
  animation: focus-pulse 2s ease-out infinite;
}

@keyframes focus-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(0, 0, 0, 0.4); }
  70%  { box-shadow: 0 0 0 12px rgba(0, 0, 0, 0); }
  100% { box-shadow: 0 0 0 12px rgba(0, 0, 0, 0); }
}

/* ── Road popup ──────────────────────────────────────────────────────────── */

.maplibregl-popup-content:has(.road-popup) {
  padding: 0;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
  overflow: clip;
  font-family: var(--font-family);
  font-weight: var(--weight-medium);
}

.road-popup {
  font-family: var(--font-family);
  width: 240px;
}

.road-popup__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 4px;
  gap: 12px;
}

.road-popup__title {
  font-size: var(--text-subheading);
  font-weight: var(--weight-medium);
  color: var(--color-primary);
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-subheading);
}

.road-popup__badge {
  font-size: var(--text-label);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-label);
  padding: 4px 6px;
  border-radius: 3px;
  white-space: nowrap;
  flex-shrink: 0;
  line-height: normal;
}

.road-popup__body {
  margin: 0;
  padding: 8px 16px;
  font-size: var(--text-subheading);
  font-weight: var(--weight-medium);
  color: var(--color-primary);
  opacity: 0.6;
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-subheading);
}

.road-popup__footer {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  font-size: var(--text-label);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-label);
  white-space: nowrap;
}

.road-popup__age {
  color: var(--color-primary);
  opacity: 0.6;
  text-transform: uppercase;
}

.road-popup__source {
  color: var(--color-primary);
  opacity: 0.6;
  text-transform: uppercase;
}

/* ── UI hide mode (H key) ────────────────────────────────────────────────── */

body.ui-hidden .region-panel,
body.ui-hidden .map-actions,
body.ui-hidden .layers-panel,
body.ui-hidden .snow-legend,
body.ui-hidden .maplibregl-ctrl-bottom-right {
  display: none !important;
}

/* ── Snow depth tooltip ──────────────────────────────────────────────────── */

.snow-tooltip {
  position: fixed;
  pointer-events: none;
  display: none;
  align-items: center;
  gap: 4px;
  background: #121212;
  border-radius: 6px;
  padding: 8px;
  z-index: 100;
  white-space: nowrap;
  overflow: clip;
}

.snow-tooltip__icon {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

.snow-tooltip__lockup {
  display: flex;
  gap: 2px;
  align-items: baseline;
  font-family: var(--font-family);
  font-size: var(--text-label);
  font-weight: var(--weight-semibold);
  letter-spacing: -0.18px;
  line-height: var(--leading-tight);
}

.snow-tooltip__depth {
  color: var(--color-inverse-primary);
}

.snow-tooltip__est {
  color: var(--color-inverse-secondary);
}

/* ── Avalanche tooltip ──────────────────────────────────────────────────── */

.avy-tooltip {
  position: fixed;
  pointer-events: none;
  display: none;
  align-items: start;
  gap: 10px;
  background: #121212;
  border-radius: 6px;
  padding: 8px 24px 8px 12px;
  z-index: 101;
  white-space: nowrap;
  overflow: clip;
}

.avy-tooltip__icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.avy-tooltip__icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avy-tooltip__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 95px;
  font-family: var(--font-family);
  font-size: var(--text-label);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-label);
  line-height: var(--leading-tight);
}

.avy-tooltip__label {
  color: var(--color-inverse-primary);
}

.avy-tooltip__zone {
  color: var(--color-inverse-secondary);
}

.avy-tooltip__bar {
  position: absolute;
  top: 0;
  right: 0;
  width: 6px;
  height: 100%;
}

/* ── SNOTEL detail view ──────────────────────────────────────────────────── */

.snotel-loading {
  padding: var(--space-xl) var(--space-lg);
  font-family: var(--font-family);
  font-size: var(--text-subheading);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-subheading);
  color: rgba(0, 0, 0, 0.35);
  line-height: var(--leading-snug);
}

/* Chart sits edge-to-edge, fixed height, border separates from data rows */
.snotel-chart-wrap {
  position: relative;
  height: 230px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

/* Info box at the bottom of the SNOTEL detail panel */
/* Melt-out info tooltip */
.snotel-tooltip {
  position: fixed;
  z-index: 9999;
  width: 251px;
  background: var(--color-base);
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 8px;
  padding: 20px 16px;
  font-family: var(--font-family);
  font-size: var(--text-subheading);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-subheading);
  color: var(--color-secondary);
  line-height: var(--leading-snug);
}

.snotel-info {
  padding: var(--space-sm);
}

.snotel-info__text {
  background: rgba(0, 0, 0, 0.05);
  border-radius: 8px;
  padding: var(--space-lg);
  font-family: var(--font-family);
  font-size: var(--text-subheading);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-subheading);
  color: rgba(0, 0, 0, 0.6);
  line-height: var(--leading-snug);
}

/* ── MapLibre overrides ──────────────────────────────────────────────────── */

.maplibregl-ctrl-bottom-right {
  right: 16px;
  bottom: 16px;
}

.maplibregl-ctrl-attrib {
  font-family: var(--font-family);
  font-size: var(--text-label);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-label);
  color: var(--color-secondary);
  text-transform: uppercase;
  padding: 12px;
  border-radius: 1000px;
  background: none;
}

.maplibregl-ctrl-attrib a {
  color: var(--color-secondary);
}

.maplibregl-ctrl-group {
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2) !important;
}

/* ── Welcome modal ──────────────────────────────────────────────────────── */

.welcome-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.welcome-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  animation: welcome-fade-in 0.3s ease-out;
}

.welcome-modal__card {
  position: relative;
  background: var(--color-base);
  border-radius: 16px;
  animation: welcome-card-in 0.35s ease-out;
  width: 560px;
  max-width: calc(100vw - 32px);
  padding: 40px 48px 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.welcome-modal__close {
  position: absolute;
  top: 16px;
  right: 20px;
  background: none;
  border: none;
  font-size: 22px;
  line-height: 1;
  color: var(--color-primary);
  cursor: pointer;
  padding: 4px;
}

.welcome-modal__brand {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 36px;
}

.welcome-modal__title {
  font-family: var(--font-family);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--color-primary);
}

.welcome-modal__chip {
  font-family: var(--font-family);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: -0.1px;
  color: var(--color-primary);
  background: var(--color-avy-moderate);
  padding: 6px 7px;
  border-radius: 4px;
  line-height: 1;
}

.welcome-modal__body {
  font-family: var(--font-family);
  font-size: 15px;
  line-height: 1.55;
  color: var(--color-secondary);
  margin-bottom: 16px;
  text-align: left;
}

.welcome-modal__contact {
  font-family: var(--font-family);
  font-size: var(--text-label);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-label);
  color: var(--color-primary);
  text-align: left;
  width: 100%;
  margin-bottom: 28px;
}

.welcome-modal__contact a {
  color: inherit;
  text-decoration: none;
}

.welcome-modal__contact a:hover {
  text-decoration: underline;
}

.welcome-modal__cta {
  font-family: var(--font-family);
  font-size: var(--text-cta);
  font-weight: var(--weight-semibold);
  color: var(--color-inverse-primary);
  background: var(--color-primary);
  border: none;
  border-radius: 999px;
  width: 126px;
  padding: 14px 0;
  cursor: pointer;
  transition: opacity 0.15s;
}

.welcome-modal__cta:hover {
  opacity: 0.85;
}

@keyframes welcome-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes welcome-card-in {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
