/* Region Tabs */
.tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.tab {
  min-height: 46px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #f9fafb;
  cursor: pointer;
  font-weight: 850;
  color: #374151;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.tab:hover {
  background: #f3f4f6;
}

.tab.active {
  background: #111827;
  color: #ffffff;
  border-color: #111827;
}

/* Palette Swatch Grid */
.palette-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.swatch {
  position: relative;
  min-height: 76px;
  padding: 10px;
  border: 0;
  border-radius: 18px;
  cursor: pointer;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  box-shadow: inset 0 0 0 1px rgba(17, 24, 39, 0.14);
  color: #ffffff;
  font-weight: 900;
  text-align: left;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.swatch:hover {
  transform: translateY(-2px);
  box-shadow: inset 0 0 0 1px rgba(17, 24, 39, 0.20), 0 6px 14px rgba(15, 23, 42, 0.10);
}

.swatch:active {
  transform: scale(0.97);
}

.swatch .swatch-code {
  display: block;
  font-size: 20px;
  line-height: 1;
  letter-spacing: 0.03em;
}

.swatch .swatch-name {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  line-height: 1.15;
  font-weight: 800;
  opacity: 0.95;
}

.swatch.light {
  color: #111827;
  text-shadow: none;
}

.swatch.selected::after {
  content: "✓";
  position: absolute;
  top: 7px;
  right: 7px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #111827;
  font-size: 13px;
  font-weight: 900;
  text-shadow: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

/* Responsive adjustments */
@media (max-width: 559px) {
  .tabs {
    gap: 6px;
  }

  .tab {
    min-height: 42px;
    border-radius: 14px;
    font-size: 13px;
  }

  .palette-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .swatch {
    min-height: 56px;
    border-radius: 15px;
    padding: 8px;
  }

  .swatch .swatch-code {
    font-size: 18px;
  }

  .swatch .swatch-name {
    font-size: 11px;
  }
}

@media (min-width: 560px) {
  .palette-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}
