:root {
  --surface-primary: #fcfcfb;
  --surface-secondary: #ffffff;
  --surface-tertiary: #f4f6f5;
  --surface-warm: #fff7f2;
  --text-primary: #171717;
  --text-secondary: #5f6663;
  --text-tertiary: #8a928e;
  --border-default: #dfe4e1;
  --border-subtle: #ecefed;
  --accent-primary: #e8503a;
  --accent-hover: #c93d2b;
  --accent-pine: #1f6b52;
  --accent-water: #2f6f92;
  --status-warning: #9b5e18;
  --status-error: #a43a2e;
  --shadow-subtle: 0 1px 2px rgba(23, 23, 23, 0.04);
  --shadow-raised: 0 8px 20px rgba(23, 23, 23, 0.08);
  --focus-ring: 0 0 0 3px rgba(232, 80, 58, 0.18);
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--surface-primary);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard", "Segoe UI", sans-serif;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.55;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
  letter-spacing: 0;
}

button,
a,
select,
input {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
select:focus-visible,
input:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.page-header {
  border-bottom: 1px solid var(--border-default);
  background: linear-gradient(180deg, #ffffff 0%, #fbfcfb 100%);
}

.header-inner {
  width: min(1440px, calc(100% - 32px));
  margin: 0 auto;
  padding: var(--space-10) 0 var(--space-8);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: var(--space-8);
  align-items: end;
}

.eyebrow,
.lead,
.summary-card span,
.section-head p,
.notice-card span,
.notice-card p,
.page-footer,
.meta-label,
.tag,
.detail-line,
.source-note,
.budget-meter,
.cart-item span {
  color: var(--text-secondary);
}

.eyebrow {
  margin: 0 0 var(--space-2);
  font-size: 13px;
}

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

h1 {
  font-size: clamp(32px, 5vw, 40px);
  line-height: 1.12;
  font-weight: 720;
}

.lead {
  max-width: 760px;
  margin-top: var(--space-3);
  font-size: 17px;
}

.summary-card {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-2);
  padding: var(--space-3);
  background: var(--surface-secondary);
  border: 1px solid var(--border-default);
  border-radius: 8px;
  box-shadow: var(--shadow-subtle);
}

.summary-card div {
  min-width: 0;
  padding: var(--space-3);
  background: var(--surface-tertiary);
  border-radius: 6px;
}

.summary-card span {
  display: block;
  margin-bottom: var(--space-1);
  font-size: 12px;
}

.summary-card strong {
  display: block;
  font-size: 16px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.app-shell {
  width: min(1440px, calc(100% - 32px));
  margin: 0 auto;
  padding: var(--space-6) 0 var(--space-12);
}

.toolbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: minmax(240px, 360px) minmax(0, 1fr);
  gap: var(--space-4);
  align-items: end;
  padding: var(--space-3) 0;
  background: rgba(252, 252, 251, 0.94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
}

.search-field {
  display: grid;
  gap: var(--space-2);
}

.search-field label {
  font-size: 12px;
  color: var(--text-secondary);
}

.search-field input,
.section-head select {
  width: 100%;
  height: 44px;
  border: 1px solid var(--border-default);
  border-radius: 8px;
  background: var(--surface-secondary);
  color: var(--text-primary);
  padding: 0 var(--space-4);
}

.filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.filter-button,
.text-button,
.primary-button,
.select-button,
.external-link,
.remove-button {
  border: 1px solid var(--border-default);
  border-radius: 8px;
  background: var(--surface-secondary);
  color: var(--text-primary);
  cursor: pointer;
  transition: transform 120ms ease-out, border-color 120ms ease-out, background-color 120ms ease-out, color 120ms ease-out;
}

.filter-button {
  min-height: 44px;
  padding: 0 var(--space-4);
}

.filter-button.active,
.select-button.selected {
  border-color: var(--accent-primary);
  background: var(--surface-warm);
  color: var(--accent-hover);
}

.filter-button:active,
.text-button:active,
.primary-button:active,
.select-button:active,
.external-link:active,
.remove-button:active {
  transform: scale(0.98);
}

.notice-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-3);
  margin: var(--space-5) 0 var(--space-6);
}

