.km-widget {
  width: 100%;
  margin-top:-3px;
  margin-bottom:-3px;
}

.km-card {
  background: var(--km-bg);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: var(--km-radius);
  padding: 18px;
  box-shadow: none;
  max-width: 720px;
  margin:10px auto;
  box-sizing: border-box;
}

.km-title-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 10px;
}

.km-title {
  margin: 0;
  padding: 10px 20px;
  min-width: 180px;
  text-align: center;
  line-height: 1.4;
  font-size: 14px;
  color: #444444;
  font-weight: 700;
  background: #F8F9F8;
  border-radius: 999px;
  display: inline-block;
}

.km-testbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: center;
  margin: 0 0 8px;
}

.km-testbar-label {
  font-size: 13px;
  line-height: 1.4;
}

.km-test-date {
  border: 1px solid #d9d9d9;
  border-radius: 10px;
  padding: 8px 10px;
  background: #fff;
  color: var(--km-text);
  font-size: 14px;
}

.km-controls {
  display: grid;
  gap: 8px;
  margin: 4px 0 8px;
  justify-items: center;
}

.km-search-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  width: 100%;
  max-width: 420px;
}

.km-search-input {
  min-width: 0;
  border: 1px solid #d9d9d9;
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff;
  color: var(--km-text);
  font-size: 14px;
}

.km-btn {
  appearance: none;
  border: none;
  border-radius: 12px;
  padding: 10px 14px;
  color: #fff;
  cursor: pointer;
  line-height: 1.2;
  font-size: 14px;
  white-space: nowrap;
  width: auto;
}

.km-geolocate {
  background: var(--km-geo-btn, var(--km-accent));
  width: fit-content;
  margin: 0 auto;
  display: block;
  justify-self: center;
}

.km-search-btn {
  background: var(--km-search-btn, var(--km-accent));
}

.km-test-apply,
.km-test-reset {
  background: var(--km-accent);
}

.km-btn:hover {
  opacity: 0.92;
}

.km-search-results {
  margin: 0;
  display: grid;
  gap: 6px;
  width: 100%;
  max-width: 420px;
}

.km-search-results:empty {
  margin: 0;
  gap: 0;
}

.km-search-results:not(:empty) {
  margin-top: 6px;
}

.km-status {
  min-height: 0;
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
  width: 100%;
  max-width: 420px;
}

.km-status:not(:empty) {
  margin-bottom: 4px;
}

.km-result-item {
  appearance: none;
  border: 1px solid #e6e6e6;
  background: #fff;
  border-radius: 10px;
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
  color: var(--km-text);
}

.km-main {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  align-items: start;
}

.km-visual {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0;
  padding: 0;
}

.km-moon-frame {
  width: 130px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  margin: 0;
  padding: 0;
  line-height: 0;
}

.km-moon-svg {
  width: 120px;
  height: 120px;
  display: block;
  overflow: visible;
}

.km-moon-dark-base {
  fill: var(--km-moon-light);
}

.km-moon-lit-path {
  fill: var(--km-moon-dark);
  fill-rule: evenodd;
}

.km-info {
  display: grid;
  gap: 12px;
  margin-top: 0;
}

.km-item {
  display: grid;
  gap: 4px;
}

.km-label {
  color: var(--km-accent);
  font-weight: 700;
  line-height: 1.5;
  text-align: left;
}

.km-value {
  line-height: 1.8;
}

.km-next-event-strong {
  font-weight: 700;
}

.km-blogcard {
  margin-top: 6px;
}

.km-blogcard .blogcard-wrap,
.km-blogcard .blogcard {
  margin-top: 0;
}

@media (max-width: 680px) {
  .km-card {
    padding: 16px;
  }

  .km-title-wrap {
    margin-bottom: 6px;
  }

  .km-testbar {
    margin-bottom: 6px;
  }

  .km-main {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .km-visual {
    margin: 0;
    padding: 0;
  }

  .km-moon-frame {
    width: 112px;
    margin: -8px auto 0;
    padding: 0;
  }

  .km-moon-svg {
    width: 104px;
    height: 104px;
  }

  .km-controls {
    gap: 8px;
    margin: 4px 0 8px;
  }

  .km-search-results {
    margin-bottom: 0;
  }

  .km-status:not(:empty) {
    margin-bottom: 4px;
  }

  .km-info {
    gap: 10px;
  }
}