.dashboard {
  width: 100%;
  height: calc(100vh - 64px);
  position: relative;
  overflow: hidden;
}

.dashboard__map {
  width: 100%;
  height: 100%;
}

.mapboxgl-canvas { outline: none; }
.mapboxgl-ctrl-bottom-right { bottom: 2rem; right: 1.5rem; }
.mapboxgl-ctrl-bottom-left  { bottom: 2rem; left: 1.5rem; }

.mapboxgl-ctrl-group {
  background: rgba(255, 255, 252, 0.88) !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  border: 1px solid rgba(35, 35, 35, 0.09) !important;
  border-radius: 12px !important;
  box-shadow: 0 4px 16px rgba(35, 35, 35, 0.10) !important;
}

.mapboxgl-ctrl-group button {
  color: rgba(35, 35, 35, 0.70) !important;
}

.mapboxgl-ctrl-group button:hover {
  background: rgba(7, 128, 128, 0.06) !important;
  color: #078080 !important;
}

.mapboxgl-popup-content {
  background: transparent !important;
  padding: 0 !important;
  border-radius: 18px !important;
  box-shadow: none !important;
}

.mapboxgl-popup-tip {
  border-top-color: rgba(255, 255, 252, 0.94) !important;
}

.mapboxgl-popup-close-button {
  color: var(--ink-muted) !important;
  font-size: 1.1rem !important;
  right: 0.5rem !important;
  top: 0.4rem !important;
  z-index: 1;
}

