:root {
  /* ---------- Toss 팔레트: 화이트/쿨그레이 + 단일 블루 강조 ---------- */
  --blue-500: oklch(0.624 0.176 254);
  --blue-600: oklch(0.522 0.176 257);
  --blue-700: oklch(0.476 0.174 259);
  --blue-50: oklch(0.965 0.020 250);

  --grey-900: oklch(0.234 0.030 254);
  --grey-800: oklch(0.342 0.030 253);
  --grey-700: oklch(0.452 0.028 253);
  --grey-600: oklch(0.555 0.022 253);
  --grey-500: oklch(0.652 0.020 252);
  --grey-400: oklch(0.752 0.016 251);
  --grey-300: oklch(0.840 0.012 248);
  --grey-200: oklch(0.913 0.008 247);
  --grey-150: oklch(0.918 0.007 247);
  --grey-100: oklch(0.957 0.005 247);
  --grey-50: oklch(0.978 0.003 247);
  --white: oklch(1.000 0.000 0);

  --yellow-500: oklch(0.853 0.156 86);
  --orange-500: oklch(0.748 0.183 56);
  --red-500: oklch(0.628 0.218 22);
  --green-500: oklch(0.493 0.143 154);
  --navy-900: oklch(0.155 0.060 261);

  /* ---------- Semantic alias ---------- */
  --accent: var(--blue-500);
  --accent-hover: var(--blue-600);
  --accent-press: var(--blue-700);
  --accent-ink: var(--white);
  --accent-weak: var(--blue-50);
  --accent-border: var(--blue-500);
  --accent-ring: oklch(0.624 0.176 254 / 0.20);

  --success-green: var(--green-500);
  --success-green-ink: var(--white);
  --danger: var(--red-500);

  --bg-page: var(--white);
  --surface: var(--white);
  --sidebar-bg: var(--white);
  --fill-app: var(--white);
  --white-surface: var(--white);

  --text-primary: var(--grey-900);
  --text-secondary: var(--grey-700);
  --text-tertiary: var(--grey-600);
  --text-placeholder: var(--grey-400);
  --fill-secondary: var(--grey-100);
  --fill-weak: var(--grey-50);
  --line-default: var(--grey-200);
  --line-strong: var(--grey-400);
  --line-hairline: var(--grey-200);
  --overlay-scrim: oklch(0.000 0.000 0 / 0.56);
  --press-overlay: oklch(0.000 0.000 0 / 0.10);

  /* ---------- Radius (Toss: 공격적으로 둥글지만 귀엽지 않게) ---------- */
  --radius-xs: 4px;
  --radius-s: 8px;
  --radius-m: 12px;
  --radius-l: 14px;
  --radius-xl: 16px;
  --radius-2xl: 20px;
  --radius-3xl: 24px;
  --radius-4xl: 32px;
  --radius-full: 999px;

  /* ---------- Spacing ---------- */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;

  /* ---------- Shadow (navy-900 베이스 저알파 — 평면 위에 뜬 표면에만) ---------- */
  --shadow-1: 0 1px 2px oklch(0.155 0.060 261 / 0.05), 0 1px 1px oklch(0.155 0.060 261 / 0.04);
  --shadow-2: 0 4px 14px oklch(0.155 0.060 261 / 0.08), 0 1px 2px oklch(0.155 0.060 261 / 0.05);
  --shadow-3: 0 20px 44px oklch(0.155 0.060 261 / 0.14), 0 4px 10px oklch(0.155 0.060 261 / 0.07);
  --shadow-brand: 0 16px 32px oklch(0.624 0.176 254 / 0.24), 0 3px 8px oklch(0.624 0.176 254 / 0.14);

  /* ---------- Motion ---------- */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast: 120ms;
  --dur-base: 200ms;
  --dur-slow: 320ms;

  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg-page);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 15px;
  letter-spacing: -0.005em;
}

.hidden { display: none !important; }

