:root {
  color-scheme: light;
  --bg: #f5f4ef;
  --surface: #fff;
  --text: #292c27;
  --muted: #74796f;
  --line: #e5e6df;
  --accent: #315c48;
  --accent-hover: #244936;
  --soft: #eef3ee;
  --danger: #a33838;
  --shadow: 0 8px 30px rgb(41 44 39 / 5%);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  line-height: 1.6;
}
button, input, select { font: inherit; }
.topbar {
  height: 64px;
  padding: 0 max(22px, calc((100vw - 920px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: rgb(255 255 255 / 80%);
}
.brand { font-weight: 750; text-decoration: none; letter-spacing: -.04em; }
.menu-link { color: var(--muted); text-decoration: none; font-size: .9rem; }
.menu-link:hover { color: var(--accent); }
main { max-width: 760px; padding: 46px 20px 60px; margin: 0 auto; }
.intro { margin: 0 0 30px; }
.eyebrow { margin: 0 0 10px; color: var(--accent); font-size: .73rem; font-weight: 750; letter-spacing: .13em; }
h1 { margin: 0; font-size: clamp(2.1rem, 7vw, 3.2rem); letter-spacing: -.07em; line-height: 1.2; }
.intro-copy { max-width: 510px; margin: 15px 0 0; color: var(--muted); }
.panel { margin: 16px 0; padding: 26px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); }
.section-heading { display: flex; gap: 14px; align-items: flex-start; margin: 0 0 22px; }
.step { color: var(--accent); font-size: .82rem; font-weight: 800; letter-spacing: .06em; }
h2 { margin: 0; font-size: 1.15rem; letter-spacing: -.035em; }
.section-heading p { margin: 4px 0 0; color: var(--muted); font-size: .88rem; }
.form-row { display: grid; grid-template-columns: 100px 1fr; gap: 14px; align-items: center; margin-top: 14px; }
.form-row[hidden] { display: none; }
label { font-size: .92rem; font-weight: 650; }
input, select { width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--text); }
input:focus, select:focus { outline: 3px solid rgb(49 92 72 / 15%); border-color: var(--accent); }
.required { color: var(--danger); }
.search-label { display: block; margin-bottom: 8px; }
.search-box { display: flex; gap: 9px; }
.search-box input { min-width: 0; flex: 1; }
.btn { min-height: 44px; padding: 9px 16px; border: 1px solid transparent; border-radius: 9px; cursor: pointer; font-weight: 700; }
.btn.primary { color: #fff; background: var(--accent); }
.btn.primary:hover { background: var(--accent-hover); }
.btn:disabled { cursor: not-allowed; opacity: .65; }
.btn.ghost { margin-top: 10px; border-color: var(--line); background: #fff; color: var(--text); }
.hint, .privacy-note { color: var(--muted); font-size: .82rem; }
.hint { margin: 7px 0; }
.status { margin: 10px 0 0; font-size: .9rem; }
.status:empty { display: none; }
.status.error { color: var(--danger); }
.status.success { color: var(--accent); font-weight: 650; }
.results { display: grid; gap: 9px; margin-top: 14px; }
.result-card { display: grid; grid-template-columns: 58px 1fr auto; gap: 13px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.result-card:hover { border-color: #aab9ae; }
.cover { display: block; width: 58px; height: 78px; border-radius: 5px; object-fit: cover; background: var(--soft); }
.cover-placeholder { display: grid; place-items: center; color: var(--accent); font-size: .75rem; font-weight: 700; }
.book-title { margin: 0; font-weight: 750; line-height: 1.4; }
.book-meta { margin: 4px 0 0; color: var(--muted); font-size: .82rem; }
.book-description { display: -webkit-box; overflow: hidden; margin: 5px 0 0; color: var(--muted); font-size: .78rem; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.select-book { min-height: 38px; padding: 6px 11px; border: 1px solid var(--accent); border-radius: 8px; background: #fff; color: var(--accent); cursor: pointer; font-size: .84rem; font-weight: 700; white-space: nowrap; }
.select-book:hover { background: var(--soft); }
.selected-panel { margin-top: 16px; padding: 16px; border-radius: 12px; background: var(--soft); }
.cart-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.cart-heading h3 { margin: 0; font-size: .98rem; }
.cart-heading h3 span { margin-left: 5px; color: var(--accent); font-size: .82rem; }
.cart-status { margin: 0; color: var(--muted); font-size: .8rem; }
.selected-books { display: grid; grid-template-columns: repeat(auto-fill, minmax(122px, 1fr)); gap: 10px; }
.cart-book { min-width: 0; padding: 10px; border: 1px solid #d9e1d9; border-radius: 10px; background: #fff; }
.cart-book .cover { width: 68px; height: 92px; margin: 0 auto 8px; }
.cart-book .book-title { overflow: hidden; display: -webkit-box; min-height: 2.8em; font-size: .82rem; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.cart-book .book-meta { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .72rem; }
.cart-holding { min-height: 2.5em; margin: 7px 0; color: var(--accent); font-size: .7rem; line-height: 1.35; }
.cart-holding.error { color: var(--danger); }
.remove-book { width: 100%; min-height: 32px; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: var(--muted); cursor: pointer; font-size: .78rem; }
.remove-book:hover { border-color: var(--danger); color: var(--danger); }
.select-book:disabled { cursor: default; opacity: .65; }
.settings-panel { padding: 18px 22px; }
.settings-panel summary { cursor: pointer; font-weight: 700; }
.settings-panel label { display: block; margin-top: 12px; }
.submit-area { margin-top: 22px; text-align: center; }
.submit-button { width: min(100%, 360px); min-height: 52px; font-size: 1rem; }
.privacy-note { margin: 12px 0 0; }
footer { padding: 38px 0 0; color: var(--muted); text-align: center; font-size: .8rem; }

@media (max-width: 560px) {
  .topbar { height: 58px; padding: 0 16px; }
  main { padding: 34px 14px 44px; }
  .panel { padding: 20px 16px; border-radius: 13px; }
  .form-row { grid-template-columns: 1fr; gap: 6px; }
  .result-card { grid-template-columns: 48px 1fr; gap: 10px; }
  .cover { width: 48px; height: 66px; }
  .select-book { grid-column: 2; justify-self: start; }
  .book-description { display: none; }
  .cart-heading { display: block; }
  .cart-status { margin-top: 3px; }
  .selected-books { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
