:root {
  color-scheme: light;
  --ink: #132238;
  --muted: #637083;
  --line: #d9e2ef;
  --panel: #ffffff;
  --page: #f4f8fc;
  --blue: #0b66d8;
  --blue-dark: #084c9f;
  --green: #138a5b;
  --amber: #b86b00;
  --shadow: 0 16px 40px rgba(21, 44, 76, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--page);
  color: var(--ink);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px clamp(16px, 4vw, 56px);
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 8px;
  background: var(--blue);
  color: #fff;
}

.nav-actions {
  display: flex;
  gap: 8px;
}

.primary-btn,
.secondary-btn,
.ghost-btn,
.chip,
.mode-tab,
.admin-grid button {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 14px;
  font-weight: 750;
}

.primary-btn {
  background: var(--blue);
  color: #fff;
}

.primary-btn:hover {
  background: var(--blue-dark);
}

.secondary-btn {
  background: #e8f1ff;
  color: var(--blue-dark);
}

.ghost-btn {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}

.ghost-link {
  display: inline-grid;
  min-height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  color: var(--ink);
  font-weight: 750;
  text-decoration: none;
}

.search-shell {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(320px, 1.2fr);
  gap: 28px;
  padding: 38px clamp(16px, 4vw, 56px) 24px;
  background:
    linear-gradient(90deg, rgba(11, 102, 216, 0.9), rgba(13, 69, 132, 0.78)),
    url("https://images.unsplash.com/photo-1560518883-ce09059eeffa?auto=format&fit=crop&w=1600&q=80") center/cover;
  color: #fff;
}

.search-copy {
  align-self: end;
  max-width: 680px;
  padding: 26px 0;
}

.eyebrow {
  margin: 0 0 8px;
  color: currentColor;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
  opacity: 0.72;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 760px;
  margin-bottom: 0;
  font-size: clamp(2rem, 4.8vw, 4.6rem);
  line-height: 1.02;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.35rem, 2vw, 2rem);
}

.hero-note {
  max-width: 620px;
  margin: 18px 0 0;
  color: rgba(255, 255, 255, 0.88);
  font-size: 1.05rem;
  line-height: 1.55;
}

.search-panel,
.insight-panel,
.modal,
.listing-card {
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.search-panel {
  padding: 16px;
}

.mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}

.mode-tab {
  background: #f1f5fa;
  color: var(--ink);
}

.mode-tab.is-active {
  background: var(--blue);
  color: #fff;
}

label span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

input,
select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
  color: var(--ink);
}

.search-input input {
  min-height: 54px;
  font-size: 1.05rem;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.quick-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
}

.chip {
  background: #fff;
  border-color: var(--line);
  color: var(--ink);
}

.chip.is-active {
  border-color: var(--blue);
  background: #e8f1ff;
  color: var(--blue-dark);
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  color: var(--ink);
  font-weight: 750;
}

.toggle input {
  width: 18px;
  min-height: 18px;
}

.toggle span {
  margin: 0;
  color: var(--ink);
}

.content-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 20px;
  padding: 24px clamp(16px, 4vw, 56px) 48px;
}

.ad-band {
  padding: 18px clamp(16px, 4vw, 56px) 0;
}

.ad-slot {
  display: grid;
  min-height: 96px;
  place-items: center;
  border: 1px dashed #9db8db;
  border-radius: 8px;
  background: #ffffff;
  color: var(--muted);
  text-align: center;
}

.ad-slot span {
  color: var(--ink);
  font-weight: 850;
}

.ad-slot small {
  margin-top: 4px;
}

.insight-panel {
  position: sticky;
  top: 82px;
  height: max-content;
  padding: 16px;
}