::selection { background: var(--accent-weak); color: var(--accent-press); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--grey-300); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--grey-400); }

button {
  cursor: pointer;
  font-family: inherit;
}
button:disabled { cursor: not-allowed; }

input, textarea {
  font-family: inherit;
}

svg { display: block; flex-shrink: 0; }

/* ---------- 공용 버튼 (살짝 입체감 — 상단 하이라이트 + 눌림 그림자) ---------- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: linear-gradient(180deg, var(--blue-500) 0%, var(--accent-hover) 100%);
  color: var(--accent-ink);
  border: none;
  border-radius: var(--radius-l);
  padding: 15px 26px;
  font-size: 16px;
  font-weight: 700;
  box-shadow: 0 1px 0 oklch(1 0 0 / 0.25) inset, 0 8px 18px oklch(0.624 0.176 254 / 0.28);
  transition: box-shadow var(--dur-base) var(--ease), transform var(--dur-fast) var(--ease), filter var(--dur-base) var(--ease);
}
.btn-primary:hover { filter: brightness(1.04); box-shadow: 0 1px 0 oklch(1 0 0 / 0.25) inset, 0 12px 24px oklch(0.624 0.176 254 / 0.34); }
.btn-primary:active { transform: scale(0.97); box-shadow: 0 1px 0 oklch(1 0 0 / 0.15) inset, 0 4px 10px oklch(0.624 0.176 254 / 0.24); }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: var(--fill-secondary);
  color: var(--text-secondary);
  border: none;
  border-radius: var(--radius-l);
  padding: 15px 26px;
  font-size: 16px;
  font-weight: 600;
  transition: background var(--dur-base) var(--ease), color var(--dur-base) var(--ease);
}
.btn-ghost:hover { color: var(--text-primary); background: var(--grey-150); }

/* ---------- 오버레이 / 온보딩 ---------- */
.overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay-scrim);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 24px;
}
.overlay.animated {
  opacity: 0;
  transition: opacity 240ms var(--ease-out);
}
.overlay.animated.open { opacity: 1; }
.overlay.animated .modal-card {
  translate: 0 16px;
  scale: 0.97;
  transition: translate 320ms var(--ease-out), scale 320ms var(--ease-out);
}
.overlay.animated.open .modal-card {
  translate: 0 0;
  scale: 1;
}

.onboarding-card,
.modal-card {
  background: var(--white);
  color: var(--text-primary);
}

.onboarding-card {
  border-radius: var(--radius-3xl);
  padding: 40px;
  max-width: 800px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-3);
}
.onboarding-card h1 { margin: 0 0 10px; font-size: 28px; font-weight: 700; letter-spacing: -0.02em; color: var(--text-primary); }
.onboarding-card .sub { color: var(--text-secondary); margin: 0 0 18px; font-size: 15px; line-height: 1.55; }
.onboarding-search-row { display: flex; gap: 10px; margin-bottom: 14px; }
.onboarding-search-row input {
  flex: 1;
  background: var(--fill-secondary);
  border: 1.5px solid transparent;
  border-radius: var(--radius-m);
  padding: 12px 14px;
  color: var(--text-primary);
  font-size: 14px;
  transition: background var(--dur-base) var(--ease), border-color var(--dur-base) var(--ease), box-shadow var(--dur-base) var(--ease);
}
.onboarding-search-row input::placeholder { color: var(--text-placeholder); }
.onboarding-search-row input:focus {
  outline: none;
  background: var(--white);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-ring);
}
.onboarding-search-row .btn-ghost { padding: 12px 18px; font-size: 14px; }
.onboarding-count { color: var(--accent); font-weight: 700; margin-bottom: 14px; font-size: 14px; }

