:root {
  --bg: #f4efe8;
  --bg-accent: #dce8e0;
  --ink: #1f2829;
  --muted: #5f6868;
  --card: rgba(255, 251, 245, 0.84);
  --line: rgba(31, 40, 41, 0.08);
  --brand: #b55233;
  --brand-deep: #7c321d;
  --sale: #a83c1b;
  --jeonse: #1c5a86;
  --monthly: #7a4f16;
  --resale: #356839;
  --shadow: 0 20px 60px rgba(27, 37, 41, 0.12);
  --radius-xl: 28px;
  --radius-lg: 20px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "SUIT Variable", "Pretendard Variable", "Malgun Gothic", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(181, 82, 51, 0.16), transparent 24%),
    radial-gradient(circle at top right, rgba(29, 95, 139, 0.14), transparent 22%),
    linear-gradient(160deg, var(--bg) 0%, #fbfaf7 52%, var(--bg-accent) 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.46) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.46) 1px, transparent 1px);
  background-size: 30px 30px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.5), transparent 85%);
}

.page-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 36px 20px 60px;
}

.hero,
.content-grid {
  display: grid;
  gap: 22px;
}

.hero-copy,
.filter-card,
.glass-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--card);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
  padding: 28px;
}

.hero-copy::after,
.filter-card::after,
.glass-card::after {
  content: "";
  position: absolute;
  right: -72px;
  bottom: -72px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.46), transparent 62%);
}

.eyebrow,
.section-kicker {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 14px;
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.hero-text,
.disclaimer,
.table-meta,
.source-note,
.source-role {
  color: var(--muted);
  line-height: 1.7;
}

.hero-text {
  max-width: 52rem;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
  margin-bottom: 18px;
}

.section-head.compact {
  margin-bottom: 14px;
}

.section-head-wide {
  align-items: flex-end;
  gap: 24px;
}

.section-head h2 {
  margin-bottom: 0;
  font-size: 1.55rem;
  letter-spacing: -0.05em;
}

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

.theme-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  min-width: 0;
  padding: 12px 18px;
  border: 1px solid rgba(31, 40, 41, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  text-align: center;
  color: var(--ink);
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.theme-tab:hover {
  transform: translateY(-2px);
}

.theme-tab.is-active {
  border-color: rgba(181, 82, 51, 0.22);
  background: linear-gradient(180deg, rgba(181, 82, 51, 0.12) 0%, rgba(255, 255, 255, 0.94) 100%);
  box-shadow: 0 12px 22px rgba(125, 50, 29, 0.08);
}

.theme-tab strong {
  font-size: 0.96rem;
  font-weight: 800;
  line-height: 1.1;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr)) auto;
  gap: 12px;
  align-items: end;
}

.select-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.92rem;
  font-weight: 700;
}

select,
button,
input {
  font: inherit;
}

select,
.primary-button,
.secondary-button {
  height: 50px;
  border-radius: 16px;
}

select,
.table-search-input {
  border: 1px solid rgba(31, 40, 41, 0.12);
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
}

select {
  padding: 0 14px;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.primary-button,
.secondary-button {
  border: none;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.primary-button {
  min-width: 160px;
  color: #fffaf5;
  font-weight: 800;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-deep) 100%);
  box-shadow: 0 12px 24px rgba(125, 50, 29, 0.24);
}

.secondary-button {
  padding: 0 18px;
  color: var(--ink);
  font-weight: 700;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(31, 40, 41, 0.08);
}

.primary-button:hover,
.secondary-button:hover {
  transform: translateY(-2px);
}

