:root {
  --bg: #f4f2ed;
  --surface: #eceae3;
  --card: #ffffff;
  --border: #dedad1;
  --gold: #9a7a3f;
  --gold2: #b8962e;
  --blue: #3a5cc7;
  --text: #1c1a16;
  --muted: #90887a;
  --green: #1e7a4a;
  --green-bg: #edf7f2;
  --green-border: #b8dfc9;
  --red: #b83232;
  --shadow: 0 1px 4px rgba(0, 0, 0, 0.07), 0 4px 16px rgba(0, 0, 0, 0.05);
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: "DM Sans", sans-serif;
  font-weight: 300;
  min-height: 100vh;
}

.hero {
  background: linear-gradient(160deg, #fff 0%, #f7f4ee 100%);
  border-bottom: 1px solid var(--border);
  padding: 52px 24px 44px;
  text-align: center;
}

.hero-eyebrow {
  font-size: 10px;
  letter-spacing: 5px;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 14px;
}

.hero h1 {
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(36px, 5vw, 62px);
  font-weight: 300;
  line-height: 1.08;
  margin-bottom: 10px;
  color: var(--text);
}

.hero h1 em {
  color: var(--gold);
  font-style: italic;
}

.search-wrap {
  max-width: 680px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.search-row {
  display: flex;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  transition: border-color 0.2s;
  box-shadow: var(--shadow);
}

.search-row:focus-within {
  border-color: var(--gold);
}

.search-row input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: "DM Sans", sans-serif;
  font-size: 15px;
  padding: 14px 18px;
  font-weight: 300;
}

.search-row button {
  background: var(--gold);
  color: #fff;
  border: none;
  padding: 14px 24px;
  font-family: "DM Sans", sans-serif;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}

.search-row button:hover {
  background: var(--gold2);
}

.search-row button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.fields-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.field {
  flex: 1;
  min-width: 110px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.field label {
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
}

.field input,
.field select {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text);
  font-family: "DM Sans", sans-serif;
  font-size: 13px;
  padding: 9px 11px;
  outline: none;
  transition: border-color 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.field input:focus,
.field select:focus {
  border-color: var(--gold);
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 36px 24px 60px;
}

.status-bar {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 22px;
  font-size: 13px;
  color: var(--muted);
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
  flex-shrink: 0;
}

.dot.live {
  background: var(--gold);
  animation: pulse 1.4s infinite;
}

.dot.ok {
  background: var(--green);
}

.dot.err {
  background: var(--red);
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.25;
  }
}

.results-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 22px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.results-header h2 {
  font-family: "Cormorant Garamond", serif;
  font-size: 13px;
  font-weight: 300;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--muted);
}

.results-header .count {
  font-family: "Cormorant Garamond", serif;
  font-size: 22px;
  font-style: italic;
  color: var(--gold);
}

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

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  height: 560px;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.25s, transform 0.25s;
  animation: up 0.4s ease both;
  box-shadow: var(--shadow);
}

.card:hover {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

@keyframes up {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card-head {
  padding: 18px 20px 15px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, #fafaf8 0%, #fff 100%);
}

.card-title-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: flex-start;
}

.card-tag {
  font-size: 9px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 7px;
}

.card-name {
  font-family: "Cormorant Garamond", serif;
  font-size: 20px;
  font-weight: 400;
  line-height: 1.2;
  margin-bottom: 5px;
  color: var(--text);
}

.card-geo {
  font-size: 12px;
  color: var(--muted);
}

.card-body {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.card-meta {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.card-meta strong {
  color: var(--gold);
}

.card-submeta {
  margin-top: 6px;
}

.rates-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.rates-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
}

.rates-scroll::-webkit-scrollbar {
  width: 7px;
}

.rates-scroll::-webkit-scrollbar-thumb {
  background: #cbc3b3;
  border-radius: 8px;
}

.rates-lbl {
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
}

.source-btn {
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--blue);
  background: transparent;
  border: 1px solid rgba(58, 92, 199, 0.25);
  border-radius: 4px;
  padding: 5px 11px;
  text-decoration: none;
  transition: all 0.2s;
  white-space: nowrap;
}

button.source-btn {
  font-family: "DM Sans", sans-serif;
  cursor: pointer;
}

button.source-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.source-btn:hover {
  background: rgba(58, 92, 199, 0.07);
  border-color: var(--blue);
}

.hint {
  font-size: 12px;
  color: var(--muted);
  padding: 4px 0;
}

.rates-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 100%;
}

.rate-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  padding: 10px 13px;
  background: var(--surface);
  border-radius: 6px;
  font-size: 13px;
  animation: up 0.3s ease both;
  border: 1px solid transparent;
  transition: border-color 0.15s;
}

.rate-row:hover {
  border-color: var(--border);
}

.rate-row.best-row {
  background: var(--green-bg);
  border-color: var(--green-border);
}

.rate-name {
  color: var(--text);
  display: block;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 400;
}

.rate-price {
  font-family: "Cormorant Garamond", serif;
  font-size: 19px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

.rate-price.best {
  color: var(--green);
}

.loading {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  padding: 10px 0;
}

.spin {
  width: 13px;
  height: 13px;
  border: 2px solid var(--border);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

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

.err-msg {
  font-size: 12px;
  color: var(--red);
  padding: 6px 0;
}

.hidden {
  display: none;
}

@media (max-width: 700px) {
  .hero {
    padding: 42px 16px 34px;
  }

  .container {
    padding: 22px 16px 40px;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .card {
    height: 520px;
  }
}