.onboarding-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 14px;
  margin-bottom: 26px;
}
.onboarding-book {
  border: 1px solid var(--line-hairline);
  border-radius: var(--radius-m);
  padding: 7px;
  text-align: center;
  opacity: 0;
  translate: 0 10px;
  scale: 1;
  transition: opacity 420ms var(--ease-out) var(--delay, 0ms), translate 420ms var(--ease-out) var(--delay, 0ms), border-color var(--dur-base) var(--ease-out), background var(--dur-base) var(--ease-out), scale var(--dur-fast) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
}
.onboarding-book.in { opacity: 1; translate: 0 0; }
.onboarding-book:active { scale: 0.97; }
.onboarding-book:hover { background: var(--accent-weak); border-color: var(--accent); box-shadow: var(--shadow-2); }
.onboarding-book.selected { border-color: var(--accent); background: var(--accent-weak); box-shadow: var(--shadow-1); }
.onboarding-book .cover-thumb { width: 100%; height: 108px; border-radius: var(--radius-s); margin-bottom: 8px; }
.onboarding-book .title-mini { font-size: 13px; line-height: 1.4; color: var(--text-secondary); }

.onboarding-actions { display: flex; justify-content: flex-end; gap: 12px; }

/* ---------- 로그인 / 회원가입 ---------- */
.auth-card { max-width: 400px; position: relative; }
.auth-form { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }
.auth-form input {
  background: var(--fill-secondary);
  border: 1.5px solid transparent;
  border-radius: var(--radius-m);
  padding: 15px 16px;
  color: var(--text-primary);
  font-size: 15px;
  transition: background var(--dur-base) var(--ease), border-color var(--dur-base) var(--ease), box-shadow var(--dur-base) var(--ease);
}
.auth-form input::placeholder { color: var(--text-placeholder); }
.auth-form input:focus {
  outline: none;
  background: var(--white);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-ring);
}
.auth-form .btn-primary { margin-top: 6px; padding: 15px; }
.auth-error { color: var(--danger); font-size: 13px; line-height: 1.5; }
.auth-toggle {
  display: block;
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  font-size: 13px;
  text-align: center;
  margin-top: 16px;
  padding: 6px;
}
.auth-toggle:hover { color: var(--accent); }

/* ---------- 내 취향 - 계정 관리 ---------- */
.account-box { display: flex; flex-direction: column; gap: 24px; max-width: 360px; }
.account-form { margin-top: 0; }
.account-form-label { font-size: 14px; font-weight: 700; color: var(--text-primary); margin-bottom: 4px; }
.account-form .btn-ghost, .account-danger .btn-ghost { align-self: flex-start; margin-top: 4px; }
.account-danger { display: flex; flex-direction: column; gap: 10px; padding-top: 20px; border-top: 1px solid var(--line-hairline); }
.account-danger-desc { margin: 0; font-size: 13px; line-height: 1.5; color: var(--text-tertiary); }
.account-danger input {
  background: var(--fill-secondary);
  border: 1.5px solid transparent;
  border-radius: var(--radius-m);
  padding: 13px 15px;
  color: var(--text-primary);
  font-size: 14px;
}
.account-danger input:focus { outline: none; background: var(--white); border-color: var(--danger); box-shadow: 0 0 0 4px oklch(0.628 0.218 22 / 0.15); }
.account-danger-btn { color: var(--danger); }
.account-danger-btn:hover { background: oklch(0.628 0.218 22 / 0.10); color: var(--danger); }

/* ---------- 앱 레이아웃 ---------- */
.app {
  display: flex;
  height: 100vh;
}