@keyframes panel-reveal {
  from { opacity: 0; transform: translateY(-10px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.floating-panel {
  position: absolute;
  top: 1.5rem;
  left: 1.5rem;
  z-index: 10;
  width: 340px;
  max-height: calc(100% - 3rem);
  display: flex;
  flex-direction: column;
  padding: 1.25rem 1.35rem 1.25rem;
  background: rgba(255, 255, 252, 0.96);
  backdrop-filter: blur(28px) saturate(1.5);
  -webkit-backdrop-filter: blur(28px) saturate(1.5);
  border: 1px solid rgba(35, 35, 35, 0.08);
  border-top-color: rgba(255, 255, 255, 0.80);
  border-radius: var(--radius-lg);
  box-shadow: 0 1px 3px rgba(35, 35, 35, 0.05), 0 6px 20px rgba(35, 35, 35, 0.09), 0 20px 40px rgba(35, 35, 35, 0.05), 0 0 0 0.5px rgba(7, 128, 128, 0.08);
  overflow-y: auto;
  overflow-x: hidden;
  animation: panel-reveal 0.42s var(--ease-expo, cubic-bezier(0.16, 1, 0.3, 1)) both;
}

.floating-panel::-webkit-scrollbar { width: 3px; }
.floating-panel::-webkit-scrollbar-track { background: transparent; }
.floating-panel::-webkit-scrollbar-thumb { background: rgba(35,35,35,0.10); border-radius: 2px; }

.floating-panel::before {
  content: '';
  position: absolute;
  top: 0; left: 2rem; right: 2rem;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.95) 30%, rgba(7,128,128,0.20) 70%, transparent);
  pointer-events: none;
}

.floating-panel::after {
  content: '';
  position: absolute;
  left: 0; top: 1.8rem; bottom: 1.8rem;
  width: 2.5px;
  background: linear-gradient(to bottom, var(--leaf, #078080), rgba(7,128,128,0.35), transparent);
  border-radius: 0 2px 2px 0;
  pointer-events: none;
}

.floating-panel > * { position: relative; z-index: 1; }

.floating-panel__brand {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.5rem;
}

.floating-panel__logo-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--leaf, #078080);
  box-shadow: 0 0 0 2.5px rgba(7,128,128,0.15);
  animation: dot-pulse 2.4s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes dot-pulse {
  0%, 100% { box-shadow: 0 0 0 2.5px rgba(7,128,128,0.15); }
  50%       { box-shadow: 0 0 0 5px rgba(7,128,128,0.04); }
}

.floating-panel__eyebrow {
  font-family: var(--font-mono, monospace);
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--leaf, #078080);
  margin: 0;
}

.floating-panel__title {
  font-family: var(--font-display, sans-serif);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--ink, #232323);
  margin-bottom: 0.9rem;
  letter-spacing: -0.04em;
  line-height: 1.15;
}

.floating-panel__title-accent {
  color: var(--leaf, #078080);
}

.search-m3 {
  margin-bottom: 1.1rem;
  position: relative;
}

.search-m3__bar {
  display: flex;
  align-items: center;
  height: 46px;
  background: var(--surface, #ffffff);
  border-radius: 11px;
  border: 1px solid rgba(35, 35, 35, 0.12);
  box-shadow: 0 1px 3px rgba(35, 35, 35, 0.05);
  padding: 0 4px 0 13px;
  gap: 4px;
  cursor: text;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.search-m3__bar:hover { border-color: rgba(7, 128, 128, 0.40); }

.search-m3__bar:focus-within {
  border-color: var(--leaf, #078080);
  box-shadow: 0 0 0 3px rgba(7,128,128,0.10), 0 1px 3px rgba(35,35,35,0.05);
}

.search-m3__lead-icon {
  color: var(--ink-muted, #8c8c8c);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
}

.search-m3__input {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--ink, #232323);
  font-family: var(--font-base, sans-serif);
  font-size: 0.88rem;
  font-weight: 400;
  outline: none;
  padding: 0;
  min-width: 0;
  -webkit-appearance: none;
}

.search-m3__input::placeholder { color: var(--ink-muted, #8c8c8c); font-weight: 300; }

.search-m3__input::-webkit-search-decoration,
.search-m3__input::-webkit-search-cancel-button,
.search-m3__input::-webkit-search-results-button { display: none; }

.search-m3__divider {
  width: 1px;
  height: 18px;
  background: rgba(35, 35, 35, 0.12);
  flex-shrink: 0;
  margin: 0 2px;
}

.search-m3__icon-btn {
  background: transparent;
  border: none;
  color: var(--ink-muted, #8c8c8c);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  flex-shrink: 0;
  transition: background 0.15s ease, color 0.15s ease;
}

.search-m3__icon-btn:hover { background: rgba(7, 128, 128, 0.08); color: var(--leaf, #078080); }
.search-m3__icon-btn--submit:disabled { color: var(--ink-muted, #8c8c8c); opacity: 0.4; cursor: not-allowed; }
.search-m3__icon-btn.hidden { display: none; }

.search-m3__results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--surface, #ffffff);
  border-radius: var(--radius-sm, 10px);
  border: 1px solid rgba(35, 35, 35, 0.09);
  box-shadow: 0 12px 40px rgba(35, 35, 35, 0.12);
  z-index: 100;
  overflow: hidden;
  list-style: none;
  margin: 0;
  padding: 4px 0;
}

.search-m3__results.hidden { display: none; }

.search-result-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 13px;
  min-height: 44px;
  font-family: var(--font-base, sans-serif);
  font-size: 0.85rem;
  color: var(--ink-soft, #5c5c5c);
  cursor: pointer;
  user-select: none;
  transition: background 0.10s ease;
}

.search-result-item::before {
  content: '';
  display: block;
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 24 24' fill='none' stroke='%23078080' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 10c0 6-8 12-8 12s-8-6-8-12a8 8 0 0 1 16 0Z'/%3E%3Ccircle cx='12' cy='10' r='3'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
}

.search-result-item:hover  { background: rgba(7,128,128,0.06); color: var(--ink, #232323); }
.search-result-item:active { background: rgba(7,128,128,0.12); }

.stats-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 1.25rem;
}

.stat-card {
  background: rgba(7, 128, 128, 0.04);
  border: 1px solid rgba(7, 128, 128, 0.08);
  border-radius: 12px;
  padding: 0.75rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.stat-card:hover {
  background: rgba(7, 128, 128, 0.07);
  border-color: rgba(7, 128, 128, 0.16);
  transform: translateY(-1px);
}

.stat-card__value {
  font-family: var(--font-display, sans-serif);
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--ink, #232323);
  line-height: 1;
  letter-spacing: -0.03em;
}

.stat-card__plus {
  font-size: 1rem;
  color: var(--leaf, #078080);
  font-weight: 700;
  margin-left: 1px;
}

.stat-card__prct {
  font-size: 1rem;
  color: var(--leaf, #078080);
  font-weight: 700;
  margin-left: 1px;
}

.stat-card__sufix {
  font-size: 0.95rem;
  color: var(--leaf, #078080);
  font-weight: 700;
  margin-left: 1px;
}

.stat-card__label {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--ink-soft, #5c5c5c);
  line-height: 1.35;
}

.steps-section {
  margin-bottom: 0.5rem;
}

.steps-section__header {
  margin-bottom: 0.9rem;
}

.steps-section__overline {
  font-family: var(--font-mono, monospace);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--ink-muted, #8c8c8c);
  display: block;
  margin-bottom: 0.15rem;
}

.steps-section__title {
  font-family: var(--font-display, sans-serif);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink, #232323);
  margin: 0;
  letter-spacing: -0.02em;
}

.step-card {
  display: flex;
  gap: 0.8rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(35, 35, 35, 0.05);
  transition: background 0.15s ease;
  border-radius: 8px;
  margin: 0 -0.3rem;
  padding: 0.75rem 0.3rem;
}

.step-card:last-child {
  border-bottom: none;
}

.step-card:hover {
  background: rgba(7, 128, 128, 0.03);
}

.step-card__icon-wrap {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(7, 128, 128, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--leaf, #078080);
  transition: background 0.2s ease, color 0.2s ease;
}

.step-card:hover .step-card__icon-wrap {
  background: rgba(7, 128, 128, 0.14);
  color: #055c5c;
}

.step-card__body {
  flex: 1;
  min-width: 0;
}

.step-card__num {
  font-family: var(--font-mono, monospace);
  font-size: 9.5px;
  font-weight: 700;
  color: var(--ink-muted, #8c8c8c);
  letter-spacing: 0.08em;
  margin-bottom: 0.1rem;
}

.step-card__title {
  font-size: 0.83rem;
  font-weight: 700;
  color: var(--ink, #232323);
  margin: 0 0 0.2rem;
  line-height: 1.3;
}

.step-card__desc {
  font-size: 0.72rem;
  color: var(--ink-soft, #5c5c5c);
  line-height: 1.5;
  margin: 0;
}

.my-buildings-section {
  margin-bottom: 0.5rem;
  border: 1px solid rgba(7, 128, 128, 0.10);
  border-radius: 11px;
  overflow: hidden;
  background: rgba(7, 128, 128, 0.03);
  transition: background 0.2s ease;
}

.my-buildings-section--empty {
  opacity: 0.65;
}

.my-buildings-section__header {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.7rem;
  cursor: pointer;
  user-select: none;
  color: var(--leaf, #078080);
  font-size: 0.78rem;
  font-weight: 600;
  transition: background 0.15s ease;
}

.my-buildings-section__header:hover {
  background: rgba(7, 128, 128, 0.05);
}

.my-buildings-section__header svg:first-child {
  flex-shrink: 0;
  opacity: 0.7;
}

.my-buildings-section__header span {
  flex: 1;
}

.my-buildings-section__chevron {
  transition: transform 0.25s ease;
  opacity: 0.5;
}

.my-buildings-section__header--open .my-buildings-section__chevron {
  transform: rotate(180deg);
}

.my-buildings-section__body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s var(--ease-expo, cubic-bezier(0.16, 1, 0.3, 1));
}

.my-buildings-section__body--open {
  max-height: 400px;
}

.my-buildings-section__body > div {
  padding: 0 0.7rem 0.7rem;
}

.my-buildings__empty {
  font-size: 0.72rem;
  color: var(--ink-muted, #8c8c8c);
  text-align: center;
  padding: 0.5rem 0;
}

.my-buildings__item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.65rem;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(35, 35, 35, 0.06);
  border-radius: 8px;
  margin-bottom: 0.3rem;
  transition: background 0.15s ease;
}

.my-buildings__item:last-child {
  margin-bottom: 0;
}

.my-buildings__item:hover {
  background: rgba(255, 255, 255, 0.95);
}

.my-buildings__item::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--coral, #f45d48);
  flex-shrink: 0;
  opacity: 0.8;
}

.my-buildings__item-name {
  flex: 1;
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--ink, #232323);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.my-buildings__item-btn {
  padding: 0.2rem 0.55rem;
  font-size: 0.7rem;
  font-weight: 600;
  font-family: var(--font-mono, monospace);
  background: transparent;
  border: 1px solid rgba(7, 128, 128, 0.15);
  border-radius: 6px;
  color: var(--leaf, #078080);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.my-buildings__item-btn:hover {
  background: var(--leaf, #078080);
  border-color: var(--leaf, #078080);
  color: #fff;
}

.map-controls {
  margin-top: 0.75rem;
  padding-top: 0.7rem;
  border-top: 1px solid rgba(35, 35, 35, 0.06);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.map-controls__label {
  font-family: var(--font-mono, monospace);
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--ink-muted, #8c8c8c);
}

.map-controls__btns { display: flex; gap: 0.28rem; }

.map-controls__btn {
  padding: 0.28rem 0.85rem;
  min-height: 30px;
  border: 1px solid rgba(35, 35, 35, 0.12);
  border-radius: 8px;
  background: transparent;
  font-family: var(--font-mono, monospace);
  font-size: 10.5px;
  font-weight: 600;
  color: var(--ink-muted, #8c8c8c);
  cursor: pointer;
  transition: all 0.15s ease;
}

.map-controls__btn:hover { background: rgba(7, 128, 128, 0.08); border-color: rgba(7, 128, 128, 0.30); color: var(--leaf, #078080); }

.map-controls__btn:focus-visible { outline: 2px solid var(--leaf, #078080); outline-offset: 2px; }

.map-controls__btn--active {
  background: var(--leaf, #078080);
  border-color: var(--leaf, #078080);
  color: #fff;
  box-shadow: 0 2px 8px rgba(7, 128, 128, 0.25);
}

.building-popup {
  min-width: 250px;
  font-family: var(--font-base, sans-serif);
  color: var(--ink, #232323);
  background: rgba(255, 255, 252, 0.95);
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  border: 1px solid rgba(35, 35, 35, 0.08);
  border-top-color: rgba(255, 255, 255, 0.90);
  border-radius: 18px;
  padding: 1.1rem 1.15rem 1rem;
  box-shadow: 0 4px 16px rgba(35, 35, 35, 0.10), 0 16px 48px rgba(35, 35, 35, 0.08);
  position: relative;
  overflow: hidden;
}

.building-popup::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(to bottom, var(--leaf, #078080), rgba(7,128,128,0.35), transparent);
  border-radius: 0 2px 2px 0;
}

.building-popup__loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  padding: 1.2rem 0 0.8rem;
}

.building-popup__spinner {
  width: 22px;
  height: 22px;
  border: 2px solid rgba(7, 128, 128, 0.15);
  border-top-color: var(--leaf, #078080);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.building-popup__loading-label {
  font-family: var(--font-mono, monospace);
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--leaf, #078080);
}

.building-popup__loading-sub {
  font-size: 0.76rem;
  color: var(--ink-muted, #8c8c8c);
  text-align: center;
}

.building-popup__header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.55rem;
  border-bottom: 1px solid rgba(35, 35, 35, 0.06);
  padding-bottom: 0.45rem;
}

.building-popup__name  { font-weight: 700; font-size: 0.9rem; color: var(--ink, #232323); }
.building-popup__area  { font-family: var(--font-mono, monospace); font-size: 0.72rem; color: var(--ink-muted, #8c8c8c); }

.building-popup__metrics  { display: flex; flex-direction: column; gap: 0.3rem; margin: 0.5rem 0; }
.building-popup__metric   { display: flex; justify-content: space-between; font-size: 0.8rem; }
.building-popup__metric-label { color: var(--ink-soft, #5c5c5c); }
.building-popup__metric-value { font-weight: 700; color: var(--ink, #232323); font-family: var(--font-mono, monospace); }

.building-popup__badge {
  display: inline-block;
  font-size: 0.70rem;
  font-weight: 600;
  border-radius: 99px;
  padding: 0.16rem 0.6rem;
  margin-bottom: 0.45rem;
}

.building-popup__badge--free    { background: rgba(7,128,128,0.10); color: var(--leaf, #078080); }
.building-popup__badge--claimed { background: rgba(244,93,72,0.10); color: var(--coral, #f45d48); }

.building-popup__footer {
  border-top: 1px solid rgba(35, 35, 35, 0.06);
  padding-top: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.building-popup__cta {
  display: block;
  text-align: center;
  background: var(--leaf, #078080);
  color: #fff;
  border-radius: 9px;
  padding: 0.48rem 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.15s ease;
  box-shadow: 0 2px 8px rgba(7,128,128,0.22);
  font-family: var(--font-base, sans-serif);
  width: 100%;
}

.building-popup__cta:hover { background: var(--leaf-deep, #055c5c); transform: translateY(-1px); }

.building-popup__cta--claim {
  background: transparent;
  border: 1px solid rgba(35, 35, 35, 0.10);
  color: var(--ink-soft, #5c5c5c);
  font-size: 0.76rem;
  box-shadow: none;
}

.building-popup__cta--claim:hover { background: rgba(7,128,128,0.06); border-color: rgba(7,128,128,0.25); color: var(--leaf, #078080); transform: none; }

.building-popup__error { font-size: 0.8rem; color: var(--ink-muted, #8c8c8c); padding: 0.5rem 0; }

@media (max-width: 1024px) {
  .floating-panel { width: 310px; }
  .stat-card__value { font-size: 1.4rem; }
}

@media (max-width: 768px) {
  .dashboard {
    height: auto;
    min-height: calc(100vh - 60px);
    display: flex;
    flex-direction: column;
    overflow: visible;
  }

  .dashboard__map {
    height: 55vw;
    min-height: 260px;
    max-height: 360px;
    flex-shrink: 0;
  }

  .floating-panel {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    width: 100%;
    max-height: none;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    border-top: 1px solid var(--line-strong);
    border-left: none;
    border-right: none;
    border-bottom: none;
    padding: 1.25rem 1.25rem 1.5rem;
    box-shadow: 0 -4px 20px rgba(35, 35, 35, 0.08);
  }

  .floating-panel::after {
    left: 1.8rem;
    right: 1.8rem;
    top: 0;
    bottom: auto;
    height: 2.5px;
    width: auto;
    background: linear-gradient(to right, var(--leaf, #078080), rgba(7,128,128,0.35), transparent);
    border-radius: 0 0 2px 2px;
  }

  .floating-panel__title { font-size: 1.1rem; }

  .search-m3__bar { height: 42px; }
  .search-m3__input { font-size: 0.9rem; }

  .stats-row { gap: 6px; }

  .stat-card { padding: 0.6rem 0.75rem; }
  .stat-card__value { font-size: 1.35rem; }
  .stat-card__label { font-size: 0.65rem; }

  .map-controls__btn { min-height: 40px; padding: 0.4rem 1rem; }

  .mapboxgl-ctrl-bottom-right { bottom: 1rem; right: 0.75rem; }
  .mapboxgl-ctrl-bottom-left  { bottom: 1rem; left: 0.75rem; }
}

@media (max-width: 480px) {
  .dashboard__map { height: 50vw; min-height: 220px; max-height: 300px; }
  .floating-panel { padding: 1rem 1rem 1.25rem; }
  .floating-panel__title { font-size: 1rem; }
  .search-m3__bar { height: 40px; }
  .stat-card__value { font-size: 1.2rem; }
  .building-popup { min-width: 220px; max-width: calc(100vw - 2rem); padding: 0.9rem 1rem 0.85rem; }
}
