:root {
  --locations-nav-dock-width: clamp(440px, 34vw, 520px);
  color: #1f2430;
  background:
    radial-gradient(circle at 8% 8%, rgba(255, 220, 161, 0.9), transparent 25%),
    radial-gradient(circle at 92% 2%, rgba(169, 222, 255, 0.8), transparent 24%),
    linear-gradient(180deg, #fff8ed 0%, #f5f7fb 42%, #eef3f8 100%);
  font-family:
    "Avenir Next",
    "Hiragino Sans",
    "Yu Gothic",
    sans-serif;
  font-synthesis: none;
  font-weight: 400;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
  -moz-osx-font-smoothing: grayscale;
  -webkit-font-smoothing: antialiased;
}

* {
  box-sizing: border-box;
}

html,
body,
#root {
  min-height: 100%;
  margin: 0;
}

body {
  min-width: 320px;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

.app-shell {
  width: min(1440px, calc(100vw - 12px));
  margin: 0 auto;
  padding: 6px 0 14px;
}

.app-shell-with-nav-dock {
  width: min(1440px, max(320px, calc(100vw - var(--locations-nav-dock-width) - 24px)));
  margin: 0 auto 0 6px;
}

.hero-panel,
.toolbar-panel,
.grid-panel,
.detail-panel,
.locations-panel,
.notice-banner {
  border: 1px solid rgba(255, 255, 255, 0.92);
  border-radius: 28px;
  box-shadow: 0 20px 48px rgba(45, 61, 80, 0.08);
  backdrop-filter: blur(14px);
}

.hero-panel,
.toolbar-panel,
.grid-panel,
.detail-panel,
.locations-panel {
  background: rgba(255, 255, 255, 0.74);
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(540px, 1fr);
  gap: 12px;
  padding: 12px 16px;
  align-items: center;
}

.hero-copy {
  display: flex;
  align-items: center;
  min-height: 100%;
}

.eyebrow,
.section-kicker,
.detail-kicker {
  margin: 0 0 8px;
  color: #7c5d12;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hero-copy h1,
.section-header h2,
.detail-top h2,
.supplement-card h3,
.modal-header h2 {
  margin: 0;
}

.hero-copy h1 {
  font-size: clamp(28px, 4vw, 42px);
  letter-spacing: -0.04em;
  line-height: 0.94;
}

.hero-description,
.section-description,
.card-note,
.history-item p,
.detail-en-name,
.hero-meta {
  color: #536071;
}

.hero-description {
  max-width: 52ch;
  margin: 8px 0 0;
  font-size: 13px;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
  font-size: 11px;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.stat-card {
  padding: 9px 12px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(245, 248, 253, 0.95));
  border: 1px solid rgba(214, 223, 236, 0.85);
}

.stat-card strong {
  display: block;
  font-size: 18px;
  line-height: 1.1;
}

.stat-card-neutral {
  grid-column: span 1;
}

.stat-label {
  display: block;
  margin-bottom: 4px;
  color: #67758a;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stat-subtext {
  display: block;
  margin-top: 2px;
  color: #68748a;
  font-size: 11px;
}

.version-fr strong,
.version-fr .control-version {
  color: #b13d38;
}

.version-lg strong,
.version-lg .control-version {
  color: #2f7b45;
}

.version-toggle-group {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  align-items: center;
}

.version-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  white-space: nowrap;
}

.version-toggle input {
  width: 14px;
  height: 14px;
}

.notice-banner {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: min(420px, calc(100vw - 24px));
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.96);
  border-radius: 18px;
  box-shadow: 0 20px 48px rgba(45, 61, 80, 0.18);
  backdrop-filter: blur(14px);
}

.notice-success {
  background: rgba(231, 247, 235, 0.9);
  color: #1d5c34;
}

.notice-warning {
  background: rgba(255, 244, 222, 0.92);
  color: #8a5816;
}

.inline-button,
.link-button {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  text-decoration: underline;
}

.toolbar-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 8px;
  padding: 8px 12px;
}

.view-tabs,
.toolbar-actions,
.button-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tab-button,
.icon-button,
.button-stack button,
.button-row button,
.history-item button {
  border: 0;
  border-radius: 999px;
  padding: 7px 12px;
  background: rgba(230, 236, 245, 0.75);
  color: #445062;
  transition:
    transform 140ms ease,
    background 140ms ease,
    color 140ms ease,
    box-shadow 140ms ease;
}