/* 좌측 사이드바: 플랫 화이트 + 얇은 헤어라인 구분, hover 시 살짝 뜨는 그림자로 층 분리 */
.sidebar {
  width: 76px;
  min-width: 76px;
  background: var(--white);
  padding: 24px 14px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line-hairline);
  overflow: hidden;
  transition: width 380ms var(--ease-out), min-width 380ms var(--ease-out), box-shadow 380ms var(--ease-out);
  position: relative;
  z-index: 20;
}
.sidebar:hover,
.sidebar:focus-within {
  width: 286px;
  min-width: 286px;
  box-shadow: var(--shadow-3);
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.01em;
  padding: 0 10px 22px;
  color: var(--text-primary);
  white-space: nowrap;
  background: none;
  border: none;
  font-family: inherit;
  text-align: left;
  transition: opacity var(--dur-base) var(--ease);
}
.logo:hover { opacity: 0.75; }
.logo:active { opacity: 0.6; }
.logo-label {
  opacity: 0;
  transition: opacity 200ms var(--ease-out);
}
.sidebar:hover .logo-label,
.sidebar:focus-within .logo-label {
  opacity: 1;
  transition-delay: 130ms;
}
.logo-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  background: linear-gradient(180deg, var(--blue-500) 0%, var(--accent-hover) 100%);
  color: var(--accent-ink);
  border-radius: var(--radius-m);
  box-shadow: 0 4px 10px oklch(0.624 0.176 254 / 0.30);
}
.nav { display: flex; flex-direction: column; gap: 4px; background: var(--grey-100); border-radius: var(--radius-l); padding: 4px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  background: transparent;
  border: none;
  border-radius: var(--radius-m);
  color: var(--text-tertiary);
  text-align: left;
  padding: 12px 12px;
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  transition: background var(--dur-base) var(--ease-out), color var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
}
.nav-item svg { color: var(--text-tertiary); transition: color var(--dur-base) var(--ease-out); }
.nav-item:hover { color: var(--text-primary); }
/* segmented-control 패턴: active 탭만 흰 배경으로 떠오름 */
.nav-item.active { color: var(--text-primary); background: var(--white); box-shadow: var(--shadow-1); }
.nav-item.active svg { color: var(--accent); }
.nav-label {
  opacity: 0;
  transition: opacity 200ms var(--ease-out);
}
.sidebar:hover .nav-label,
.sidebar:focus-within .nav-label {
  opacity: 1;
  transition-delay: 130ms;
}

.sidebar-divider { height: 1px; background: var(--line-hairline); margin: 18px 0; }
.sidebar-divider,
.sidebar-lists-header,
.sidebar-lists {
  opacity: 0;
  transition: opacity 180ms var(--ease-out);
}
.sidebar:hover .sidebar-divider,
.sidebar:hover .sidebar-lists-header,
.sidebar:hover .sidebar-lists,
.sidebar:focus-within .sidebar-divider,
.sidebar:focus-within .sidebar-lists-header,
.sidebar:focus-within .sidebar-lists {
  opacity: 1;
  transition-delay: 150ms;
}
.sidebar-lists-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 10px 10px;
  color: var(--text-tertiary);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}
.sidebar-lists-header button {
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--accent);
  width: 26px;
  height: 26px;
  border-radius: var(--radius-s);
  flex-shrink: 0;
}
.sidebar-lists-header button:hover { background: var(--accent-weak); }
.sidebar-lists { flex: 1; overflow-y: auto; overflow-x: hidden; display: flex; flex-direction: column; gap: 2px; }
.sidebar-list-item {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  text-align: left;
  padding: 10px;
  border-radius: var(--radius-m);
  font-size: 14px;
  white-space: nowrap;
}
.sidebar-list-item:hover { color: var(--text-primary); background: var(--fill-weak); }

.book-count { font-size: 12px; }

.sidebar-lists-hint {
  font-size: 11px;
  color: var(--text-tertiary);
  padding: 6px 10px 0;
  line-height: 1.4;
}

.main {
  flex: 1;
  overflow-y: auto;
  padding: 36px 44px;
  background: var(--grey-50);
}

/* ---------- 뷰 전환 크로스페이드 ---------- */
.view {
  opacity: 1;
  translate: 0 0;
  transition: opacity 200ms var(--ease-out), translate 200ms var(--ease-out);
}
.view.fade-out { opacity: 0; translate: 0 6px; }

.view-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.view-header h2 { margin: 0; font-size: 24px; font-weight: 700; letter-spacing: -0.02em; color: var(--text-primary); }

