:root {
  --bg: #f6f7f9;
  --card: #ffffff;
  --text: #1b1d21;
  --muted: #6b7079;
  --line: #e3e5e9;
  --accent: #2f5bea;
  --accent-ink: #ffffff;
  --danger: #c93636;
  --ok: #1f8a4c;
  --radius: 12px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121316;
    --card: #1c1e22;
    --text: #eceef2;
    --muted: #9aa0aa;
    --line: #2c2f35;
    --accent: #6d8cff;
    --accent-ink: #0d0f14;
    --danger: #ff7a7a;
    --ok: #5fd08f;
  }
}

* { box-sizing: border-box; }
/* .step 의 display:flex 가 hidden 속성을 이기지 않게 */
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Malgun Gothic', 'Noto Sans KR', sans-serif;
  -webkit-text-size-adjust: 100%;
}

.top {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
}
.top h1 { flex: 1; margin: 0; font-size: 18px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.back { border: 0; background: none; color: var(--text); font-size: 28px; line-height: 1; padding: 0 6px 2px 0; cursor: pointer; }
.link { border: 0; background: none; color: var(--accent); font-size: 14px; cursor: pointer; padding: 4px; }

main { max-width: 520px; margin: 0 auto; padding: 16px; }
.step, .step form { display: flex; flex-direction: column; gap: 14px; }
.lead { margin: 4px 0 0; font-size: 17px; font-weight: 600; }
.muted { color: var(--muted); margin: 0; }
.small { font-size: 14px; }

.field { display: flex; flex-direction: column; gap: 6px; border: 0; margin: 0; padding: 0; min-width: 0; }
.field > span, .field legend { font-size: 14px; color: var(--muted); padding: 0; }
input[type='text'], input[type='search'], input[type='tel'], input[type='date'] {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  font-size: 16px;
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  -webkit-appearance: none;
  appearance: none;
}
input:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }

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

button.primary {
  min-height: 52px;
  border: 0;
  border-radius: 12px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
}
button.primary:disabled { opacity: 0.5; cursor: default; }
a.button-link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  margin-top: 12px;
  border-radius: 12px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  text-decoration: none;
}

.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.item {
  display: flex;
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 12px;
  text-align: left;
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  font: inherit;
}
.item:disabled { cursor: default; opacity: 0.55; }
.item img, .item .ph { width: 72px; height: 72px; flex: none; border-radius: 8px; object-fit: cover; background: var(--line); }
.item .body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.item .name { font-weight: 700; }
.item .sub { font-size: 14px; color: var(--muted); overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.item .price { font-weight: 700; font-size: 17px; }
.item .tag { font-size: 13px; color: var(--danger); font-weight: 600; }

.hotel-card, .summary, .result {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.hotel-card .name, .summary .name { font-size: 18px; font-weight: 700; }
.row { display: flex; justify-content: space-between; gap: 12px; }
.row span:first-child { color: var(--muted); }
.total { font-size: 19px; font-weight: 800; }
.notice { margin: 0; font-size: 14px; color: var(--danger); font-weight: 600; }

.methods { display: flex; flex-direction: row; flex-wrap: wrap; gap: 8px; }
.methods legend { margin-bottom: 6px; }
.methods label {
  /* 글자를 쪼개지 않고, 좁은 휴대폰에서는 버튼째로 다음 줄로 넘긴다 */
  flex: 1 1 96px;
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 48px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  cursor: pointer;
  font-size: 14px;
}
.methods input { accent-color: var(--accent); }

.agree { display: flex; flex-direction: column; gap: 6px; font-size: 15px; }
.agree label { display: flex; gap: 8px; align-items: flex-start; }
.agree input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--accent); flex: none; }
.agree details { margin: 0 0 6px 28px; font-size: 13px; color: var(--muted); }
.agree pre, .foot pre { white-space: pre-wrap; word-break: keep-all; overflow-wrap: anywhere; font: inherit; margin: 6px 0 0; }

.error { margin: 0; color: var(--danger); font-size: 15px; font-weight: 600; }

.result .state { font-size: 20px; font-weight: 800; }
.result .state.ok { color: var(--ok); }
.result .state.bad { color: var(--danger); }
.result .code { font-size: 22px; font-weight: 800; letter-spacing: 1px; }
.spinner {
  width: 28px; height: 28px; border-radius: 50%;
  border: 3px solid var(--line); border-top-color: var(--accent);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.foot { max-width: 520px; margin: 24px auto 0; padding: 16px 16px 40px; color: var(--muted); font-size: 12px; border-top: 1px solid var(--line); }
.foot:empty, .foot pre:empty { display: none; }