.notice-card {
  padding: var(--space-4);
  border: 1px solid var(--border-default);
  border-radius: 8px;
  background: var(--surface-secondary);
}

.notice-card span {
  display: block;
  margin-bottom: var(--space-2);
  font-size: 12px;
  font-weight: 700;
}

.notice-card p {
  font-size: 13px;
}

.content-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: var(--space-6);
  align-items: start;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: var(--space-4);
  align-items: center;
  margin-bottom: var(--space-4);
}

.section-head h2 {
  font-size: 24px;
  line-height: 1.28;
}

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

.card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
}

.stay-card {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  min-width: 0;
  border: 1px solid var(--border-default);
  border-radius: 8px;
  background: var(--surface-secondary);
  box-shadow: var(--shadow-subtle);
  transition: transform 220ms ease-in-out, border-color 220ms ease-in-out, box-shadow 220ms ease-in-out;
  animation: cardIn 360ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.stay-card:hover {
  transform: translateY(-2px);
  border-color: #c8d0cc;
  box-shadow: 0 8px 18px rgba(23, 23, 23, 0.07);
}

.stay-card.selected {
  border-color: var(--accent-primary);
}

.stay-card.selected::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--accent-primary);
  z-index: 2;
}

.image-frame {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--surface-tertiary);
}

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

.rank-badge {
  position: absolute;
  top: var(--space-3);
  left: var(--space-3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  height: 32px;
  padding: 0 var(--space-2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(223, 228, 225, 0.85);
  color: var(--text-primary);
  font-family: "SF Mono", "JetBrains Mono", ui-monospace, monospace;
  font-size: 12px;
  font-weight: 700;
}

.source-chip {
  position: absolute;
  right: var(--space-3);
  bottom: var(--space-3);
  max-width: calc(100% - 24px);
  padding: var(--space-1) var(--space-2);
  border-radius: 8px;
  background: rgba(23, 23, 23, 0.72);
  color: #ffffff;
  font-size: 12px;
  font-weight: 650;
}

.card-body {
  display: grid;
  gap: var(--space-3);
  padding: var(--space-4);
}

.title-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-3);
  align-items: start;
}

.title-row h3 {
  font-size: 18px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.price {
  text-align: right;
  white-space: nowrap;
}

.price strong {
  display: block;
  color: var(--accent-hover);
  font-size: 18px;
  line-height: 1.2;
}

.price span {
  color: var(--text-tertiary);
  font-size: 12px;
}

.tag-row,
.score-row,
.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.tag {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 0 var(--space-2);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--surface-tertiary);
  font-size: 12px;
  font-weight: 650;
}

.tag.social {
  color: var(--accent-pine);
  background: #eef8f3;
}

.tag.water {
  color: var(--accent-water);
  background: #eef7fb;
}

.tag.caution {
  color: var(--status-warning);
  background: var(--surface-warm);
}

.score-pill {
  flex: 1 1 120px;
  min-width: 0;
  padding: var(--space-2);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--surface-primary);
}

.score-pill span {
  display: block;
  color: var(--text-secondary);
  font-size: 12px;
}

.score-pill strong {
  display: block;
  font-size: 15px;
}

.detail-line {
  font-size: 13px;
  overflow-wrap: anywhere;
}

.detail-line strong {
  color: var(--text-primary);
}

.caution-box {
  padding: var(--space-3);
  border-radius: 8px;
  border: 1px solid #f2d1bd;
  background: var(--surface-warm);
  color: var(--status-warning);
  font-size: 13px;
}

.action-row {
  margin-top: var(--space-1);
}

.select-button,
.external-link {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0 var(--space-4);
  text-decoration: none;
}

.select-button {
  flex: 1 1 150px;
}

.external-link {
  flex: 1 1 130px;
}

