.theme-dark .gmt-tool {
  --clock-face: color-mix(in srgb, var(--bg-surface) 60%, #000);
}

.gmt-tool {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;

  --clock-face: var(--bg-surface);
  --clock-bezel: color-mix(in srgb, var(--accent) 35%, transparent);
  --clock-marks: var(--text-muted);
  --clock-hour: var(--accent);
  --clock-min: var(--text-base);
  --clock-sec: var(--color-error);
}

.gmt-search-w {
  position: relative;
  max-width: 420px;
}

.gmt-search {
  width: 100%;
  padding: 0.8rem 1.1rem;
  border: 1.5px solid var(--border-base);
  border-radius: 0.85rem;
  background: var(--bg-surface);
  color: var(--text-base);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.15s ease;
  box-sizing: border-box;
}

.gmt-search:focus {
  border-color: var(--accent);
}

.gmt-search::placeholder {
  color: var(--text-base);
  opacity: 0.3;
}

.gmt-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 50;
  margin-top: 0.3rem;
  border: 1px solid var(--border-base);
  border-radius: 0.85rem;
  background: var(--bg-surface);
  max-height: 280px;
  overflow-y: auto;
  display: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.gmt-dropdown.open {
  display: block;
}

.gmt-dd-item {
  padding: 0.65rem 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-base);
  transition: background 0.1s ease;
}

.gmt-dd-item:first-child {
  border-radius: 0.85rem 0.85rem 0 0;
}

.gmt-dd-item:last-child {
  border-radius: 0 0 0.85rem 0.85rem;
}

.gmt-dd-item:hover {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}

.gmt-dd-item.taken {
  opacity: 0.3;
  pointer-events: none;
}

.gmt-dd-offset {
  font-size: 0.75rem;
  opacity: 0.5;
}

.gmt-dd-empty {
  padding: 1rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-base);
  opacity: 0.4;
}

.gmt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

.gmt-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 1.75rem 1rem 1.15rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-base);
  border-radius: 1.25rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  min-height: 300px;
}

.gmt-card:hover {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border-base));
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
}

.gmt-card-remove {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  width: 1.6rem;
  height: 1.6rem;
  border: none;
  border-radius: 50%;
  background: color-mix(in srgb, var(--text-base) 8%, transparent);
  color: var(--text-base);
  font-size: 0.85rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.gmt-card:hover .gmt-card-remove {
  opacity: 0.4;
}

.gmt-card-remove:hover {
  opacity: 1;
  background: color-mix(in srgb, var(--accent) 20%, transparent);
  color: var(--accent);
}

.gmt-card-clock-w {
  width: 160px;
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gmt-card-clock {
  width: 100%;
  height: 100%;
  display: block;
}

.gmt-card-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
}

.gmt-card-city {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-base);
  opacity: 0.5;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 180px;
}

.gmt-card-time {
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.4;
  color: var(--text-base);
  letter-spacing: 0.05em;
  font-variant-numeric: tabular-nums;
  opacity: 0.8;
}

.gmt-card-offset {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-base);
  opacity: 0.35;
  letter-spacing: 0.03em;
}

@media (max-width: 640px) {
  .gmt-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.6rem;
  }

  .gmt-card {
    padding: 1.2rem 0.6rem 0.85rem;
    min-height: 220px;
  }

  .gmt-card-clock-w {
    width: 120px;
    height: 120px;
  }

  .gmt-card-time {
    font-size: 0.85rem;
  }
}

@media (max-width: 400px) {
  .gmt-grid {
    grid-template-columns: 1fr;
    gap: 0.6rem;
  }
}