/* ---------- 검색 / 새로움 / 테마 ---------- */
.search-row { display: flex; gap: 12px; margin-bottom: 36px; }
.search-row input {
  flex: 1;
  background: var(--fill-secondary);
  border: 1.5px solid transparent;
  border-radius: var(--radius-m);
  padding: 15px 20px;
  color: var(--text-primary);
  font-size: 16px;
  transition: background var(--dur-base) var(--ease), border-color var(--dur-base) var(--ease), box-shadow var(--dur-base) var(--ease);
}
.search-row input::placeholder { color: var(--text-placeholder); }
.search-row input:focus {
  outline: none;
  background: var(--white);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-ring);
}

.section-block { margin-bottom: 36px; }
.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 14px;
}
.section-title::before { content: ""; width: 6px; height: 6px; border-radius: var(--radius-full); background: var(--accent); flex-shrink: 0; }

.section-title-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-title-row .section-title { margin-bottom: 0; }
.refreshed-at { font-size: 12px; color: var(--text-placeholder); white-space: nowrap; }

.novelty-cards { display: flex; gap: 14px; flex-wrap: wrap; }
.novelty-card {
  flex: 1;
  min-width: 190px;
  background: var(--white);
  border: 1px solid var(--line-hairline);
  border-radius: var(--radius-xl);
  padding: 20px;
  text-align: left;
  box-shadow: var(--shadow-1);
  transition: border-color var(--dur-base) var(--ease-out), background var(--dur-base) var(--ease-out), transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
}
.novelty-card .n-title { font-weight: 700; margin-bottom: 6px; font-size: 17px; color: var(--text-primary); transition: color var(--dur-base) var(--ease-out); }
.novelty-card .n-desc { color: var(--text-tertiary); font-size: 13px; line-height: 1.5; transition: color var(--dur-base) var(--ease-out); }
.novelty-card:hover { border-color: var(--accent); transform: translateY(-3px); box-shadow: var(--shadow-2); }
.novelty-card.selected { border-color: var(--accent); background: linear-gradient(180deg, var(--blue-500) 0%, var(--accent-hover) 100%); box-shadow: var(--shadow-brand); }
.novelty-card.selected .n-title { color: var(--accent-ink); }
.novelty-card.selected .n-desc { color: var(--accent-ink); opacity: 0.8; }
.novelty-card:active { transform: scale(0.98); }

.theme-chips { display: flex; gap: 10px; flex-wrap: wrap; }
.theme-chip {
  background: var(--white);
  border: 1px solid var(--line-hairline);
  color: var(--text-secondary);
  border-radius: var(--radius-full);
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  transition: border-color var(--dur-base) var(--ease-out), background var(--dur-base) var(--ease-out), color var(--dur-base) var(--ease-out), transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
}
.theme-chip:hover { border-color: var(--accent); background: var(--accent-weak); }
.theme-chip.selected { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: 0 6px 14px oklch(0.624 0.176 254 / 0.28); }
.theme-chip:active { transform: scale(0.96); }

