/* =========================================================
   hotel /#check UX improvements (handoff R5 続編)
   - Phase-colored spinner + rotating messages + elapsed badge
   - OTA chip brand colors (from tokens)
   - Skeleton placeholders
   - Accent orange watch CTA
   - Recent searches (localStorage)
   No emojis. No design changes outside the #check widget.
   ========================================================= */

/* ---- spinner ---- */
.check-spinner {
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: hm-spin 0.7s linear infinite;
  vertical-align: middle;
  margin-right: 8px;
  flex-shrink: 0;
}
@keyframes hm-spin { to { transform: rotate(360deg); } }

/* override the legacy .spinner used by old setStatus("…","loading") */
.status-bar .spinner {
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: hm-spin 0.7s linear infinite;
  vertical-align: middle;
  margin-right: 8px;
}

/* status bar loading state inherits color from the inline spinner color,
   but ensure error keeps its semantic. */
.status-bar.loading {
  background: var(--sw-bg);
  border: 1px solid var(--sw-border);
  border-radius: var(--sw-radius-md, 10px);
  padding: 10px 14px;
  font-size: 14px;
  color: var(--sw-text);
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

/* ---- elapsed badge ---- */
.elapsed-badge {
  display: inline-block;
  background: var(--sw-accent-light);
  color: var(--sw-accent-dark);
  font-family: var(--sw-font-en);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.04em;
  padding: 3px 9px;
  border-radius: 999px;
  margin-left: 8px;
  white-space: nowrap;
}

/* ---- skeleton placeholders ---- */
.skeleton-card {
  border: 1px solid var(--sw-border);
  border-radius: var(--sw-radius-md, 10px);
  padding: 14px 16px;
  background: #fff;
  margin-bottom: 10px;
}
.sk-line {
  background: linear-gradient(90deg, #f0f0f0 25%, #e6e6e6 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: hm-shimmer 1.4s linear infinite;
  border-radius: 4px;
  height: 12px;
}
.sk-line.w-70 { width: 70%; }
.sk-line.w-40 { width: 40%; margin-top: 10px; height: 10px; }
@keyframes hm-shimmer { to { background-position: -200% 0; } }

/* ---- OTA chip brand colors ---- */
.ota-chip {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 4px;
  font-family: var(--sw-font-en);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.04em;
  color: #fff;
  line-height: 1.4;
  background: var(--sw-text-secondary); /* fallback */
}
.ota-chip[data-ota="rakuten"]      { background: var(--sw-ota-rakuten); }
.ota-chip[data-ota="jalan"]        { background: var(--sw-ota-jalan); }
.ota-chip[data-ota="booking"],
.ota-chip[data-ota="booking.com"]  { background: var(--sw-ota-booking); }
.ota-chip[data-ota="expedia"]      { background: var(--sw-ota-expedia); }
.ota-chip[data-ota="agoda"]        { background: var(--sw-ota-agoda); }
.ota-chip[data-ota="tripcom"],
.ota-chip[data-ota="trip.com"],
.ota-chip[data-ota="trip"]         { background: var(--sw-ota-tripcom); }

/* ---- watch CTA (accent orange) ---- */
.btn-watch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--sw-accent);
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-watch:hover  { background: var(--sw-accent-dark); }
.btn-watch:active { transform: translateY(1px); }
.btn-watch:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-watch.is-added {
  background: var(--sw-primary);
}

/* ---- recent hotels chips ---- */
.hm-recent {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
  font-size: 12px;
  align-items: center;
}
.hm-recent__label {
  color: var(--sw-text-secondary);
  font-family: var(--sw-font-en);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.04em;
  margin-right: 2px;
}
.hm-recent__chip {
  background: var(--sw-primary-light);
  color: var(--sw-primary-dark);
  border: 0;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}
.hm-recent__chip:hover { background: var(--sw-primary); color: #fff; }
