:root {
  /* 항공편수·출국객수 대시보드와 동일 팔레트(네이비/슬레이트) */
  --navy-900: #0B2E5C;
  --navy-700: #13407F;
  --blue-500: #1F6FEB;
  --blue-025: #F4F7FB;
  --slate-700: #334155;
  --slate-500: #64748B;
  --slate-400: #94A3B8;
  --slate-200: #CBD5E1;
  --slate-100: #E5EAF0;
  --line: #E5EAF0;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Pretendard",
               "Noto Sans KR", "Apple SD Gothic Neo", sans-serif;
  color: #111827;
  background: #fff;
  line-height: 1.55;
  letter-spacing: -0.011em;
}

/* ---------- header ---------- */
.hero {
  background: #fff;
  padding: 44px 24px 10px;
  text-align: center;
}
.hero-inner { max-width: 1120px; margin: 0 auto; }
.eyebrow {
  letter-spacing: .22em;
  font-weight: 700;
  font-size: .7rem;
  color: var(--slate-400);
  margin: 0 0 12px;
}
.hero h1 {
  font-weight: 800;
  font-size: clamp(1.8rem, 4.5vw, 2.6rem);
  line-height: 1.15;
  margin: 0;
  letter-spacing: -.025em;
  color: var(--navy-900);
}
.hero h1 span { color: var(--blue-500); }

/* ---------- 일괄 입력 카드 ---------- */
main { max-width: 1120px; margin: 0 auto; padding: 18px 20px 20px; }

.batch-card {
  display: grid;
  gap: 16px;
  background: #fff;
  border: 1px solid var(--slate-100);
  border-radius: 14px;
  padding: 22px;
  box-shadow: 0 14px 36px -28px rgba(11, 46, 92, .35);
}
.batch-card[hidden] { display: none; }
.batch-card textarea {
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: .92rem;
  line-height: 1.6;
  width: 100%;
  resize: vertical;
  padding: 13px 14px;
  border: 1.5px solid var(--slate-200);
  border-radius: 10px;
  background: #fff;
  white-space: pre;
  overflow-wrap: normal;
  overflow-x: auto;
  transition: border-color .15s, box-shadow .15s;
}
.batch-card textarea:focus {
  outline: none;
  border-color: var(--blue-500);
  box-shadow: 0 0 0 3px rgba(31, 111, 235, .15);
}
#batch-btn {
  position: relative;
  justify-self: start;
  font-weight: 700;
  font-size: .95rem;
  color: #fff;
  background: var(--navy-900);
  border: none;
  border-radius: 8px;
  padding: 12px 26px;
  cursor: pointer;
  letter-spacing: -.01em;
  transition: background .15s, opacity .2s;
}
#batch-btn:hover { background: var(--navy-700); }
#batch-btn[disabled] { opacity: .65; cursor: progress; }

/* 전체 비교 버튼 + 진행 표시 (버튼 옆) */
.batch-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.batch-progress {
  color: var(--navy-900);
  font-size: .9rem;
  font-weight: 700;
}
.batch-progress[hidden] { display: none; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field label {
  font-size: .8rem;
  font-weight: 700;
  color: var(--slate-700);
}
.spinner {
  display: none;
  position: absolute;
  inset: 0;
  margin: auto;
  width: 18px; height: 18px;
  border: 2.5px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
body.loading .spinner { display: block; }
body.loading .btn-label { visibility: hidden; }
@keyframes spin { to { transform: rotate(360deg); } }

.hint { color: var(--slate-500); font-size: .85rem; margin: 16px 4px 0; }

/* ---------- results ---------- */
/* 상품명 줄바꿈 방지로 표가 넓어질 수 있어, 결과 영역은 본문(1120px)보다
   좌우로 확장해 스크롤 없이 한눈에 보이도록 한다(화면이 좁으면 가로 스크롤). */
.results {
  margin-top: 30px;
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  width: min(94vw, 1180px);
}

.results-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 10px;
}
#csv-btn {
  font-family: inherit;
  font-weight: 700;
  font-size: .85rem;
  color: var(--navy-900);
  background: #fff;
  border: 1.5px solid var(--slate-200);
  border-radius: 8px;
  padding: 8px 16px;
  cursor: pointer;
  transition: background .15s, border-color .15s, opacity .15s;
}
#csv-btn:hover:not([disabled]) { background: var(--blue-025); border-color: var(--blue-500); }
#csv-btn[disabled] { opacity: .5; cursor: default; }