.tab-button:hover,
.icon-button:hover,
.button-stack button:hover:not(:disabled),
.button-row button:hover,
.history-item button:hover {
  transform: translateY(-1px);
  background: rgba(215, 226, 242, 0.94);
}

.danger-button {
  background: linear-gradient(135deg, #d65245, #ef8b62);
  color: #fff;
  box-shadow: 0 12px 24px rgba(214, 82, 69, 0.24);
}

.danger-button:hover {
  background: linear-gradient(135deg, #bf463a, #e47b53);
}

.tab-button-active {
  background: linear-gradient(135deg, #f25f5c, #ff9472);
  box-shadow: 0 12px 24px rgba(242, 95, 92, 0.24);
  color: #fff;
}

.phase-pill {
  padding: 5px 10px;
  border-radius: 999px;
  background: #edf3ff;
  color: #355fb2;
  font-size: 12px;
  font-weight: 800;
}

.pokemon-browser {
  margin-top: 8px;
}

.grid-panel,
.locations-panel {
  padding: 10px 12px;
}

.compact-grid-panel {
  position: relative;
  padding-top: 8px;
  padding-bottom: 8px;
}

.compact-grid-panel .section-header {
  align-items: center;
  margin-bottom: 6px;
}

.section-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.section-description {
  max-width: none;
  margin: 0;
  font-size: 11px;
}

.compact-description {
  white-space: nowrap;
}

.pokemon-grid {
  display: grid;
  grid-template-columns: repeat(15, minmax(0, 1fr));
  gap: 4px;
}

.pokemon-grid-shell {
  position: relative;
}

.pokemon-tile {
  display: grid;
  gap: 2px;
  align-content: start;
  min-height: 38px;
  padding: 4px 5px;
  border: 1px solid rgba(214, 223, 236, 0.92);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(246, 249, 252, 0.98)),
    linear-gradient(135deg, rgba(242, 95, 92, 0.08), rgba(84, 181, 111, 0.08));
  box-shadow: 0 8px 22px rgba(23, 40, 61, 0.05);
  text-align: left;
}

.pokemon-tile:hover,
.pokemon-tile-selected {
  transform: translateY(-1px);
  border-color: rgba(242, 95, 92, 0.42);
  box-shadow: 0 14px 26px rgba(23, 40, 61, 0.08);
}

.tile-dex {
  color: #68758a;
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
}

.tile-name {
  overflow: hidden;
  font-size: 10px;
  line-height: 1.05;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tile-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: auto;
}

.tile-count {
  padding: 1px 4px;
  border-radius: 999px;
  background: rgba(237, 241, 246, 0.9);
  color: #3f4b5c;
  font-size: 8px;
  font-weight: 700;
  line-height: 1.2;
}

.tile-seen-fr {
  background: rgba(242, 95, 92, 0.18);
  color: #a02e2b;
}

.tile-seen-lg {
  background: rgba(84, 181, 111, 0.18);
  color: #26663b;
}

.detail-overlay {
  z-index: 20;
  overflow: auto;
  padding: 8px;
  border: 1px solid rgba(207, 216, 230, 0.95);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 42px rgba(18, 24, 36, 0.18);
  backdrop-filter: blur(18px);
}

.detail-overlay-hover {
  position: absolute;
  width: min(540px, calc(100vw - 16px));
  max-height: 150px;
}

.detail-overlay-centered {
  position: fixed;
  top: 50%;
  left: 50%;
  width: min(980px, calc(100vw - 40px));
  max-height: calc(100vh - 64px);
  transform: translate(-50%, -50%);
}

.detail-overlay-pinned {
  border: 2px solid rgba(211, 85, 63, 0.78);
  box-shadow:
    0 0 0 2px rgba(255, 211, 193, 0.95),
    0 18px 42px rgba(18, 24, 36, 0.18);
}

.detail-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.detail-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  gap: 4px;
}

.detail-badge,
.seen-indicator,
.empty-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 8px;
  background: rgba(235, 240, 247, 0.8);
  color: #58667a;
  font-size: 10px;
  font-weight: 700;
}

.detail-top h2 {
  font-size: 18px;
  line-height: 1;
}

.seen-active {
  background: rgba(255, 226, 197, 0.92);
  color: #a45d1b;
}

.detail-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 6px;
}

.control-column {
  padding: 8px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(246, 249, 253, 0.98));
  border: 1px solid rgba(214, 223, 236, 0.86);
}

.control-column-compact {
  padding: 6px;
}