/* ---------- 책 그리드 / 카드 (서가에서 살짝 떠오르는 3D 인터랙션) ---------- */
.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 22px;
  perspective: 1400px;
}
.load-more-btn { display: block; margin: 18px auto 0; }
.book-card {
  background: var(--white);
  border: 1px solid var(--line-hairline);
  border-radius: var(--radius-xl);
  padding: 14px;
  text-align: left;
  width: 100%;
  transform-style: preserve-3d;
  opacity: 0;
  translate: 0 14px;
  scale: 1;
  rotate: 0deg;
  box-shadow: var(--shadow-1);
  filter: brightness(1);
  transition: opacity 460ms var(--ease-out) var(--delay, 0ms), translate 320ms var(--ease-out), scale 320ms var(--ease-out), rotate 320ms var(--ease-out), box-shadow 320ms var(--ease-out), border-color var(--dur-base) var(--ease-out), filter 260ms var(--ease-out);
}
.book-card.in { opacity: 1; translate: 0 0; }
.book-card:hover {
  translate: 0 -10px;
  scale: 1.035;
  rotate: 0.3 1 0 -5deg;
  box-shadow: var(--shadow-3);
  border-color: var(--accent);
  z-index: 5;
  position: relative;
}
.book-card:active { scale: 1.01; }
.book-grid:hover .book-card:not(:hover) { filter: brightness(0.97); }
.cover-thumb {
  width: 100%;
  aspect-ratio: 3/4;
  border-radius: var(--radius-m);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 26px;
  color: rgba(255,255,255,0.94);
  margin-bottom: 12px;
  box-shadow: var(--shadow-2), inset 0 18px 24px -12px oklch(1 0 0 / 0.30);
  position: relative;
  background-size: cover;
  background-position: center;
}
.cover-thumb.no-cover,
.modal-cover.no-cover,
.cover-mini.no-cover {
  font-size: 14px;
  line-height: 1.35;
  text-align: center;
  padding: 10px;
  overflow: hidden;
  white-space: normal;
}
.cover-mini.no-cover { font-size: 10px; padding: 4px; line-height: 1.25; }

.book-card .title { font-size: 15px; font-weight: 700; margin-bottom: 4px; line-height: 1.4; color: var(--text-primary); }
.book-card .author { font-size: 13px; color: var(--text-tertiary); }

.empty-hint { color: var(--text-tertiary); font-size: 14px; padding: 24px 0; line-height: 1.55; }

/* ---------- 모달 ---------- */
.modal-card {
  border-radius: var(--radius-2xl);
  padding: 32px;
  max-width: 600px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
  box-shadow: var(--shadow-3);
}
.modal-card.small { max-width: 440px; }
.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--fill-secondary);
  border: none;
  border-radius: var(--radius-full);
  color: var(--text-tertiary);
  transition: background var(--dur-base) var(--ease), color var(--dur-base) var(--ease);
}
.modal-close:hover { color: var(--text-primary); background: var(--grey-150); }

.modal-cover {
  width: 140px;
  aspect-ratio: 3/4;
  border-radius: var(--radius-m);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 30px;
  color: rgba(255,255,255,0.94);
  margin-bottom: 18px;
  box-shadow: var(--shadow-3), inset 0 20px 26px -14px oklch(1 0 0 / 0.30);
  background-size: cover;
  background-position: center;
}
.modal-body h2 { margin: 0 0 6px; font-size: 22px; font-weight: 700; letter-spacing: -0.02em; color: var(--text-primary); }
.modal-body .author { color: var(--text-tertiary); font-size: 14px; margin-bottom: 14px; }
.modal-body .tag-row { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 20px; }
.modal-body .tag-pill { background: var(--accent-weak); color: var(--accent); border-radius: var(--radius-full); padding: 6px 14px; font-size: 12px; font-weight: 700; }
.modal-body .summary { font-size: 15px; line-height: 1.65; color: var(--text-secondary); margin-bottom: 8px; white-space: pre-line; }
.modal-body .summary.clamped {
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.summary-toggle {
  display: block;
  background: transparent;
  border: none;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  padding: 0;
  margin-bottom: 22px;
}
.summary-toggle:hover { text-decoration: underline; }
.modal-body .why-box { background: var(--fill-secondary); padding: 16px 18px; border-radius: var(--radius-m); font-size: 14px; line-height: 1.65; color: var(--text-secondary); margin-bottom: 22px; }
.modal-body .why-box b { color: var(--accent); font-weight: 700; }
.modal-body .why-box > b:first-child { color: var(--text-primary); display: block; margin-bottom: 6px; font-size: 15px; }
.why-loading { margin-top: 6px; color: var(--text-tertiary); font-style: italic; }
.modal-body textarea {
  width: 100%;
  min-height: 84px;
  background: var(--fill-secondary);
  border: 1.5px solid transparent;
  border-radius: var(--radius-m);
  color: var(--text-primary);
  padding: 13px 15px;
  font-size: 14px;
  resize: vertical;
  margin-bottom: 12px;
  transition: background var(--dur-base) var(--ease), border-color var(--dur-base) var(--ease), box-shadow var(--dur-base) var(--ease);
}
.modal-body textarea::placeholder { color: var(--text-placeholder); }
.modal-body textarea:focus {
  outline: none;
  background: var(--white);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-ring);
}
.modal-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 8px; }