.trade-filter-block {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.trade-filter-label {
  font-size: 0.92rem;
  font-weight: 800;
}

.trade-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.trade-filter-button {
  min-width: 88px;
  height: 40px;
  padding: 0 14px;
  border: 1px solid rgba(31, 40, 41, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease;
}

.trade-filter-button:hover {
  transform: translateY(-1px);
}

.trade-filter-button.is-active {
  border-color: rgba(181, 82, 51, 0.2);
  background: rgba(181, 82, 51, 0.12);
  color: var(--brand-deep);
}

.loading-progress {
  margin-top: 16px;
  padding: 12px 14px 14px;
  border-radius: 18px;
  border: 1px solid rgba(45, 134, 73, 0.14);
  background: linear-gradient(180deg, rgba(235, 248, 239, 0.88) 0%, rgba(245, 251, 246, 0.9) 100%);
}

.loading-progress-head {
  margin-bottom: 8px;
  color: #24613a;
  font-size: 0.92rem;
  font-weight: 800;
}

.loading-progress-track {
  overflow: hidden;
  height: 12px;
  border-radius: 999px;
  background: rgba(46, 125, 50, 0.12);
}

.loading-progress-bar {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #4caf50 0%, #6ccf6d 55%, #8ce28d 100%);
  transition: width 260ms ease;
}

.transactions-heading {
  display: grid;
  gap: 8px;
}

.transactions-heading .section-kicker,
.transactions-heading h2,
.table-meta {
  margin: 0;
}

.transactions-side {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.export-button {
  height: 42px;
  border-radius: 999px;
  white-space: nowrap;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.summary-chip {
  display: grid;
  gap: 4px;
  min-height: 74px;
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid rgba(31, 40, 41, 0.08);
  background: rgba(255, 255, 255, 0.64);
}

.summary-chip-label {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.summary-chip-value {
  font-size: 1.05rem;
  font-weight: 800;
}

.table-search-bar {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
  padding: 14px 16px;
  border: 1px solid rgba(31, 40, 41, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.64);
}

.table-search-label {
  font-size: 0.95rem;
  font-weight: 800;
}

.table-search-input {
  width: 100%;
  height: 46px;
  padding: 0 16px;
  border-radius: 14px;
}

.table-search-input:focus {
  outline: none;
  border-color: rgba(181, 82, 51, 0.4);
  box-shadow: 0 0 0 4px rgba(181, 82, 51, 0.1);
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid rgba(31, 40, 41, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead {
  background: linear-gradient(180deg, rgba(243, 228, 219, 0.95) 0%, rgba(249, 241, 235, 0.98) 100%);
}

th,
td {
  padding: 15px 12px;
  border-bottom: 1px solid rgba(31, 40, 41, 0.08);
  text-align: left;
  vertical-align: top;
}

th {
  font-size: 0.95rem;
  font-weight: 800;
  white-space: nowrap;
}

td {
  font-size: 0.95rem;
  line-height: 1.55;
}

.col-region,
.col-name,
.col-address,
.col-search,
.col-note {
  min-width: 160px;
}

.cell-stack-main,
.cell-text-main {
  display: block;
  font-weight: 700;
}

.cell-stack-sub,
.cell-text-sub,
.muted-text {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.88rem;
}

.type-badge,
.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 800;
}

.type-badge[data-type="매매"] {
  background: rgba(168, 60, 27, 0.1);
  color: var(--sale);
}

.type-badge[data-type="전세"] {
  background: rgba(28, 90, 134, 0.1);
  color: var(--jeonse);
}

.type-badge[data-type="월세"] {
  background: rgba(122, 79, 22, 0.12);
  color: var(--monthly);
}

.type-badge[data-type="전매"] {
  background: rgba(53, 104, 57, 0.12);
  color: var(--resale);
}

.search-button,
.source-link {
  color: var(--brand-deep);
  font-weight: 700;
  text-decoration: none;
}

.search-button:hover,
.source-link:hover {
  text-decoration: underline;
}

.search-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 110px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(181, 82, 51, 0.12);
}

.empty-state {
  margin: 16px 0 0;
  color: var(--muted);
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: center;
  margin-top: 16px;
}

.page-button,
.page-ellipsis {
  min-width: 42px;
  height: 40px;
  border-radius: 999px;
  font: inherit;
}

.page-button {
  padding: 0 14px;
  border: 1px solid rgba(31, 40, 41, 0.1);
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  font-weight: 700;
  cursor: pointer;
}

.page-button.is-active {
  border-color: rgba(181, 82, 51, 0.18);
  background: rgba(181, 82, 51, 0.12);
  color: var(--brand-deep);
}

.page-button:disabled {
  cursor: default;
  opacity: 0.45;
}

.page-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}

.source-list {
  display: grid;
  gap: 12px;
}

.source-item,
.filter-card {
  border: 1px solid rgba(31, 40, 41, 0.08);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.56);
}

.source-item {
  padding: 16px;
}

.source-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
  margin-bottom: 10px;
}

.status-pill[data-status="core"] {
  background: rgba(168, 60, 27, 0.1);
  color: var(--sale);
}

.status-pill[data-status="assistant"] {
  background: rgba(181, 82, 51, 0.12);
  color: var(--brand-deep);
}

.status-pill[data-status="reference"] {
  background: rgba(28, 90, 134, 0.1);
  color: var(--jeonse);
}

@media (max-width: 900px) {
  .filter-grid {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
  }
}

@media (max-width: 760px) {
  .page-shell {
    padding: 18px 14px 36px;
  }

  .hero-copy,
  .filter-card,
  .glass-card {
    padding: 22px;
  }

  .filter-grid,
  .table-search-bar {
    grid-template-columns: 1fr;
  }

  .section-head-wide {
    align-items: start;
    flex-wrap: wrap;
  }

  .transactions-side {
    width: 100%;
    justify-content: flex-start;
  }

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

  .trade-filter-button,
  .primary-button,
  .secondary-button {
    width: 100%;
  }

  .theme-tab {
    width: auto;
  }

  h1 {
    font-size: 2.6rem;
  }
}