.table-wrap {
  border: 1px solid var(--slate-100);
  border-radius: 12px;
  overflow-x: auto;
  background: #fff;
}
table { width: 100%; border-collapse: collapse; }
th, td { padding: 14px 16px; text-align: left; font-size: .95rem; }
thead th {
  background: var(--blue-025);
  color: var(--navy-900);
  font-weight: 700;
  font-size: .82rem;
  letter-spacing: -.01em;
  border-bottom: 1px solid var(--slate-100);
  white-space: nowrap;
}
tbody tr { border-bottom: 1px solid var(--slate-100); }
tbody tr:last-child { border-bottom: none; }

/* 상품별 비교 표 (공기관 제출용 심플 양식) */
/* 상품명·브랜드명은 줄바꿈 없이 한 줄(필요 시 표가 가로 스크롤) */
.compare-table td[data-label="상품명"] { font-weight: 700; white-space: nowrap; color: var(--navy-900); }
.compare-table td[data-label="브랜드명"] { color: var(--slate-500); white-space: nowrap; }

.rate {
  font-weight: 700;
  font-size: 1.02rem;
  color: var(--navy-900);
}

/* 가격확인 링크 */
.link-cell { white-space: nowrap; }
.shop-link {
  font-weight: 600;
  font-size: .9rem;
  color: var(--blue-500);
  text-decoration: none;
  border-bottom: 1.5px solid transparent;
  margin-right: 12px;
  white-space: nowrap;
}
.shop-link:last-child { margin-right: 0; }
.shop-link:hover { border-bottom-color: currentColor; }

.na { color: var(--slate-400); }

.note { color: var(--slate-500); font-size: .82rem; margin: 14px 4px 0; }

/* ---------- footer (항공편수·출국객수 페이지와 동일 footnote 구조) ---------- */
footer.footnote {
  max-width: 1120px;
  margin: 48px auto 0;
  padding: 16px 20px 44px;
  border-top: 1px solid var(--slate-100);
  font-size: 12px;
  color: var(--slate-500);
  line-height: 1.7;
  letter-spacing: -0.005em;
}
footer.footnote .footnote-block + .footnote-block { margin-top: 16px; }
footer.footnote .footnote-title {
  font-weight: 600;
  color: var(--slate-700);
  font-size: 12px;
  margin-bottom: 6px;
}
footer.footnote ul { margin: 0; padding-left: 16px; }
footer.footnote li { margin-bottom: 2px; }
footer.footnote b { color: var(--slate-700); font-weight: 600; }
footer.footnote .credit {
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid var(--slate-100);
  color: var(--slate-400);
  font-size: 11px;
  text-align: center;
  letter-spacing: 0.02em;
}

@media (max-width: 720px) {
  #batch-btn { width: 100%; justify-self: stretch; padding: 14px; }
  thead { display: none; }
  table, tbody, tr, td { display: block; width: 100%; }
  tbody tr { padding: 14px 16px; }
  td { padding: 6px 0; border: none; display: flex; justify-content: space-between; gap: 14px; }
  td::before {
    content: attr(data-label);
    font-weight: 700;
    color: var(--navy-900);
    font-size: .82rem;
  }
  /* 카드형 레이아웃에서는 상품명·브랜드명 다시 줄바꿈 허용 */
  .compare-table td[data-label="상품명"],
  .compare-table td[data-label="브랜드명"] { white-space: normal; }
}