/* ---------- 리딩리스트에 담기 모달 ---------- */
.list-choices { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; max-height: 260px; overflow-y: auto; }
.list-choice-btn {
  background: var(--white);
  border: 1px solid var(--line-hairline);
  color: var(--text-secondary);
  text-align: left;
  padding: 14px 16px;
  border-radius: var(--radius-m);
  font-size: 14px;
  font-weight: 600;
  transition: border-color var(--dur-base) var(--ease), background var(--dur-base) var(--ease);
}
.list-choice-btn:hover { border-color: var(--accent); background: var(--accent-weak); }
.list-choice-btn:disabled { color: var(--text-placeholder); background: var(--fill-secondary); border-color: var(--line-default); }
.list-choice-btn:disabled:hover { background: var(--fill-secondary); border-color: var(--line-default); }
.new-list-row { display: flex; gap: 10px; }
.new-list-row input {
  flex: 1;
  background: var(--fill-secondary);
  border: 1.5px solid transparent;
  border-radius: var(--radius-m);
  padding: 13px 15px;
  color: var(--text-primary);
  font-size: 14px;
}
.new-list-row input:focus { outline: none; background: var(--white); border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring); }

/* ---------- 리딩리스트 뷰 ---------- */
.reading-list-block {
  margin-bottom: 28px;
  background: var(--white);
  border: 1px solid var(--line-hairline);
  border-radius: var(--radius-xl);
  padding: 22px 26px;
  box-shadow: var(--shadow-1);
  opacity: 0;
  translate: 0 14px;
  transition: opacity 420ms var(--ease-out) var(--delay, 0ms), translate 420ms var(--ease-out) var(--delay, 0ms);
}
.reading-list-block.in { opacity: 1; translate: 0 0; }
.reading-list-block .rl-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.reading-list-block .rl-header input { background: transparent; border: none; color: var(--text-primary); font-size: 19px; font-weight: 700; padding: 5px; border-radius: var(--radius-s); }
.reading-list-block .rl-header input:focus { outline: none; box-shadow: 0 0 0 3px var(--accent-ring); background: var(--accent-weak); }
.rl-delete { background: transparent; border: none; color: var(--text-tertiary); font-size: 13px; font-weight: 600; padding: 5px 8px; border-radius: var(--radius-s); }
.rl-delete:hover { color: var(--danger); background: oklch(0.628 0.218 22 / 0.10); }

.rl-book-row { display: flex; align-items: center; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--fill-weak); }
.rl-book-row:last-child { border-bottom: none; }
.rl-book-row .cover-mini { width: 48px; height: 64px; border-radius: var(--radius-s); flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; color: rgba(255,255,255,0.94); box-shadow: var(--shadow-1); background-size: cover; background-position: center; }
.rl-book-row .info { flex: 1; cursor: pointer; }
.rl-book-row .info .title { font-size: 14px; font-weight: 700; color: var(--text-primary); }
.rl-book-row .info .author { font-size: 12px; color: var(--text-tertiary); }
.rl-book-row .order-btns { display: flex; gap: 0; }
.rl-book-row .order-btns button, .rl-remove-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-s);
  transition: background var(--dur-base) var(--ease), color var(--dur-base) var(--ease);
}
.rl-book-row .order-btns button:hover, .rl-remove-btn:hover { color: var(--text-primary); background: var(--fill-weak); }
.rl-book-row.read .info .title { text-decoration: line-through; color: var(--text-placeholder); }

