:root {
  --color-primary: #24405f;
  --color-primary-dark: #16233a;
  --color-bg: #eef3f7;
  --color-card: #ffffff;
  --color-text: #202b3a;
  --color-muted: #64758a;
  --color-border: #d9e3ec;
  --color-nodata: #c05621;
  --color-error: #c53030;
  --color-frost: #4fb8ce;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans",
    "Yu Gothic UI", sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 16px;
}

.container {
  width: 100%;
  max-width: 560px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Header: ロゴ（積雪量.com標識プレート意匠を内包）。h1/descはSEO・読み上げ用に非表示で保持 */
.header {
  text-align: center;
}

.header__logo {
  display: block;
  width: 100%;
  height: auto;
  margin: 0 auto;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Main: 検索欄と結果カード等の間隔 */
.main {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Search */
.search {
  background: var(--color-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}

.search__row {
  display: flex;
  gap: 10px;
}

.search__field {
  flex: 1;
  display: flex;
  align-items: stretch;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.search__field:focus-within {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(36, 64, 95, 0.15);
}

.search__prefix {
  flex: none;
  width: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-primary-dark);
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
}

.search__input {
  flex: 1;
  min-width: 0;
  height: 44px;
  border: none;
  background: transparent;
  padding: 0 14px;
  font-size: 1.125rem;
  letter-spacing: 0.05em;
  color: var(--color-text);
  outline: none;
}

.search__input::placeholder {
  color: #b7c4d1;
  letter-spacing: 0;
}

.search__btn {
  height: 44px;
  padding: 0 22px;
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}

.search__btn:hover {
  background: var(--color-primary-dark);
}

.search__btn:active {
  transform: translateY(1px);
}

.search__btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Loading */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--color-muted);
  padding: 20px;
}

.loading__spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Result */
.result {
  background: var(--color-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  border-left: 4px solid var(--color-primary);
}

.result--official { border-left-color: #38a169; }
.result--range    { border-left-color: #d69e2e; }
.result--calc     { border-left-color: #3182ce; }
.result--none     { border-left-color: #a0aec0; }

.result__address {
  font-size: 0.875rem;
  color: var(--color-muted);
  margin-bottom: 16px;
}

.result__body {
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
}

.result__label {
  font-size: 0.8125rem;
  color: var(--color-muted);
  font-weight: 500;
  white-space: nowrap;
}

.result__value {
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--color-primary);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.result__value--range {
  font-size: 1.9rem;
}

/* Status badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.badge--official {
  background: #c6f6d5;
  color: #276749;
  border: 1px solid #9ae6b4;
}

.badge--range {
  background: #fefcbf;
  color: #975a16;
  border: 1px solid #faf089;
}

.badge--calc {
  background: #bee3f8;
  color: #2a4365;
  border: 1px solid #90cdf4;
}

.badge--none {
  background: #edf2f7;
  color: #4a5568;
  border: 1px solid #cbd5e0;
}

.result__note {
  margin-top: 12px;
  font-size: 0.8rem;
  color: var(--color-muted);
}

/* 雪深ゲージ: 数値を「積もった高さ」として視覚化するシグネチャ要素 */
.gauge {
  margin-top: 14px;
}

.gauge__track {
  position: relative;
  height: 10px;
  border-radius: 6px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
}

.gauge__fill {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 0%;
  border-radius: 5px;
  background: var(--color-primary);
  transition:
    width 0.6s cubic-bezier(0.2, 0.8, 0.2, 1),
    left 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.gauge__fill--official {
  background: #38a169;
}

.gauge__fill--range {
  background: #d69e2e;
}

.gauge__fill--calc {
  background-image: repeating-linear-gradient(
    135deg,
    #3182ce,
    #3182ce 6px,
    #63a6dd 6px,
    #63a6dd 12px
  );
}

.gauge__overflow {
  position: absolute;
  right: -1px;
  top: -9px;
  font-size: 0.65rem;
  color: var(--color-muted);
}

.gauge__ticks {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  font-size: 0.65rem;
  color: var(--color-muted);
  font-variant-numeric: tabular-nums;
}

/* Calc formula box */
.formula {
  margin-top: 12px;
  background: #f0f4f8;
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 0.8rem;
}

.formula__title {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--color-muted);
  margin-bottom: 4px;
}

.formula__expr {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.78rem;
  color: var(--color-text);
  overflow-x: auto;
  white-space: nowrap;
  padding-bottom: 2px;
}

.formula__hint {
  margin-top: 6px;
  font-size: 0.72rem;
  color: var(--color-muted);
}

/* Source block */
.source {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px dashed var(--color-border);
  font-size: 0.78rem;
  color: var(--color-muted);
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.source__name {
  color: var(--color-text);
  font-weight: 600;
}

.source__name::before {
  content: "出典: ";
  font-weight: 400;
  color: var(--color-muted);
}

.source a {
  color: var(--color-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.source__date {
  font-size: 0.72rem;
}

/* Error */
.error-box {
  background: #fff5f5;
  border-radius: var(--radius);
  border-left: 4px solid var(--color-error);
  padding: 16px 20px;
  font-size: 0.9rem;
  color: var(--color-error);
}

/* Footer */
.footer {
  text-align: center;
  font-size: 0.75rem;
  color: var(--color-muted);
  line-height: 1.6;
  padding-top: 16px;
}

.footer::before {
  content: "";
  display: block;
  width: 44px;
  height: 3px;
  margin: 0 auto 14px;
  background: var(--color-primary);
  border-radius: 2px;
}

.footer__nav {
  margin-top: 10px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px 14px;
}

.footer__nav a {
  color: var(--color-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
  font-size: 0.75rem;
}

.footer__nav a:hover {
  color: var(--color-primary-dark);
}

/* Utility */
.hidden {
  display: none !important;
}