.external-link:hover,
.filter-button:hover,
.select-button:hover,
.text-button:hover,
.remove-button:hover {
  border-color: var(--accent-primary);
}

.compare-panel {
  min-width: 0;
}

.compare-sticky {
  position: sticky;
  top: 88px;
  display: grid;
  gap: var(--space-4);
  padding: var(--space-5);
  border: 1px solid var(--border-default);
  border-radius: 8px;
  background: var(--surface-secondary);
  box-shadow: var(--shadow-raised);
}

.compare-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
}

.compare-head span {
  display: block;
  color: var(--text-secondary);
  font-size: 12px;
}

.compare-head strong {
  display: block;
  font-size: 24px;
  line-height: 1.2;
}

.text-button,
.remove-button {
  min-height: 34px;
  padding: 0 var(--space-3);
}

.budget-meter {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-3);
  border-radius: 8px;
  background: var(--surface-tertiary);
  font-size: 13px;
}

.meter-row {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
}

.meter-track {
  height: 8px;
  overflow: hidden;
  border-radius: 8px;
  background: #e3e9e5;
}

.meter-track span {
  display: block;
  width: 0%;
  height: 100%;
  background: var(--accent-pine);
  transition: width 220ms ease-in-out;
}

.cart-items {
  display: grid;
  gap: var(--space-2);
  max-height: 420px;
  overflow: auto;
  padding-right: var(--space-1);
}

.cart-items.empty {
  padding: var(--space-4);
  border: 1px dashed var(--border-default);
  border-radius: 8px;
  color: var(--text-secondary);
}

.cart-item {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  gap: var(--space-3);
  align-items: center;
  padding: var(--space-2);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
}

.cart-item img {
  width: 56px;
  height: 44px;
  object-fit: cover;
  border-radius: 6px;
}

.cart-item strong,
.cart-item span {
  display: block;
  overflow-wrap: anywhere;
}

.cart-item strong {
  font-size: 13px;
}

.cart-item span {
  font-size: 12px;
}

.primary-button {
  min-height: 46px;
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #ffffff;
  font-weight: 700;
}

.primary-button:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.page-footer {
  width: min(1440px, calc(100% - 32px));
  margin: 0 auto;
  padding: var(--space-6) 0 var(--space-10);
  border-top: 1px solid var(--border-subtle);
  font-size: 13px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: var(--space-6);
  z-index: 40;
  transform: translate(-50%, 16px);
  opacity: 0;
  pointer-events: none;
  min-height: 42px;
  max-width: min(520px, calc(100% - 32px));
  display: flex;
  align-items: center;
  padding: 0 var(--space-4);
  border-radius: 8px;
  background: #171717;
  color: #ffffff;
  box-shadow: var(--shadow-raised);
  transition: opacity 180ms ease-out, transform 180ms ease-out;
}

.toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.hidden {
  display: none;
}

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

@media (max-width: 1180px) {
  .header-inner,
  .content-layout {
    grid-template-columns: 1fr;
  }

  .compare-sticky {
    position: static;
  }

  .compare-panel {
    order: -1;
  }
}

@media (max-width: 820px) {
  .header-inner {
    width: min(100% - 24px, 1440px);
    padding: var(--space-5) 0 var(--space-5);
  }

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

  .summary-card {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .summary-card div {
    padding: var(--space-2);
  }

  .summary-card strong {
    font-size: 14px;
  }

  .lead {
    font-size: 15px;
  }

  .toolbar {
    position: static;
    gap: var(--space-3);
    padding-top: var(--space-3);
  }

  .app-shell,
  .page-footer {
    width: min(100% - 24px, 1440px);
  }

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

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

}

@media (max-width: 520px) {
  .summary-card {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .summary-card span {
    font-size: 11px;
  }

  .summary-card strong {
    font-size: 13px;
  }

  .notice-grid {
    display: none;
  }

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

  .price {
    text-align: left;
  }

  .cart-item {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .cart-item .remove-button {
    grid-column: 1 / -1;
  }
}
