:root {
  --bg: #f3f6f8;
  --card: #ffffff;
  --ink: #10242e;
  --muted: #55707e;
  --line: #d4e0e6;
  --accent: #0b7285;
  --accent-strong: #075f6f;
  --danger: #9f1d2f;
  --surface: #e8f1f4;
  --radius: 14px;
  --shadow: 0 10px 25px rgba(16, 36, 46, 0.08);
}

* {
  box-sizing: border-box;
}

.hidden {
  display: none !important;
}

body {
  margin: 0;
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  background:
    radial-gradient(circle at 20% -20%, #dcebf0, transparent 42%),
    radial-gradient(circle at 100% 0%, #e8f4f6, transparent 36%),
    var(--bg);
  color: var(--ink);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}

.topbar h1 {
  margin: 0;
  padding: 14px 16px;
  text-align: center;
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.app-shell {
  width: min(980px, 100%);
  margin: 0 auto;
  padding: 12px 12px 28px;
}

.controls {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 10px;
}

.filter-wrap {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  align-items: end;
}

.filter-row {
  display: grid;
  grid-template-columns: 1fr 1.25fr 0.9fr;
  gap: 8px;
}

.field {
  display: grid;
  gap: 4px;
}

.field span {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.field-help {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.3;
}

input,
select,
button {
  font: inherit;
}

input,
select {
  width: 100%;
  height: 40px;
  border-radius: 10px;
  border: 1px solid #bfd0d9;
  background: #fff;
  color: var(--ink);
  padding: 0 10px;
}

input:focus,
select:focus,
button:focus-visible {
  outline: 2px solid #77c4d5;
  outline-offset: 1px;
}

.btn {
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 120ms ease, background-color 120ms ease, color 120ms ease;
}

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

.btn-primary {
  margin: 12px auto 6px;
  width: min(380px, 92%);
  height: 52px;
  display: block;
  font-size: 1.03rem;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(160deg, var(--accent), #1f9ab1);
}

.btn-primary:hover {
  background: linear-gradient(160deg, var(--accent-strong), #17889d);
}

.btn-secondary {
  margin: 4px auto 0;
  width: min(280px, 86%);
  height: 40px;
  display: block;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid #b6ccd6;
  font-weight: 700;
}

.btn-small {
  min-height: 38px;
  padding: 0 12px;
  background: #d8ebf1;
  color: #154454;
  font-weight: 700;
}

.btn-danger {
  background: #f8dfe3;
  color: var(--danger);
}

.status-text {
  min-height: 20px;
  margin: 8px 0 2px;
  font-size: 0.86rem;
  text-align: center;
  color: var(--muted);
}

.submission-status {
  margin-top: 10px;
  background: #ffffff;
  border: 1px solid #d8e6ec;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px;
}

.submission-headline {
  margin: 0 0 8px;
  color: #0a5f74;
  font-weight: 800;
}

.submission-status-list {
  margin: 0;
  padding-left: 18px;
  color: #335667;
  display: grid;
  gap: 5px;
  font-size: 0.88rem;
}

.results-headline {
  margin-top: 10px;
  padding: 0 2px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.results-summary {
  margin: 0;
  color: #43606d;
  font-size: 0.9rem;
  font-weight: 700;
}

.results {
  margin-top: 8px;
  display: grid;
  gap: 10px;
}

.location-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px;
}

.location-head h3 {
  margin: 0;
  font-size: 1.03rem;
}

.location-address {
  margin: 2px 0 10px;
  font-size: 0.86rem;
  color: var(--muted);
}

.deal-headline-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.83rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #3f5f6d;
  font-weight: 800;
  margin-bottom: 8px;
}

.deal-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.deal-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.deal-link {
  border: 0;
  background: transparent;
  color: var(--accent-strong);
  font-weight: 700;
  text-align: left;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
}

.deal-link::after {
  content: " >";
  text-decoration: none;
}

.deal-empty {
  color: var(--muted);
  font-size: 0.85rem;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 14px;
  background: rgba(10, 30, 37, 0.48);
}

.modal.hidden {
  display: none;
}

.modal-card {
  width: min(560px, 100%);
  max-height: 92vh;
  overflow: auto;
  background: #fff;
  border-radius: var(--radius);
  padding: 14px;
  border: 1px solid var(--line);
  position: relative;
}

.modal-close {
  position: absolute;
  right: 10px;
  top: 8px;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: #40606f;
  font-size: 1rem;
}

.detail-meta {
  margin: 4px 0;
  color: #3d5f6d;
  font-size: 0.9rem;
}

.detail-description {
  margin: 8px 0;
  line-height: 1.4;
}

.detail-actions {
  margin: 12px 0;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  background: #0a5f74;
  color: #fff;
  padding: 10px 14px;
  border-radius: 10px;
  box-shadow: 0 10px 24px rgba(8, 32, 38, 0.25);
  font-size: 0.88rem;
  max-width: min(92vw, 640px);
  text-align: center;
  z-index: 80;
}

@media (max-width: 560px) {
  .filter-wrap {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 360px) {
  .app-shell {
    padding: 10px 8px 24px;
  }

  .controls {
    padding: 8px;
  }

  .filter-row {
    grid-template-columns: 0.88fr 1.2fr 0.86fr;
    gap: 5px;
  }

  .field span {
    font-size: 0.64rem;
    letter-spacing: 0.02em;
  }

  input,
  select {
    height: 40px;
    padding: 0 7px;
    font-size: 0.81rem;
  }

  .results-summary {
    font-size: 0.84rem;
  }
}

@media (max-width: 300px) {
  .filter-row {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }

  .filter-row .field:last-child {
    grid-column: 1 / -1;
  }

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