:root {
  color-scheme: light;
  --bg: #f6f7f4;
  --text: #1d2420;
  --muted: #64706a;
  --line: #d9dfd8;
  --panel: #ffffff;
  --accent: #0f7b63;
  --accent-dark: #095844;
  --warn: #9c6b12;
  --bad: #a33b32;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.shell {
  width: min(1120px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 44px;
}

.toolbar {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  align-items: start;
  padding: 20px 0 18px;
  border-bottom: 1px solid var(--line);
}

h1 {
  margin: 0;
  font-size: 30px;
  line-height: 1.2;
  letter-spacing: 0;
}

p {
  margin: 6px 0 0;
  color: var(--muted);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 12px;
  align-items: end;
}

label {
  display: grid;
  gap: 7px;
  font-size: 13px;
  color: var(--muted);
}

input,
select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px 12px;
  font: inherit;
  color: var(--text);
  background: #fff;
}

button {
  min-height: 42px;
  border: 0;
  border-radius: 7px;
  padding: 0 20px;
  background: var(--accent);
  color: white;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  background: var(--accent-dark);
}

.location-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 10px;
  align-items: end;
  margin-top: 12px;
  padding: 12px;
  background: #eef2ed;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.ghost {
  background: #fff;
  color: var(--accent-dark);
  border: 1px solid var(--line);
  white-space: nowrap;
  width: 100%;
}

.ghost:hover {
  background: #e8f2ee;
}

.location-status {
  min-height: 21px;
  margin-top: 8px;
  font-size: 13px;
}

.summary {
  min-height: 92px;
  padding: 20px 0;
}

.empty,
.winner {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

.winner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.winner strong {
  display: block;
  font-size: 24px;
}

.winner span {
  color: var(--muted);
}

.winner .price {
  font-size: 32px;
  font-weight: 800;
  color: var(--accent-dark);
  white-space: nowrap;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}

.offer {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: hidden;
}

.offer.best {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(15, 123, 99, 0.1);
}

.offer.error {
  border-color: #e3b2ad;
  min-height: 132px;
}

.offer-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.offer h2 {
  margin: 0;
  font-size: 23px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 10px;
  background: #e9f4ef;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.trust {
  border-radius: 7px;
  padding: 9px 10px;
  font-size: 13px;
  line-height: 1.5;
}

.trust.trusted {
  background: #eaf5ef;
  color: var(--accent-dark);
}

.trust.partial {
  background: #fff7e8;
  color: var(--warn);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.metric {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.metric small {
  display: block;
  color: var(--muted);
  margin-bottom: 4px;
}

.metric b {
  font-size: 18px;
}

.note {
  color: var(--muted);
  line-height: 1.7;
  font-size: 14px;
}

.warning {
  color: var(--warn);
}

.error-text {
  color: var(--bad);
  overflow-wrap: anywhere;
}

@media (max-width: 820px) {
  .toolbar,
  .form-grid,
  .location-panel,
  .grid {
    grid-template-columns: 1fr;
  }

  .winner {
    align-items: start;
    flex-direction: column;
  }
}