.insight-panel > div {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.metric-label {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.insight-panel strong {
  font-size: 1.25rem;
}

.full-width {
  width: 100%;
  margin-top: 14px;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.section-head .eyebrow {
  color: var(--blue-dark);
}

.section-head select {
  max-width: 190px;
}

.listing-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.listing-card {
  overflow: hidden;
}

.listing-image {
  position: relative;
  aspect-ratio: 4 / 3;
  background: #dfe8f4;
}

.listing-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.badge-row {
  position: absolute;
  left: 10px;
  right: 10px;
  top: 10px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.badge {
  border-radius: 8px;
  padding: 6px 8px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  font-size: 0.75rem;
  font-weight: 850;
}

.badge.source {
  color: var(--blue-dark);
}

.listing-body {
  padding: 13px;
}

.price {
  margin: 0 0 6px;
  color: var(--blue-dark);
  font-size: 1.25rem;
  font-weight: 900;
}

.listing-title {
  min-height: 44px;
  margin-bottom: 8px;
  font-weight: 820;
  line-height: 1.3;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.9rem;
}

.card-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.card-actions a,
.card-actions button {
  display: inline-grid;
  min-height: 40px;
  place-items: center;
  border-radius: 8px;
  border: 1px solid var(--line);
  padding: 0 10px;
  color: var(--blue-dark);
  font-weight: 850;
  text-decoration: none;
  background: #fff;
}

.card-actions button.is-saved {
  background: #fff4df;
  color: var(--amber);
}

.map-strip {
  position: relative;
  min-height: 280px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(19, 34, 56, 0.08) 1px, transparent 1px),
    linear-gradient(rgba(19, 34, 56, 0.08) 1px, transparent 1px),
    #eaf1f8;
  background-size: 42px 42px;
}

.map-pin {
  position: absolute;
  border-radius: 8px;
  padding: 8px 10px;
  background: var(--blue);
  color: #fff;
  font-weight: 850;
  box-shadow: var(--shadow);
}

.pin-one {
  left: 22%;
  top: 34%;
}

.pin-two {
  left: 55%;
  top: 22%;
}

.pin-three {
  left: 42%;
  top: 64%;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 40px 16px;
  text-align: center;
  background: #fff;
}

.guide-section {
  padding: 16px clamp(16px, 4vw, 56px) 52px;
}

.guide-copy {
  max-width: 860px;
  margin-bottom: 18px;
}

.guide-copy .eyebrow {
  color: var(--blue-dark);
}

.guide-copy p {
  color: var(--muted);
  line-height: 1.65;
}

.guide-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.guide-grid article,
.policy-page {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 18px;
}

.guide-grid h3 {
  margin-bottom: 8px;
}

.guide-grid p,
.policy-page p,
.policy-page li {
  color: var(--muted);
  line-height: 1.65;
}

.guide-grid a,
.policy-page a {
  color: var(--blue-dark);
  font-weight: 800;
  text-decoration: none;
}

.site-footer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  padding: 26px clamp(16px, 4vw, 56px);
  border-top: 1px solid var(--line);
  background: #fff;
}

.site-footer p {
  max-width: 520px;
  margin: 10px 0 0;
  color: var(--muted);
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: end;
  gap: 14px;
}

.site-footer a {
  color: var(--blue-dark);
  font-weight: 750;
  text-decoration: none;
}

.policy-main {
  padding: 34px clamp(16px, 4vw, 56px) 56px;
}

.policy-page {
  max-width: 920px;
  margin: 0 auto;
}

.policy-page h1 {
  margin-bottom: 14px;
  color: var(--ink);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(11, 22, 37, 0.45);
}

.modal {
  position: relative;
  width: min(540px, 100%);
  padding: 22px;
}

.modal p {
  color: var(--muted);
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
}

.icon-btn {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 1.4rem;
}

.modal-form {
  display: grid;
  gap: 12px;
}

.admin-modal {
  width: min(760px, 100%);
}

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

.admin-grid button {
  background: #f5f8fc;
  border-color: var(--line);
  color: var(--ink);
  text-align: left;
}

.admin-page {
  padding: 28px clamp(16px, 4vw, 56px) 56px;
}

.admin-login,
.admin-dashboard {
  max-width: 1180px;
  margin: 0 auto;
}

.admin-login {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 24px;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 22px;
  box-shadow: var(--shadow);
}

.admin-login h1,
.admin-header h1 {
  font-size: clamp(2rem, 4vw, 3.4rem);
}

.admin-login p,
.admin-note {
  color: var(--muted);
  line-height: 1.55;
}

.admin-token-form {
  display: grid;
  gap: 12px;
}

.admin-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.admin-stats article,
.admin-tool-card,
.admin-section,
.admin-listing {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.admin-stats article {
  padding: 16px;
}

.admin-stats span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-weight: 800;
  font-size: 0.82rem;
}

.admin-stats strong {
  font-size: 1.55rem;
}

.admin-tools {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 14px;
  margin-bottom: 16px;
}

.admin-tool-card,
.admin-section {
  padding: 16px;
}

.admin-action-row,
.admin-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.admin-filter-row label {
  flex: 1 1 180px;
}

.admin-message {
  color: var(--muted);
  font-weight: 800;
}

.admin-message[data-type="success"] {
  color: var(--green);
}

.admin-message[data-type="error"] {
  color: #b42318;
}

.admin-list {
  display: grid;
  gap: 10px;
}

.admin-listing {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 12px;
}

.admin-listing-main {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.admin-listing-main img {
  width: 96px;
  height: 76px;
  border-radius: 8px;
  object-fit: cover;
  background: #dfe8f4;
}

.admin-listing-title {
  margin-bottom: 6px;
  font-weight: 850;
}

.admin-listing-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  gap: 8px;
}

.admin-listing-actions button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--blue-dark);
  font-weight: 850;
}

.status-pill {
  display: inline-grid;
  min-height: 38px;
  place-items: center;
  border-radius: 8px;
  padding: 0 10px;
  background: #fff4df;
  color: var(--amber);
  font-weight: 850;
}

.status-pill.approved {
  background: #e6f6ef;
  color: var(--green);
}

.source-table {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.source-table div {
  display: flex;
  justify-content: space-between;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.source-table div:last-child {
  border-bottom: 0;
}

.source-table strong {
  color: var(--green);
}

@media (max-width: 980px) {
  .search-shell,
  .content-layout {
    grid-template-columns: 1fr;
  }

  .insight-panel {
    position: static;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
  }

  .insight-panel > div {
    border-bottom: 0;
    padding: 0;
  }

  .insight-panel .full-width {
    margin-top: 0;
  }

  .listing-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .guide-grid,
  .site-footer,
  .admin-login,
  .admin-tools {
    grid-template-columns: 1fr;
  }

  .admin-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .site-footer nav {
    justify-content: start;
  }
}

@media (max-width: 680px) {
  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .nav-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .search-shell {
    padding-top: 24px;
  }

  h1 {
    font-size: 2.25rem;
  }

  .filter-grid,
  .listing-grid,
  .admin-grid,
  .admin-stats,
  .admin-listing,
  .admin-listing-main {
    grid-template-columns: 1fr;
  }

  .admin-listing-actions {
    justify-content: stretch;
  }

  .admin-listing-actions button,
  .status-pill {
    flex: 1 1 120px;
  }

  .toggle {
    width: 100%;
    margin-left: 0;
  }

  .content-layout {
    padding-top: 16px;
  }

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

  .section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .section-head select {
    max-width: none;
  }
}