.rl-check {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  background: var(--white);
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-xs);
  color: var(--white);
  padding: 0;
  transition: background var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out);
}
.rl-check:hover { border-color: var(--accent); }
.rl-check.checked { background: var(--success-green); border-color: var(--success-green); color: var(--success-green-ink); animation: checkPop 320ms var(--ease-out); }

@keyframes checkPop {
  0% { scale: 1; }
  45% { scale: 1.2; }
  100% { scale: 1; }
}

/* ---------- 내 취향 ---------- */
.tag-bars { display: flex; flex-direction: column; gap: 14px; }
.tag-bar-row {
  display: flex;
  align-items: center;
  gap: 12px;
  opacity: 0;
  translate: 0 10px;
  transition: opacity 420ms var(--ease-out) var(--delay, 0ms), translate 420ms var(--ease-out) var(--delay, 0ms);
}
.tag-bar-row.in { opacity: 1; translate: 0 0; }
.tag-bar-row .tag-name { width: 108px; font-size: 13px; font-weight: 600; color: var(--text-secondary); flex-shrink: 0; }
.tag-bar-track { flex: 1; height: 8px; background: var(--grey-150); border-radius: var(--radius-full); overflow: hidden; }
.tag-bar-fill { height: 100%; width: 0%; background: var(--accent); border-radius: var(--radius-full); transition: width 700ms var(--ease-out) var(--delay, 0ms); }
.tag-bar-row.in .tag-bar-fill { width: var(--pct, 0%); }
.tag-bar-row .tag-pct { font-size: 12px; color: var(--text-tertiary); width: 38px; text-align: right; font-variant-numeric: tabular-nums; }

.feedback-log { display: flex; flex-direction: column; gap: 10px; }
.feedback-item {
  background: var(--white);
  border: 1px solid var(--line-hairline);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-m);
  padding: 14px 16px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-secondary);
  box-shadow: var(--shadow-1);
  opacity: 0;
  translate: 0 10px;
  transition: opacity 420ms var(--ease-out) var(--delay, 0ms), translate 420ms var(--ease-out) var(--delay, 0ms);
}
.feedback-item.in { opacity: 1; translate: 0 0; }
.feedback-item .fb-book { color: var(--accent); font-weight: 700; }

.mobile-menu-btn { display: none; }
.sidebar-overlay { display: none; }

@media (max-width: 800px) {
  .mobile-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin-bottom: 8px;
    background: none;
    border: none;
    color: var(--text-primary);
  }

  .sidebar-overlay.visible {
    display: block;
    position: fixed;
    inset: 0;
    background: oklch(0 0 0 / 0.35);
    z-index: 40;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 286px;
    min-width: 286px;
    translate: -100% 0;
    z-index: 70;
    transition: translate 260ms var(--ease-out);
  }
  .sidebar.open { translate: 0 0; box-shadow: var(--shadow-3); }
  .sidebar:hover, .sidebar:focus-within { width: 286px; min-width: 286px; }
  .logo-label, .nav-label, .sidebar-divider, .sidebar-lists-header, .sidebar-lists { opacity: 1; }

  .main { padding: 20px 16px; }
}

/* ---------- 부트 로더 ---------- */
#bootLoader {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: var(--bg-page);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  transition: translate 620ms var(--ease-out);
}
#bootLoader.leaving { translate: 0 -100%; }
#bootLoader .loader-mark {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  opacity: 0;
  translate: 0 8px;
  transition: opacity 420ms var(--ease-out), translate 420ms var(--ease-out);
}
#bootLoader.ready .loader-mark { opacity: 1; translate: 0 0; }
#bootLoader .loader-mark svg { color: var(--accent); }
#bootLoader .loader-track { width: 160px; height: 3px; background: var(--grey-150); border-radius: var(--radius-full); overflow: hidden; }
#bootLoader .loader-fill { width: 0%; height: 100%; background: var(--accent); border-radius: var(--radius-full); transition: width 520ms var(--ease-out) 100ms; }
#bootLoader.ready .loader-fill { width: 100%; }