.control-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.control-version {
  margin: 0;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.control-count {
  display: block;
  font-size: 16px;
  line-height: 1;
}

.button-stack {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
  margin-top: 6px;
}

.button-stack button {
  min-width: 0;
  padding: 4px 1px;
  font-size: 10px;
  line-height: 1.05;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.button-stack button:disabled {
  opacity: 0.48;
}

.control-column-compact .control-count {
  font-size: 14px;
}

.control-column-compact .seen-indicator {
  padding: 2px 6px;
  font-size: 9px;
}

.control-column-compact .button-stack {
  margin-top: 4px;
}

.control-column-compact .button-stack button {
  padding: 4px 0;
  font-size: 9px;
}

.detail-block {
  margin-top: 6px;
}

.capture-rate-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 180;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(18, 24, 36, 0.28);
}

.capture-rate-modal {
  width: min(1020px, calc(100vw - 20px));
  max-height: calc(100vh - 20px);
  overflow: auto;
  padding: 12px;
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(244, 247, 251, 0.98));
  box-shadow: 0 26px 80px rgba(11, 18, 31, 0.24);
}

.capture-rate-header {
  align-items: start;
}

.capture-rate-header h2 {
  margin: 0;
  font-size: 18px;
}

.capture-rate-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.capture-rate-card {
  min-width: 0;
}

.capture-rate-card h3 {
  margin: 0 0 6px;
  font-size: 12px;
}

.capture-rate-table-wrapper {
  border-radius: 18px;
  border: 1px solid rgba(214, 223, 236, 0.9);
  background: rgba(255, 255, 255, 0.76);
  overflow: hidden;
}

.capture-rate-table th,
.capture-rate-table td {
  white-space: nowrap;
  font-size: 9px;
  padding: 4px 6px;
}

.capture-rate-table tbody th {
  background: rgba(246, 248, 251, 0.96);
  font-weight: 800;
}

.capture-rate-table td strong {
  font-size: 10px;
}

.capture-rate-grid-spacer {
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(237, 242, 249, 0.55), rgba(248, 250, 253, 0.35));
  border: 1px dashed rgba(214, 223, 236, 0.9);
}

.detail-block h4,
.supplement-card h3,
.modal-card h3,
.history-card h3 {
  margin: 0 0 4px;
  font-size: 13px;
}

.detail-list {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.detail-list li {
  display: grid;
  gap: 1px;
  padding: 4px 6px;
  border-radius: 8px;
  background: rgba(241, 245, 250, 0.9);
  font-size: 10px;
}

.detail-list-empty {
  color: #7c8797;
}

.detail-emphasis {
  font-weight: 800;
}

.locations-panel {
  margin-top: 8px;
}

.locations-layout {
  display: block;
}

.locations-main {
  min-width: 0;
}

.location-table-wrapper {
  border-radius: 18px;
  border: 1px solid rgba(214, 223, 236, 0.9);
  background: rgba(255, 255, 255, 0.7);
  overflow-x: auto;
  overflow-y: visible;
}

.location-table,
.mini-table {
  width: 100%;
  border-collapse: collapse;
}

.location-table th,
.location-table td,
.mini-table th,
.mini-table td {
  padding: 7px 9px;
  border-bottom: 1px solid rgba(223, 229, 238, 0.88);
  vertical-align: top;
  text-align: left;
  font-size: 11px;
}

.location-table th,
.mini-table th {
  position: sticky;
  top: 0;
  background: rgba(246, 248, 251, 0.96);
  z-index: 1;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.location-name {
  min-width: 132px;
  font-weight: 800;
  font-size: 12px;
}

.pill-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.encounter-method-group {
  display: grid;
  gap: 4px;
}

.encounter-method-group + .encounter-method-group {
  margin-top: 7px;
  padding-top: 7px;
  border-top: 1px solid rgba(214, 223, 236, 0.86);
}

.encounter-method-heading {
  margin: 0;
  color: #68748a;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.encounter-pill {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0;
  min-width: 0;
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(240, 244, 249, 0.86);
  font-size: 10px;
  line-height: 1.2;
  white-space: nowrap;
}

.encounter-pill strong {
  font-weight: 800;
}

.encounter-seen.version-fr {
  background: rgba(242, 95, 92, 0.15);
}

.encounter-seen.version-lg {
  background: rgba(84, 181, 111, 0.15);
}

.supplement-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  margin-top: 10px;
}

.locations-nav-panel,
.supplement-card,
.modal-card,
.history-card {
  padding: 12px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(214, 223, 236, 0.86);
}

.locations-nav-panel {
  width: var(--locations-nav-dock-width);
  max-height: calc(100vh - 12px);
  overflow: auto;
  padding: 12px;
}

.locations-nav-dock {
  position: fixed;
  inset: 0 0 0 auto;
  display: flex;
  justify-content: flex-end;
  width: calc(var(--locations-nav-dock-width) + 12px);
  padding: 0 12px 12px 0;
  pointer-events: none;
  z-index: 40;
}

.locations-nav-dock .locations-nav-panel {
  pointer-events: auto;
}

.locations-nav-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-content: flex-start;
}

