.browse-page {
  position: relative;
  z-index: 1;
  max-width: 1180px;
  width: 100%;
  margin: 0 auto;
  padding: 40px 24px 90px;
}

.page-loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  display: grid;
  place-items: center;
  z-index: 120;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  cursor: progress;
}

.page-loading-card {
  width: min(420px, 90vw);
  padding: 26px 28px;
  border-radius: 22px;
  background: #ffffff;
  box-shadow: var(--shadow);
  text-align: center;
}

.page-loading-title {
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 8px;
}

.page-loading-card p {
  margin: 0;
  color: var(--muted);
  font-weight: 500;
}

.browse-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr);
  gap: 32px;
  align-items: center;
  margin-bottom: 32px;
}

.browse-hero.single {
  grid-template-columns: minmax(0, 1fr);
}

.browse-hero h1 {
  font-family: 'Sora', sans-serif;
  font-size: clamp(2.2rem, 4vw, 3.2rem);
  margin-bottom: 12px;
}

.browse-card {
  background: var(--card);
  border-radius: 22px;
  padding: 24px;
  box-shadow: var(--shadow);
  width: 100%;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.section-heading h3 {
  margin: 0;
}

.selection-tag {
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #fff7ed;
  color: #9a3412;
  border-radius: 999px;
  padding: 6px 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.78rem;
  cursor: pointer;
}

.selection-tag .tag-close {
  font-size: 0.95rem;
  line-height: 1;
}

.notice-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  display: grid;
  place-items: center;
  z-index: 130;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.notice-card {
  width: min(420px, 90vw);
  background: #fff;
  border-radius: 22px;
  padding: 26px 28px 22px;
  box-shadow: var(--shadow);
  position: relative;
  text-align: center;
}

.notice-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: none;
  background: rgba(15, 23, 42, 0.06);
  cursor: pointer;
  font-size: 1.1rem;
}

.notice-title {
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 8px;
}

.notice-message {
  margin: 0;
  color: var(--muted);
  font-weight: 500;
}

.notice-actions {
  margin-top: 18px;
  display: flex;
  justify-content: center;
}

.map-tabs {
  display: inline-flex;
  gap: 8px;
  background: #f1f5f9;
  padding: 6px;
  border-radius: 999px;
  margin-bottom: 16px;
}

.map-tab {
  border: none;
  background: transparent;
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
}

.map-tab.active {
  background: var(--accent);
  color: #fff;
}

.map-tab:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.map-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: 20px;
  width: 100%;
}

.map-board {
  position: relative;
  border-radius: 26px;
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  box-shadow: var(--shadow);
  overflow: hidden;
  min-height: 420px;
  width: 100%;
}

.map-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.map-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 12px 16px;
  pointer-events: none;
}

.map-hint {
  background: rgba(15, 23, 42, 0.75);
  color: #fff;
  font-size: 0.72rem;
  padding: 6px 12px;
  border-radius: 999px;
  z-index: 3;
}

.map-tooltip {
  background: #fff;
  border-radius: 999px;
  padding: 6px 12px;
  font-weight: 600;
  box-shadow: var(--shadow);
  z-index: 3;
}

.map-callouts {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  stroke: rgba(59, 130, 246, 0.5);
  stroke-width: 1.5;
  fill: none;
  z-index: 1;
}

.map-callouts circle {
  fill: rgba(59, 130, 246, 0.7);
  stroke: none;
}

.map-callout {
  position: absolute;
  transform: translate(0, -50%);
  border: 1px solid rgba(15, 23, 42, 0.2);
  border-radius: 999px;
  padding: 4px 10px;
  background: #fff;
  font-weight: 700;
  font-size: 0.7rem;
  min-width: 36px;
  text-align: center;
  pointer-events: auto;
  cursor: pointer;
  box-shadow: 0 8px 16px rgba(15, 23, 42, 0.12);
  z-index: 2;
}

.map-callout.active {
  background: var(--accent);
  color: #fff;
  border-color: transparent;
}

.map-callout.unavailable {
  background: #fee2e2;
  color: #b91c1c;
  border-color: rgba(185, 28, 28, 0.4);
  cursor: not-allowed;
}

.map-loader {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.8);
}

.map-loader.error {
  color: #b91c1c;
}

.map-side {
  display: grid;
  align-content: start;
  gap: 12px;
}

.map-side h3 {
  margin: 0 0 4px;
  font-size: 0.95rem;
}

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

.small-state-grid button {
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 999px;
  padding: 6px 10px;
  background: #fff;
  cursor: pointer;
  font-weight: 600;
}

.small-state-grid button.active {
  background: var(--accent);
  color: #fff;
}

.small-state-grid button.unavailable {
  background: #fee2e2;
  color: #b91c1c;
  border-color: rgba(185, 28, 28, 0.4);
  cursor: not-allowed;
}

.state-list {
  display: grid;
  gap: 12px;
}

.list-hint {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
  background: #f8fafc;
  border-radius: 12px;
  padding: 8px 12px;
}

.type-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.type-search {
  flex: 1;
  min-width: 220px;
}

.type-search input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  font-size: 0.9rem;
  font-family: inherit;
}

.type-search input:focus {
  outline: none;
  border-color: rgba(245, 158, 11, 0.6);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
}

.type-count {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 600;
}

.state-grid,
.type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.state-button,
.type-button {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-start;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 16px;
  padding: 12px 14px;
  background: #fff;
  text-align: left;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.type-icon {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: #f8fafc;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  overflow: hidden;
}

.type-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.type-emoji {
  font-size: 1.1rem;
}

.type-fa {
  font-size: 1rem;
  color: var(--ink);
}

.type-label {
  display: inline-block;
}

.state-button:hover,
.type-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.1);
}

.state-button.active,
.type-button.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2);
}

.state-button.unavailable {
  border-color: rgba(185, 28, 28, 0.3);
  background: #fff1f2;
  color: #b91c1c;
  cursor: not-allowed;
}

.selection-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 16px 0;
}

.selection-pill {
  padding: 8px 14px;
  border-radius: 999px;
  background: #fff7ed;
  font-weight: 600;
  color: var(--accent-dark);
}

.exam-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.exam-card {
  background: #fff;
  border-radius: 18px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.exam-card h4 {
  margin: 0 0 8px;
}

.exam-meta {
  font-size: 0.85rem;
  color: var(--muted);
  display: grid;
  gap: 4px;
}

.exam-card .btn {
  margin-top: 12px;
}

.empty-state {
  margin-top: 16px;
  color: var(--muted);
}

@media (max-width: 980px) {
  .browse-hero {
    grid-template-columns: 1fr;
  }

  .map-shell {
    grid-template-columns: 1fr;
  }

  .small-state-grid {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  }
}

@media (max-width: 720px) {
  .browse-page {
    padding: 30px 18px 70px;
  }
}