.locations-nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.locations-nav-switch {
  border: 0;
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(230, 236, 245, 0.88);
  color: #445062;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  transition:
    transform 140ms ease,
    background 140ms ease,
    color 140ms ease;
}

.locations-nav-switch:hover {
  transform: translateY(-1px);
  background: rgba(215, 226, 242, 0.96);
}

.locations-nav-item {
  display: inline-flex;
  align-items: center;
  flex: 0 1 auto;
  max-width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 0;
  border-radius: 12px;
  background: rgba(239, 243, 249, 0.95);
  text-align: left;
}

.locations-nav-item:hover {
  background: rgba(224, 232, 244, 0.98);
}

.locations-nav-item-section {
  background: rgba(255, 242, 225, 0.96);
}

.locations-nav-label {
  display: block;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.25;
  white-space: nowrap;
  overflow-wrap: anywhere;
}

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

.mini-heading {
  margin: 0;
  color: #68748a;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.row-seen {
  background: rgba(240, 248, 241, 0.72);
}

.table-empty {
  color: #768294;
}

[id^="location-"] {
  scroll-margin-top: 12px;
}

@media (max-width: 860px) {
  .versioned-supplement {
    grid-template-columns: minmax(0, 1fr);
  }
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(18, 24, 36, 0.34);
}

.settings-modal {
  width: min(1080px, calc(100vw - 32px));
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding: 14px;
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 247, 251, 0.97));
  box-shadow: 0 26px 80px rgba(11, 18, 31, 0.22);
}

.modal-header,
.history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

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

.modal-card-danger {
  background: linear-gradient(180deg, rgba(255, 245, 241, 0.92), rgba(255, 255, 255, 0.82));
  border-color: rgba(235, 196, 184, 0.9);
}

.history-card {
  margin-top: 10px;
}

.history-list {
  display: grid;
  gap: 10px;
  margin-top: 8px;
  max-height: 42vh;
  overflow: auto;
}

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(241, 245, 250, 0.94);
}

.history-item strong {
  display: block;
}

.history-item p {
  margin: 4px 0 0;
  font-size: 13px;
}

.hidden-input {
  display: none;
}

@media (max-width: 1260px) {
  .pokemon-grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
  }
}

@media (max-width: 960px) {
  .hero-panel,
  .modal-grid,
  .supplement-grid,
  .versioned-supplement,
  .detail-columns,
  .section-header,
  .capture-rate-header {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: start;
  }

  .capture-rate-grid {
    grid-template-columns: 1fr;
  }

  .capture-rate-grid-spacer {
    display: none;
  }

  .hero-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pokemon-grid {
    grid-template-columns: repeat(8, minmax(0, 1fr));
    max-height: none;
  }
}

@media (max-width: 700px) {
  .app-shell {
    width: min(100vw - 12px, 1440px);
    padding-top: 8px;
  }

  .hero-panel,
  .toolbar-panel,
  .grid-panel,
  .locations-panel,
  .settings-modal,
  .capture-rate-modal {
    border-radius: 22px;
  }

  .toolbar-panel,
  .view-tabs,
  .toolbar-actions,
  .button-row,
  .hero-meta {
    flex-direction: column;
    align-items: stretch;
  }

  .pokemon-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .detail-overlay {
    width: auto;
  }

  .detail-overlay-hover {
    left: 6px !important;
    right: 6px;
    top: auto !important;
    bottom: 6px;
    max-height: 180px;
  }

  .detail-overlay-centered {
    top: 72px;
    left: 6px;
    right: 6px;
    width: auto;
    max-height: calc(100vh - 84px);
    transform: none;
  }

  .location-table th,
  .location-table td,
  .mini-table th,
  .mini-table td {
    padding: 10px;
  }
}
