* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: #f5f0e8;
  font-family: 'Noto Serif KR', serif;
  min-height: 100vh;
  color: #2c1f0e;
}

/* ── HEADER ── */
header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 2rem 3rem 1.5rem;
  border-bottom: 1px solid #c4a882;
  background: #faf6ef;
}

.header-left {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
}

.profile-photo-wrap {
  position: relative;
  flex-shrink: 0;
}

.profile-photo {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #d4b896;
  border: 2px solid #a07850;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: #7a5530;
  overflow: hidden;
  flex-shrink: 0;
}

.profile-edit-btn {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 24px;
  height: 24px;
  background: #faf6ef;
  border: 1px solid #c4a882;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #7a6040;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  box-shadow: 0 1px 4px rgba(58,46,30,0.15);
}
.profile-edit-btn:hover {
  background: #3a2e1e;
  color: #f5f0e8;
  border-color: #3a2e1e;
}

.profile-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.header-title h1 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.7rem;
  font-weight: 700;
  color: #2c1f0e;
  letter-spacing: 0.05em;
}

.header-title .tagline {
  font-size: 0.85rem;
  color: #7a6040;
  margin-top: 0.3rem;
  font-style: italic;
}

.header-title .intro {
  font-size: 0.82rem;
  color: #5c4a30;
  margin-top: 0.6rem;
  line-height: 1.7;
  max-width: 380px;
}

.header-right {
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  align-items: flex-end;
}

.collection-btn {
  background: #2c1f0e;
  color: #f5f0e8;
  border: none;
  padding: 0.5rem 1.1rem;
  font-family: 'Noto Serif KR', serif;
  font-size: 0.8rem;
  border-radius: 2px;
  cursor: pointer;
  letter-spacing: 0.05em;
  transition: background 0.2s;
}

.collection-btn:hover { background: #a07850; }

.header-right .sub-links {
  display: flex;
  gap: 0.8rem;
}

.header-right .sub-links a {
  font-size: 0.75rem;
  color: #7a6040;
  text-decoration: none;
  border-bottom: 1px solid #c4a882;
  padding-bottom: 1px;
  transition: color 0.2s;
}

.header-right .sub-links a:hover { color: #2c1f0e; }

/* ── MAIN ── */
main {
  padding: 2.5rem 3rem calc(2.5rem + 58px);
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ── FAB BUTTONS ── */
.fab-group {
  position: fixed;
  bottom: 70px;
  right: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 190;
}

.fab-btn {
  background: #3a2e1e;
  color: #f5f0e8;
  border: none;
  border-radius: 20px;
  padding: 0.48rem 1rem;
  font-family: 'Noto Serif KR', serif;
  font-size: 0.8rem;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.28);
  transition: background 0.15s, transform 0.1s;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.fab-btn:hover { background: #5a4a30; transform: translateY(-1px); }
.fab-btn:active { transform: translateY(0); }

/* 모바일 전용 통합 수정 버튼 — 데스크톱에서는 숨김 */
#mobile-edit-fab {
  display: none;
}

/* ── BOOKSHELF ── */
.bookshelf-wrapper {
  width: 100%;
  max-width: 640px;
}

.shelf-frame {
  width: 100%;
  background: #42261A;
  border-radius: 3px;
  padding: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.35);
  position: relative;
  overflow: hidden;
}

.empty-shelf-overlay {
  position: absolute;
  inset: 0;
  background: rgba(245, 240, 232, 0.78);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  cursor: pointer;
  border-radius: 3px;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.empty-shelf-overlay.dismissing {
  opacity: 0;
  pointer-events: none;
}

.empty-shelf-msg {
  font-family: 'Noto Serif KR', serif;
  font-size: 0.88rem;
  color: #5a3e22;
  letter-spacing: 0.1em;
  text-align: center;
  line-height: 1.8;
  padding: 0 1.5rem;
  pointer-events: none;
  user-select: none;
}

.frame-bar {
  height: 12px;
  background: #42261A;
  border-radius: 2px;
  margin-bottom: 6px;
}

.frame-bar.bottom {
  margin-top: 6px;
  margin-bottom: 0;
}

.shelf-row {
  display: flex;
  gap: 0;
  margin-bottom: 6px;
  position: relative;
}

.shelf-row:last-of-type { margin-bottom: 0; }

.shelf-row-outer {
  position: relative;
  margin-bottom: 6px;
}
.shelf-row-outer .shelf-row {
  margin-bottom: 0;
}
.shelf-row-delete {
  position: absolute;
  right: -64px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  background: rgba(176, 90, 58, 0.9);
  color: #fff;
  border: none;
  border-radius: 5px;
  padding: 0.22rem 0.55rem;
  font-family: 'Noto Serif KR', serif;
  font-size: 0.72rem;
  cursor: pointer;
  display: none;
  white-space: nowrap;
}
.shelf-row-delete:hover { background: #b05a3a; }
.shelf-frame.shelf-edit-mode .shelf-row-outer .shelf-row-delete { display: block; }

.add-shelf-row-btn {
  display: none;
  width: 100%;
  margin-top: 8px;
  padding: 0.5rem;
  background: none;
  border: 1.5px dashed #a07850;
  border-radius: 6px;
  color: #7a6040;
  font-family: 'Noto Serif KR', serif;
  font-size: 0.82rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  letter-spacing: 0.04em;
}
.add-shelf-row-btn:hover { background: #f0e8d8; color: #3a2e1e; }
.shelf-frame.shelf-edit-mode ~ .add-shelf-row-btn { display: block; }

/* 수직 칸막이 */
.vd {
  width: 8px;
  background: #42261A;
  flex-shrink: 0;
}

/* 각 칸 */
.cell {
  background: #E8DDD0;
  position: relative;
  display: flex;
  align-items: flex-end;
  padding: 0 8px 8px;
  gap: 3px;
  overflow: hidden;
}

/* 바닥 그림자 */
.cell::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 8px;
  background: rgba(0,0,0,0.07);
  pointer-events: none;
}

/* 빈 칸 레이블 */
.empty-label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 9px;
  color: rgba(100, 80, 40, 0.28);
  letter-spacing: 0.14em;
  font-style: italic;
  white-space: nowrap;
  pointer-events: none;
}

/* ── BOOK: spine-only (no cover image) ── */
.book-spine.bk {
  flex-shrink: 0;
  border-radius: 1px 2px 2px 1px;
  box-shadow: 1px 0 3px rgba(0,0,0,0.2);
  cursor: pointer;
  transition: transform 0.15s ease;
  position: relative;
}

.book-spine.bk:hover { transform: translateY(-5px); }

.spine-title {
  position: absolute;
  inset: 4px 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: rotate(180deg);
  font-size: 8px;
  font-family: 'Noto Serif KR', serif;
  color: rgba(255,255,255,0.75);
  text-shadow: 0 1px 2px rgba(0,0,0,0.7);
  overflow: hidden;
  pointer-events: none;
  line-height: 1.2;
}

/* ── BOOK: cover image ── */
.book-spine.bk-cover {
  flex-shrink: 0;
  border-radius: 1px 3px 3px 1px;
  box-shadow: 2px 1px 6px rgba(0,0,0,0.25);
  cursor: pointer;
  transition: transform 0.15s ease;
  overflow: hidden;
  position: relative;
  background-size: cover;
  background-position: center top;
}

.book-spine.bk-cover:hover { transform: translateY(-5px); }

.bk-cover-title {
  position: absolute;
  bottom: 4px; left: 0; right: 0;
  text-align: center;
  font-size: 7px;
  color: rgba(255,255,255,0.85);
  font-family: 'Cormorant Garamond', serif;
  padding: 0 3px;
  line-height: 1.3;
  text-shadow: 0 1px 3px rgba(0,0,0,0.9);
}

/* ── ADD BOOK BUTTON ── */
.add-book-btn {
  flex-shrink: 0;
  width: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: rgba(100, 80, 40, 0.25);
  font-size: 18px;
  font-weight: 300;
  background: rgba(100, 80, 40, 0.04);
  border: 1px dashed rgba(100, 80, 40, 0.18);
  border-radius: 2px;
  transition: all 0.2s ease;
  user-select: none;
}

.add-book-btn:hover {
  background: rgba(100, 80, 40, 0.09);
  border-color: rgba(100, 80, 40, 0.4);
  color: rgba(100, 80, 40, 0.6);
  transform: translateY(-2px);
}

/* ── CUSTOM SPINE (CSS-generated, dominant-color) ── */
.book-spine.bk-custom {
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  border-radius: 1px 2px 2px 1px;
  box-shadow: 2px 0 5px rgba(0,0,0,0.28), inset -2px 0 5px rgba(0,0,0,0.12);
  cursor: pointer;
  transition: transform 0.15s ease;
}

.book-spine.bk-custom:hover { transform: translateY(-5px); }

/* specular highlight along the left edge */
.book-spine.bk-custom::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to right,
    rgba(255,255,255,0.14) 0%,
    transparent 45%,
    rgba(0,0,0,0.08) 100%
  );
  pointer-events: none;
  z-index: 1;
}

/* Title — vertical, larger */
.cs-title {
  position: absolute;
  top: 7px;
  bottom: calc(30% + 6px);
  left: 2px;
  right: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-family: 'Cormorant Garamond', serif;
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.06em;
  line-height: 1;
  overflow: hidden;
  pointer-events: none;
  z-index: 2;
}

/* Thin separator */
.cs-sep {
  position: absolute;
  left: 18%;
  right: 18%;
  bottom: calc(30% + 4px);
  height: 1px;
  background: currentColor;
  opacity: 0.2;
  pointer-events: none;
  z-index: 2;
}

/* Author — vertical, smaller */
.cs-author {
  position: absolute;
  bottom: 6px;
  height: 26%;
  left: 2px;
  right: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-family: 'Noto Serif KR', serif;
  font-size: 7px;
  letter-spacing: 0.03em;
  line-height: 1;
  overflow: hidden;
  opacity: 0.78;
  pointer-events: none;
  z-index: 2;
}


/* ── MODAL ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(44, 31, 14, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
  backdrop-filter: blur(3px);
}

.modal-overlay.hidden { display: none; }

.modal {
  background: #faf6ef;
  border: 1px solid #c4a882;
  border-radius: 4px;
  width: 100%;
  max-width: 560px;
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 64px rgba(0,0,0,0.35);
  position: relative;
  overflow: hidden;
}

.modal-close {
  position: absolute;
  top: 0.9rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1rem;
  color: #7a6040;
  cursor: pointer;
  line-height: 1;
  padding: 0.2rem 0.4rem;
  border-radius: 2px;
  transition: color 0.2s, background 0.2s;
  z-index: 1;
}

.modal-close:hover { color: #2c1f0e; background: #ede8df; }

.modal-step {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex: 1;
}

.modal-step.hidden { display: none; }

.modal-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: #2c1f0e;
  padding: 1.2rem 1.5rem 0.8rem;
  border-bottom: 1px solid #e0d5c5;
  flex-shrink: 0;
}

/* ── SEARCH BAR ── */
.search-bar {
  display: flex;
  gap: 0.5rem;
  padding: 0.9rem 1.2rem;
  border-bottom: 1px solid #e0d5c5;
  flex-shrink: 0;
}

.search-bar input {
  flex: 1;
  padding: 0.5rem 0.75rem;
  border: 1px solid #c4a882;
  border-radius: 2px;
  background: #fff;
  font-family: 'Noto Serif KR', serif;
  font-size: 0.85rem;
  color: #2c1f0e;
  outline: none;
  transition: border-color 0.2s;
}

.search-bar input:focus { border-color: #a07850; }

.search-bar button {
  padding: 0.5rem 1rem;
  background: #2c1f0e;
  color: #f5f0e8;
  border: none;
  border-radius: 2px;
  font-family: 'Noto Serif KR', serif;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}

.search-bar button:hover { background: #a07850; }

/* ── SEARCH RESULTS ── */
.search-results {
  overflow-y: auto;
  flex: 1;
  padding: 0.5rem 0;
}

.search-loading,
.search-empty {
  padding: 2rem;
  text-align: center;
  font-size: 0.82rem;
  color: #7a6040;
  font-style: italic;
}

.result-card {
  display: flex;
  gap: 0.9rem;
  padding: 0.7rem 1.2rem;
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid #ede8df;
}

.result-card:hover { background: #f0ebe0; }

.result-thumb {
  width: 46px;
  flex-shrink: 0;
}

.result-thumb img {
  width: 46px;
  height: 64px;
  object-fit: cover;
  border-radius: 2px;
  box-shadow: 1px 2px 6px rgba(0,0,0,0.2);
  display: block;
}

.no-cover {
  width: 46px;
  height: 64px;
  background: #d4b896;
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  color: #7a5530;
  text-align: center;
  line-height: 1.3;
}

.result-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.2rem;
  min-width: 0;
}

.result-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #2c1f0e;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.result-author {
  font-size: 0.78rem;
  color: #7a6040;
}

.result-year {
  font-size: 0.74rem;
  color: #a08060;
}

/* ── COVER STEP ── */
.back-btn {
  background: none;
  border: none;
  padding: 0.9rem 1.2rem 0.4rem;
  font-family: 'Noto Serif KR', serif;
  font-size: 0.78rem;
  color: #7a6040;
  cursor: pointer;
  text-align: left;
  transition: color 0.2s;
  flex-shrink: 0;
}

.back-btn:hover { color: #2c1f0e; }

.cover-step-header {
  padding: 0 1.5rem 0.8rem;
  border-bottom: 1px solid #e0d5c5;
  flex-shrink: 0;
}

.cover-step-header .modal-title {
  padding: 0.3rem 0 0.2rem;
  border-bottom: none;
  font-size: 1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cover-step-author {
  font-size: 0.78rem;
  color: #7a6040;
}

/* ── MODE TOGGLE ── */
.mode-toggle {
  display: flex;
  padding: 0.7rem 1.2rem 0;
  flex-shrink: 0;
  gap: 0;
}

.mode-btn {
  flex: 1;
  padding: 0.4rem 0;
  background: none;
  border: 1px solid #c4a882;
  font-family: 'Noto Serif KR', serif;
  font-size: 0.8rem;
  color: #7a6040;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  letter-spacing: 0.05em;
}

.mode-btn:first-child { border-radius: 2px 0 0 2px; }
.mode-btn:last-child  { border-radius: 0 2px 2px 0; border-left: none; }

.mode-btn.active {
  background: #2c1f0e;
  color: #f5f0e8;
  border-color: #2c1f0e;
}

.mode-btn:hover:not(.active) {
  background: #f0ebe0;
  color: #2c1f0e;
}

/* ── PREVIEW ROW ── */
.cover-middle {
  display: flex;
  border-top: 1px solid #e0d5c5;
  border-bottom: 1px solid #e0d5c5;
  margin-top: 0.7rem;
  flex-shrink: 0;
}

/* ── LIVE PREVIEW ── */
.preview-area {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 2rem 1rem 1rem; /* extra top padding so rotation handle doesn't clip */
  background: #ede8dc;
  flex-shrink: 0;
  min-width: 124px;
}

/* ── RIGHT PANEL (text controls + optional bg/crop) ── */
.cover-right-panel {
  flex: 1;
  border-left: 1px solid #e0d5c5;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  min-width: 0;
}

/* ── TEXT CONTROLS ── */
.pv-text-controls {
  padding: 8px 10px 6px;
  border-bottom: 1px solid #e0d5c5;
  flex-shrink: 0;
  background: #faf6ef;
}

.pv-tc-header {
  font-size: 0.7rem;
  color: #7a6040;
  letter-spacing: 0.08em;
  font-family: 'Noto Serif KR', serif;
  margin-bottom: 6px;
}

.pv-tc-hint {
  font-size: 0.64rem;
  color: #a08060;
  font-style: italic;
  letter-spacing: 0;
}

.pv-tc-row {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 5px;
}

.pv-tc-label {
  font-size: 0.7rem;
  color: #7a6040;
  font-family: 'Noto Serif KR', serif;
  width: 22px;
  flex-shrink: 0;
}

.pv-tc-color {
  width: 24px;
  height: 22px;
  padding: 1px;
  border: 1px solid #c4a882;
  border-radius: 2px;
  background: none;
  cursor: pointer;
  flex-shrink: 0;
}

.pv-tc-size,
.pv-tc-rot {
  flex: 1;
  min-width: 0;
  accent-color: #a07850;
  height: 4px;
}

.pv-tc-del {
  width: 20px;
  height: 20px;
  background: #ede8dc;
  border: none;
  border-radius: 50%;
  color: #7a5530;
  font-size: 9px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
  padding: 0;
  line-height: 1;
}

.pv-tc-del:hover { background: #cc3333; color: #fff; }
.pv-tc-del.pv-tc-del--hidden { background: #c4a882; color: #fff; }

.pv-tc-edit-btn {
  width: 20px;
  height: 20px;
  background: #ede8dc;
  border: none;
  border-radius: 50%;
  color: #9a8a6a;
  font-size: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0;
  line-height: 1;
  transition: background 0.15s, color 0.15s;
}
.pv-tc-edit-btn:hover { background: #a07850; color: #fff; }

.pv-tc-edit-row {
  margin-bottom: 5px;
}
.pv-tc-edit-input {
  width: 100%;
  padding: 4px 7px;
  background: #fff;
  border: 1px solid #c4a882;
  border-radius: 4px;
  font-family: 'Noto Serif KR', serif;
  font-size: 0.82rem;
  color: #3a2e1e;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.15s;
}
.pv-tc-edit-input:focus { border-color: #7a5530; }

.pv-tc-add-text {
  width: 100%;
  margin-top: 5px;
  padding: 3px 0;
  background: none;
  border: 1px dashed #c4a882;
  border-radius: 2px;
  font-family: 'Noto Serif KR', serif;
  font-size: 0.68rem;
  color: #9a8a6a;
  cursor: pointer;
  letter-spacing: 0.04em;
  transition: all 0.15s;
}
.pv-tc-add-text:hover { background: #f0ebe0; border-color: #a07850; color: #5a4a30; }

/* ── INTERACTIVE PREVIEW ELEMENTS ── */
/* #book-preview: outer wrapper — overflow:visible so handles stick out */
#book-preview {
  position: relative;
  overflow: visible;
  border-radius: 1px 3px 3px 1px;
  box-shadow: 3px 5px 14px rgba(0,0,0,0.28);
  flex-shrink: 0;
}

.pv-el {
  position: absolute;
  cursor: move;
  touch-action: none;
}

.pv-el.pv-active { outline: 1px dashed rgba(255,255,255,0.7); outline-offset: 1px; }

/* Image element placed via "오려 붙이기" */
.pv-img-el {
  border-radius: 1px;
  box-shadow: 0 1px 5px rgba(0,0,0,0.35);
}

/* ↻ rotation handle — shown above the element on hover/active */
.pv-rot-handle {
  position: absolute;
  top: -22px;
  left: 50%;
  transform: translateX(-50%);
  width: 16px;
  height: 16px;
  background: rgba(255,255,255,0.9);
  border: 1.5px solid rgba(80,80,80,0.55);
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: grab;
  font-size: 11px;
  color: #444;
  z-index: 10;
  user-select: none;
  line-height: 1;
}

.pv-el:hover .pv-rot-handle,
.pv-el.pv-active .pv-rot-handle { display: flex; }

/* ⬛ resize handle — bottom-right corner drag to change font size */
.pv-resize-handle {
  position: absolute;
  bottom: -5px;
  right: -5px;
  width: 9px;
  height: 9px;
  background: rgba(255,255,255,0.9);
  border: 1.5px solid rgba(80,80,80,0.55);
  border-radius: 2px;
  cursor: se-resize;
  display: none;
  z-index: 10;
}

.pv-el:hover .pv-resize-handle,
.pv-el.pv-active .pv-resize-handle { display: block; }

.pv-el-text {
  display: block;
  white-space: nowrap;
  font-family: 'Cormorant Garamond', serif;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-shadow: 0 1px 3px rgba(0,0,0,0.6);
  pointer-events: none;
  line-height: 1.2;
  user-select: none;
  -webkit-user-select: none;
}

.pv-del-btn {
  position: absolute;
  top: -7px;
  right: -7px;
  width: 14px;
  height: 14px;
  background: rgba(180,40,40,0.85);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 8px;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
  z-index: 5;
}

.pv-el:hover .pv-del-btn,
.pv-el.pv-active .pv-del-btn { display: flex; }

/* ── INLINE CUSTOM PANEL ── */
.cover-custom-inline {
  background: #faf6ef;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cover-custom-inline.hidden { display: none; }

.ci-section.hidden { display: none; }

.ci-section {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.ci-label {
  font-size: 0.71rem;
  color: #7a6040;
  letter-spacing: 0.08em;
  font-family: 'Noto Serif KR', serif;
}

.ci-hint {
  font-size: 0.65rem;
  color: #a08060;
  font-style: italic;
  letter-spacing: 0;
}

.ci-bg-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ci-bg-presets {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  flex: 1;
}

.ci-bg-swatch {
  width: 20px;
  height: 20px;
  border-radius: 3px;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: border-color 0.12s, transform 0.1s;
}

.ci-bg-swatch:hover { border-color: rgba(0,0,0,0.45); transform: scale(1.2); }

#ci-bg-picker {
  width: 26px;
  height: 22px;
  padding: 1px;
  border: 1px solid #c4a882;
  border-radius: 2px;
  background: none;
  cursor: pointer;
  flex-shrink: 0;
}

.ci-crop-container {
  position: relative;
  overflow: hidden;
  background: #111;
  max-height: 115px;
  display: flex;
  justify-content: center;
  cursor: crosshair;
  border-radius: 2px;
}

.ci-crop-container img {
  max-width: 100%;
  max-height: 115px;
  display: block;
  user-select: none;
  pointer-events: none;
}

.ci-crop-sel {
  position: absolute;
  border: 1.5px dashed rgba(220,170,40,0.9);
  background: rgba(220,170,40,0.1);
  pointer-events: none;
}

.ci-crop-sel.hidden { display: none; }

.ci-paste-btn {
  padding: 4px 12px;
  background: #2c1f0e;
  color: #f5f0e8;
  border: none;
  border-radius: 2px;
  font-family: 'Noto Serif KR', serif;
  font-size: 0.74rem;
  cursor: pointer;
  align-self: flex-start;
  transition: background 0.2s;
}

.ci-paste-btn:hover { background: #a07850; }
.ci-paste-btn.hidden { display: none; }

/* .preview-book-bg: background layer — position:absolute, clips images */
.preview-book-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: 1px 3px 3px 1px;
  transition: background-color 0.2s;
}

/* Spine mode preview: narrow */
.preview-spine {
  width: 46px;
  height: 152px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 2px;
  gap: 4px;
}

/* Cover mode preview: wide */
.preview-cover {
  width: 98px;
  height: 152px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

/* Shared preview text */
.preview-title {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 700;
  overflow: hidden;
  line-height: 1;
  text-align: center;
}

.preview-author {
  font-family: 'Noto Serif KR', serif;
  overflow: hidden;
  line-height: 1;
  text-align: center;
  opacity: 0.78;
}

/* Spine-specific text */
.preview-spine .preview-title {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-size: 11px;
  letter-spacing: 0.06em;
  flex: 1;
}

.preview-sep {
  width: 60%;
  height: 1px;
  background: currentColor;
  opacity: 0.2;
  flex-shrink: 0;
}

.preview-spine .preview-author {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-size: 7px;
  flex-shrink: 0;
  height: 28%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Cover-specific text */
.preview-cover-info {
  position: relative;
  z-index: 1;
  padding: 3px 6px 6px;
}

.preview-cover .preview-title {
  font-size: 8.5px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.preview-cover .preview-author {
  font-size: 6.5px;
  white-space: nowrap;
  text-overflow: ellipsis;
  margin-top: 2px;
}

/* Gradient overlay on cover preview when an image is showing */
.preview-img-overlay {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 55%;
  background: linear-gradient(transparent, rgba(0,0,0,0.55));
  pointer-events: none;
}

/* ── CONFIRM BUTTON ── */
.add-shelf-row {
  padding: 0.75rem 1.2rem;
  border-top: 1px solid #e0d5c5;
  flex-shrink: 0;
  display: flex;
  gap: 0.5rem;
}


.add-to-shelf-btn {
  flex: 1;
  padding: 0.6rem;
  background: #2c1f0e;
  color: #f5f0e8;
  border: none;
  border-radius: 2px;
  font-family: 'Noto Serif KR', serif;
  font-size: 0.85rem;
  cursor: pointer;
  letter-spacing: 0.05em;
  transition: background 0.2s;
}

.add-to-shelf-btn:hover:not(:disabled) { background: #a07850; }
.add-to-shelf-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── SHELF PICKER (step-shelf) ── */
.shelf-pick-hint {
  font-size: 0.78rem;
  color: #9a8a6a;
  margin: 0 1.2rem 0.9rem;
}

.shelf-pick-grid {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin: 0 1.2rem 0.5rem;
  background: #e8e0d0;
  border: 2px solid #b09870;
  border-radius: 3px;
  padding: 7px;
}

.sp-row {
  display: flex;
  gap: 5px;
}

.sp-cell {
  border: 1.5px solid #c4a882;
  border-radius: 2px;
  cursor: pointer;
  transition: border-color 0.15s;
  min-width: 0;
  position: relative;
}
.sp-cell:hover { border-color: #a07850; }
.sp-cell.sp-selected { border-color: #4a6741; border-width: 2px; }
.sp-cell.sp-selected::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(74, 103, 65, 0.22);
  pointer-events: none;
  z-index: 2;
}

.sp-empty {
  font-family: 'Noto Serif KR', serif;
  font-size: 0.62rem;
  color: #b8a88a;
  margin: auto;
  pointer-events: none;
}

/* Selected state for cover options */
.cover-option.selected {
  border-color: #a07850;
  box-shadow: 0 0 0 2px rgba(160,120,80,0.35);
  transform: scale(1.04);
}

/* ── COVER GRID ── */
.cover-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.6rem;
  padding: 0.9rem 1.2rem;
  overflow-y: auto;
  flex: 1;
}

.cover-option {
  aspect-ratio: 2 / 3;
  border-radius: 3px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.15s, transform 0.15s;
  background: #d4b896;
}

.cover-option:hover {
  border-color: #a07850;
  transform: scale(1.04);
}

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


/* ══════════════════════════════════════════════════════════════
   CUSTOM EDITOR OVERLAY
══════════════════════════════════════════════════════════════ */

.ce-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 7, 4, 0.82);
  display: flex;
  align-items: stretch;
  justify-content: center;
  z-index: 2000;
  backdrop-filter: blur(4px);
}

.ce-overlay.hidden { display: none; }

.ce-container {
  position: relative;
  width: 100%;
  max-width: 640px;
  display: flex;
  flex-direction: column;
  background: #16120d;
  overflow: hidden;
}

/* Close */
.ce-close {
  position: absolute;
  top: 10px;
  right: 14px;
  background: rgba(0,0,0,0.45);
  border: 1px solid rgba(255,255,255,0.12);
  color: #b0a080;
  font-size: 1rem;
  cursor: pointer;
  border-radius: 3px;
  padding: 3px 9px;
  z-index: 10;
  transition: background 0.2s, color 0.2s;
}
.ce-close:hover { background: rgba(255,255,255,0.1); color: #fff; }

/* ── TOP: preview ── */
.ce-top {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0e0b08;
  padding: 28px 20px 20px;
  min-height: 260px;
}

.ce-canvas-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
}

.ce-canvas {
  position: relative;
  overflow: hidden;
  border-radius: 2px 4px 4px 2px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.7), 4px 0 8px rgba(0,0,0,0.4);
  cursor: default;
  user-select: none;
}

/* Canvas elements */
.ep-element {
  position: absolute;
  cursor: move;
  border: 1px solid transparent;
  box-sizing: border-box;
}

.ep-element:hover          { border-color: rgba(255,255,255,0.3); }
.ep-element.ep-active      { border-color: rgba(255,200,80,0.7);  }

.ep-delete {
  position: absolute;
  top: -9px;
  right: -9px;
  width: 17px;
  height: 17px;
  background: #cc3333;
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 9px;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
  z-index: 5;
}

.ep-element:hover .ep-delete,
.ep-element.ep-active .ep-delete { display: flex; }

.ep-resize {
  position: absolute;
  bottom: -5px;
  right: -5px;
  width: 12px;
  height: 12px;
  background: rgba(255,255,255,0.65);
  border-radius: 2px;
  cursor: se-resize;
}

/* Text element content */
.ep-text-content {
  display: block;
  width: 100%;
  height: 100%;
  outline: none;
  background: none;
  border: none;
  font-family: 'Cormorant Garamond', serif;
  font-size: 11px;
  color: #ffffff;
  overflow: hidden;
  white-space: pre-wrap;
  word-break: break-all;
  user-select: text;
  -webkit-user-select: text;
  touch-action: auto;
  cursor: text;
}

/* Image element */
.ep-image img {
  width: 100%;
  height: 100%;
  object-fit: fill;
  display: block;
  pointer-events: none;
}

/* ── BOTTOM ── */
.ce-bottom {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

/* Cover thumbnails row */
.ce-covers-section {
  padding: 12px 16px 8px;
  border-bottom: 1px solid #2a2218;
}

.ce-panel-label {
  font-size: 0.72rem;
  color: #806a48;
  letter-spacing: 0.1em;
  margin-bottom: 8px;
  font-family: 'Noto Serif KR', serif;
}

.ce-hint {
  font-size: 0.68rem;
  color: #5a4a30;
  font-style: italic;
  letter-spacing: 0;
}

.ce-covers-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: thin;
  scrollbar-color: #4a3a28 transparent;
}

.ce-covers-loading {
  font-size: 0.75rem;
  color: #5a4a30;
  font-style: italic;
  font-family: 'Noto Serif KR', serif;
  white-space: nowrap;
  line-height: 78px;
}

.ce-cover-thumb {
  flex-shrink: 0;
  width: 52px;
  height: 78px;
  border-radius: 2px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.15s;
  background: #2a2218;
}

.ce-cover-thumb:hover { border-color: rgba(200,160,80,0.7); }

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

/* Thumbnail popup */
.ce-thumb-popup {
  position: fixed;
  background: #1e1810;
  border: 1px solid #5a4530;
  border-radius: 4px;
  padding: 5px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: 0 4px 18px rgba(0,0,0,0.6);
  z-index: 3000;
}

.ce-popup-btn {
  padding: 6px 16px;
  background: none;
  border: 1px solid #4a3828;
  border-radius: 2px;
  color: #d0c0a0;
  font-family: 'Noto Serif KR', serif;
  font-size: 0.78rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}

.ce-popup-btn:hover { background: rgba(200,160,80,0.15); border-color: #a07850; }

/* Cover option popup (in modal step-2) */
.cover-opt-popup {
  position: fixed;
  background: #1e1810;
  border: 1px solid #5a4530;
  border-radius: 4px;
  padding: 5px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: 0 4px 18px rgba(0,0,0,0.5);
  z-index: 2000;
}

.cover-opt-popup-btn {
  padding: 6px 16px;
  background: none;
  border: 1px solid #c4a882;
  border-radius: 2px;
  color: #2c1f0e;
  font-family: 'Noto Serif KR', serif;
  font-size: 0.78rem;
  cursor: pointer;
  white-space: nowrap;
  background: #faf6ef;
  transition: background 0.15s;
}

.cover-opt-popup-btn:hover { background: #f0e8d8; }

/* ── Custom panel ── */
.ce-custom-panel {
  border-top: 1px solid #2a2218;
}

.ce-custom-panel.hidden { display: none; }

.ce-panel-section {
  padding: 10px 16px 6px;
  border-bottom: 1px solid #1e1810;
}

/* Background presets */
.ce-bg-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ce-bg-presets {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  flex: 1;
}

.ce-bg-swatch {
  width: 22px;
  height: 22px;
  border-radius: 3px;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
  transition: border-color 0.15s, transform 0.1s;
  flex-shrink: 0;
}

.ce-bg-swatch:hover { border-color: rgba(255,255,255,0.6); transform: scale(1.15); }

#ce-bg-picker {
  width: 32px;
  height: 28px;
  border: 1px solid #4a3a28;
  border-radius: 3px;
  padding: 1px;
  background: none;
  cursor: pointer;
  flex-shrink: 0;
}

/* Crop container */
.ce-crop-container {
  position: relative;
  overflow: hidden;
  background: #0a0806;
  max-height: 190px;
  display: flex;
  justify-content: center;
  cursor: crosshair;
  border-radius: 2px;
  margin-bottom: 6px;
}

.ce-crop-container img {
  max-width: 100%;
  max-height: 190px;
  display: block;
  user-select: none;
  pointer-events: none;
}

.ce-crop-sel {
  position: absolute;
  border: 2px dashed rgba(255,230,100,0.85);
  background: rgba(255,230,100,0.1);
  pointer-events: none;
}

.ce-crop-sel.hidden { display: none; }

.ce-paste-btn {
  padding: 5px 14px;
  background: #2c1f0e;
  color: #f5f0e8;
  border: none;
  border-radius: 2px;
  font-family: 'Noto Serif KR', serif;
  font-size: 0.78rem;
  cursor: pointer;
  transition: background 0.2s;
}

.ce-paste-btn:hover { background: #a07850; }

/* Text rows */
.ce-text-rows {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.ce-text-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ce-text-label {
  font-size: 0.75rem;
  color: #a09070;
  font-family: 'Noto Serif KR', serif;
  width: 28px;
  flex-shrink: 0;
}

.ce-text-color {
  width: 28px;
  height: 26px;
  padding: 1px;
  border: 1px solid #4a3a28;
  border-radius: 2px;
  background: none;
  cursor: pointer;
  flex-shrink: 0;
}

.ce-text-size {
  flex: 1;
  accent-color: #a07850;
}

.ce-text-delete {
  width: 22px;
  height: 22px;
  background: #3a2218;
  border: none;
  border-radius: 50%;
  color: #c08060;
  font-size: 9px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
}

.ce-text-delete:hover { background: #cc3333; color: #fff; }

/* Confirm */
.ce-confirm-row {
  padding: 12px 16px 16px;
  margin-top: auto;
}

.ce-confirm-btn {
  width: 100%;
  padding: 0.65rem;
  background: #2c1f0e;
  color: #f5f0e8;
  border: none;
  border-radius: 2px;
  font-family: 'Noto Serif KR', serif;
  font-size: 0.85rem;
  cursor: pointer;
  letter-spacing: 0.05em;
  transition: background 0.2s;
}

.ce-confirm-btn:hover { background: #a07850; }

/* ── Editor book on shelf ── */
.book-spine.bk-editor {
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  border-radius: 1px 2px 2px 1px;
  box-shadow: 1px 0 4px rgba(0,0,0,0.25);
  cursor: pointer;
  transition: transform 0.15s ease;
}

.book-spine.bk-editor:hover { transform: translateY(-5px); }

.bk-editor-mini {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  transform-origin: top left;
}

.bk-editor-mini span {
  position: absolute;
  overflow: hidden;
  font-family: 'Cormorant Garamond', serif;
  line-height: 1.2;
  pointer-events: none;
}

/* ── 칼럼 모달 ── */
.col-modal {
  width: min(680px, 94vw);
  max-height: 82vh;
  display: flex;
  flex-direction: column;
}

.col-modal .modal-step {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  position: relative;
  padding: 0 1.4rem 1.4rem;
}

.col-modal .modal-step.hidden { display: none; }

/* step 패딩이 있으므로 title·back-btn 자체 좌우 패딩 제거 */
.col-modal .modal-title {
  padding-left: 0;
  padding-right: 0;
}

.col-modal .back-btn {
  padding-left: 0;
  padding-right: 0;
}

#col-step-list .col-list {
  padding-bottom: 64px; /* 연필 버튼과 겹치지 않도록 */
}

.col-modal-title {
  font-size: 1.15rem;
  color: #3a2e1e;
}

/* 목록 헤더 */
.col-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  flex-shrink: 0;
}

.col-new-btn {
  position: absolute;
  bottom: 1.4rem;
  right: 1.4rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #6e5e3a;
  color: #f5f0e8;
  border: none;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(0,0,0,0.22);
  transition: background 0.15s, transform 0.12s;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.col-new-btn:hover {
  background: #5a4c2e;
  transform: scale(1.08);
}

/* 칼럼 목록 */
.col-list {
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 4px;
}

.col-list::-webkit-scrollbar { width: 5px; }
.col-list::-webkit-scrollbar-thumb { background: #c8b898; border-radius: 3px; }

.col-empty {
  text-align: center;
  color: #9a8a6a;
  font-size: 0.88rem;
  margin-top: 2rem;
  font-style: italic;
}

/* 칼럼 카드 */
.col-card {
  background: #faf7f0;
  border: 1px solid #e0d4b8;
  border-radius: 5px;
  padding: 12px 14px;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}
.col-card:hover {
  background: #f5ede0;
  border-color: #c8b080;
}

.col-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #3a2e1e;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.col-card-date {
  font-size: 0.75rem;
  color: #9a8a6a;
  margin-bottom: 6px;
}

.col-card-excerpt {
  font-size: 0.82rem;
  color: #6a5a40;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 툴바 (쓰기/읽기 공통) */
.col-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.9rem;
  flex-shrink: 0;
}

.col-post-btn {
  background: #6e5e3a;
  color: #f5f0e8;
  border: none;
  border-radius: 4px;
  padding: 6px 18px;
  font-size: 0.85rem;
  font-family: 'Noto Serif KR', serif;
  cursor: pointer;
  transition: background 0.15s;
}
.col-post-btn:hover { background: #5a4c2e; }

/* ── 하단 탭 네비게이션 ── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 58px;
  background: #faf6ef;
  border-top: 1px solid #c4a882;
  display: flex;
  z-index: 200;
}

.bottom-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  text-decoration: none;
  color: #9a8a6a;
  font-family: 'Noto Serif KR', serif;
  font-size: 0.68rem;
  letter-spacing: 0.03em;
  transition: color 0.15s;
}

.bottom-tab:hover { color: #5a4a30; }

.bottom-tab.active { color: #2c1f0e; }

.bottom-tab svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke 0.15s;
}

.bottom-tab.active svg { stroke-width: 2.2; }


.col-delete-btn {
  background: transparent;
  color: #a05040;
  border: 1px solid #c8a090;
  border-radius: 4px;
  padding: 5px 14px;
  font-size: 0.82rem;
  font-family: 'Noto Serif KR', serif;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.col-delete-btn:hover {
  background: #a05040;
  color: #faf7f0;
  border-color: #a05040;
}

/* 쓰기 입력 */
.col-title-input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1.5px solid #c8b898;
  padding: 6px 2px 8px;
  font-size: 1.05rem;
  font-family: 'Cormorant Garamond', serif;
  color: #3a2e1e;
  margin-bottom: 0.8rem;
  outline: none;
  flex-shrink: 0;
}
.col-title-input::placeholder { color: #b0a080; }
.col-title-input:focus { border-bottom-color: #6e5e3a; }

.col-content-input {
  flex: 1;
  width: 100%;
  background: transparent;
  border: none;
  resize: none;
  font-size: 0.9rem;
  font-family: 'Noto Serif KR', serif;
  color: #3a2e1e;
  line-height: 1.8;
  outline: none;
  padding: 4px 2px;
}
.col-content-input::placeholder { color: #b0a080; }

/* 읽기 뷰 */
.col-read-body {
  overflow-y: auto;
  flex: 1;
  padding-bottom: 1.4rem;
}
.col-read-body::-webkit-scrollbar { width: 5px; }
.col-read-body::-webkit-scrollbar-thumb { background: #c8b898; border-radius: 3px; }

.col-read-title {
  font-size: 1.2rem;
  font-weight: 700;
  font-family: 'Cormorant Garamond', serif;
  color: #3a2e1e;
  margin-bottom: 6px;
}

.col-read-date {
  font-size: 0.78rem;
  color: #9a8a6a;
  margin-bottom: 1.2rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid #e0d4b8;
}

.col-read-text {
  font-size: 0.9rem;
  line-height: 1.9;
  color: #3a2e1e;
  white-space: pre-wrap;
}

/* ── 책 상세 모달 ── */
.bd-modal {
  max-width: 420px;
  width: 90%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── 메인 뷰 / 방명록 뷰 공통 ── */
.bd-main-view {
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
  padding: 2rem;
  overflow-y: auto;
  flex: 1;
}

.bd-gb-view {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

.bd-main-view.bd-hidden,
.bd-gb-view.bd-hidden { display: none; }

/* ── 방명록 행 (owner) ── */
.bd-gb-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  margin: -0.4rem 0;
  padding: 0.7rem 0;
  background: none;
  border: none;
  border-top: 1px solid #ece4d4;
  border-bottom: 1px solid #ece4d4;
  cursor: pointer;
  text-align: left;
  transition: background 0.12s;
  border-radius: 0;
}
.bd-gb-row:hover { background: #f5f0e8; }
.bd-gb-icon { font-size: 0.95rem; flex-shrink: 0; }
.bd-gb-label {
  font-family: 'Noto Serif KR', serif;
  font-size: 0.88rem;
  color: #2c1f0e;
  flex: 1;
}
.bd-gb-count {
  font-size: 0.78rem;
  color: #7a6040;
  font-family: 'Noto Serif KR', serif;
}
.bd-gb-arrow { font-size: 1.1rem; color: #9a8a6a; }

/* ── 공개 범위 토글 ── */
.bd-vis-toggle-btn {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  margin: -0.4rem 0 -1.4rem;
  padding: 0.7rem 0;
  background: none;
  border: none;
  border-bottom: 1px solid #ece4d4;
  cursor: pointer;
  text-align: left;
  transition: background 0.12s;
}
.bd-vis-toggle-btn:hover { background: #f5f0e8; }
.bd-vis-cur-icon { font-size: 0.95rem; flex-shrink: 0; }
.bd-vis-cur-label {
  font-family: 'Noto Serif KR', serif;
  font-size: 0.88rem;
  color: #2c1f0e;
  flex: 1;
}
.bd-vis-arrow { font-size: 1.1rem; color: #9a8a6a; }

.bd-vis-expand {
  display: none;
  padding: 0.6rem 0 0;
}
.bd-vis-expand.bd-vis-open { display: block; }
.bd-vis-expand .visibility-picker { padding: 0.3rem 0 0; }

/* ── 방명록 목록 뷰 ── */
.bd-gb-nav {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 1rem 2rem 0.7rem;
  border-bottom: 1px solid #e0d5c5;
  flex-shrink: 0;
}
.bd-gb-back {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.8rem;
  color: #7a6040;
  padding: 0;
  font-family: 'Noto Serif KR', serif;
  letter-spacing: 0.02em;
}
.bd-gb-back:hover { color: #2c1f0e; }
.bd-gb-nav-title {
  font-family: 'Noto Serif KR', serif;
  font-size: 0.9rem;
  font-weight: 700;
  color: #2c1f0e;
}
.bd-gb-list-content {
  overflow-y: auto;
  flex: 1;
  padding: 0.25rem 0;
  min-height: 120px;
}
.bd-gb-empty {
  text-align: center;
  padding: 2.5rem 1rem;
  font-size: 0.85rem;
  color: #9a8a6a;
  font-style: italic;
}

/* ── 방명록 작성 버튼 (profile.html) ── */
.bd-ro-gb-section {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.85rem 1.5rem 1.1rem;
  border-top: 1px solid #ece4d4;
}
.bd-ro-gb-btn {
  padding: 0.48rem 1.1rem;
  background: #3a2e1e;
  color: #f5f0e8;
  border: none;
  border-radius: 4px;
  font-family: 'Noto Serif KR', serif;
  font-size: 0.82rem;
  cursor: pointer;
  transition: background 0.18s;
  flex-shrink: 0;
}
.bd-ro-gb-btn:hover:not(:disabled) { background: #6e5e3a; }
.bd-ro-gb-btn:disabled { opacity: 0.55; cursor: default; }
.bd-ro-gb-count {
  font-size: 0.78rem;
  color: #7a6040;
  font-family: 'Noto Serif KR', serif;
}

.bd-header {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding-right: 1.5rem;
}

.bd-title {
  font-size: 1.15rem;
  font-weight: 700;
  font-family: 'Cormorant Garamond', serif;
  color: #3a2e1e;
  line-height: 1.4;
}

.bd-author {
  font-size: 0.85rem;
  color: #7a6a50;
}

/* ── 별점 ── */
.bd-rating-section {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.bd-stars {
  display: flex;
  gap: 4px;
}

.bd-star {
  font-size: 1.5rem;
  color: #d8ccb0;
  position: relative;
  line-height: 1;
}

.bd-star--full {
  color: #c8a84b;
}

.bd-star--partial::before {
  content: '★';
  position: absolute;
  left: 0;
  top: 0;
  width: var(--pct, 0%);
  overflow: hidden;
  color: #c8a84b;
  white-space: nowrap;
}

.bd-rating-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.bd-rating-row input[type="range"] {
  flex: 1;
  accent-color: #7a6a50;
  height: 4px;
  cursor: pointer;
}

.bd-rating-num {
  font-size: 1rem;
  font-weight: 700;
  color: #3a2e1e;
  min-width: 2.4rem;
  text-align: right;
}

/* ── 메모 ── */
.bd-notes-section {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.bd-notes-label {
  font-size: 0.8rem;
  color: #7a6a50;
  letter-spacing: 0.06em;
}

.bd-notes-input {
  width: 100%;
  min-height: 120px;
  resize: vertical;
  border: 1px solid #d8ccb0;
  border-radius: 6px;
  padding: 0.7rem 0.8rem;
  font-family: 'Noto Serif KR', serif;
  font-size: 0.88rem;
  color: #3a2e1e;
  background: #faf7f0;
  line-height: 1.7;
  outline: none;
  transition: border-color 0.15s;
}

.bd-notes-input:focus {
  border-color: #9a8a6a;
}

/* ── 저장 버튼 ── */
.bd-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.8rem;
}

.bd-footer-left {
  display: flex;
  gap: 8px;
}

.bd-edit-btn {
  background: none;
  color: #7a6040;
  border: 1px solid #c4a882;
  border-radius: 6px;
  padding: 0.5rem 0.9rem;
  font-family: 'Noto Serif KR', serif;
  font-size: 0.82rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.bd-edit-btn:hover { background: #ede8dc; color: #3a2e1e; }

.bd-delete-btn {
  background: none;
  color: #b05a3a;
  border: 1px solid #d4997a;
  border-radius: 6px;
  padding: 0.5rem 0.9rem;
  font-family: 'Noto Serif KR', serif;
  font-size: 0.82rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.bd-delete-btn:hover { background: #b05a3a; color: #fff; border-color: #b05a3a; }

.bd-save-btn {
  background: #3a2e1e;
  color: #f5f0e8;
  border: none;
  border-radius: 6px;
  padding: 0.55rem 1.5rem;
  font-family: 'Noto Serif KR', serif;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.15s;
}

.bd-save-btn:hover {
  background: #5a4a30;
}

/* ── 로그아웃 버튼 ── */
.logout-btn {
  background: none;
  border: 1px solid rgba(58, 46, 30, 0.25);
  border-radius: 6px;
  padding: 0.35rem 0.85rem;
  font-family: 'Noto Serif KR', serif;
  font-size: 0.8rem;
  color: #7a6a50;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
  white-space: nowrap;
}

.logout-btn:hover {
  border-color: #9a8a6a;
  color: #3a2e1e;
}

/* ── Drag and Drop ── */
.book-spine.dnd-dragging {
  opacity: 0.35;
  cursor: grabbing;
}
.cell.dnd-over {
  background: rgba(160, 120, 80, 0.1);
}
.dnd-indicator {
  width: 3px;
  align-self: stretch;
  background: #c8943a;
  border-radius: 2px;
  flex-shrink: 0;
  pointer-events: none;
}

/* ── 공개 범위 선택 (칸 선택 단계) ── */
.visibility-picker {
  display: flex;
  gap: 0.4rem;
  padding: 0.5rem 1.2rem 0.2rem;
  flex-shrink: 0;
}
.vis-opt { cursor: pointer; flex: 1; }
.vis-opt input[type="radio"] { display: none; }
.vis-opt-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.18rem;
  padding: 0.45rem 0.25rem;
  border: 1.5px solid #d8ccb0;
  border-radius: 6px;
  background: #fff;
  transition: border-color 0.15s, background 0.15s;
  text-align: center;
}
.vis-opt input[type="radio"]:checked + .vis-opt-inner {
  border-color: #3a2e1e;
  background: #faf0e0;
}
.vis-icon { font-size: 0.95rem; }
.vis-label {
  font-size: 0.62rem;
  font-family: 'Noto Serif KR', serif;
  color: #7a6040;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.vis-opt input[type="radio"]:checked + .vis-opt-inner .vis-label {
  color: #2c1f0e;
  font-weight: 700;
}

.bd-visibility-section { padding: 0 1.2rem 0.2rem; }
.bd-vis-picker { padding: 0.3rem 0 0.1rem; }
.bd-vis-picker .vis-opt input[type="radio"]:checked + .vis-opt-inner {
  border-color: #2c1f0e;
  background: #c8a87a;
}
.bd-vis-picker .vis-opt input[type="radio"]:checked + .vis-opt-inner .vis-label {
  color: #1a0f00;
  font-weight: 700;
}

/* 팔로워 비공개 책 (실루엣) */
.book-spine.bk-mystery {
  flex-shrink: 0;
  border-radius: 1px 2px 2px 1px;
  box-shadow: 1px 0 3px rgba(0,0,0,0.12);
  cursor: default;
  opacity: 0.45;
}

/* ── STAT BUTTONS (헤더 통계) ── */
.stat-row {
  display: flex;
  gap: 0.45rem;
  align-items: flex-start;
}

.stat-btn {
  background: none;
  border: 1px solid #c4a882;
  border-radius: 4px;
  padding: 0.45rem 0.9rem 0.5rem;
  font-family: 'Noto Serif KR', serif;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.12rem;
  transition: background 0.15s, border-color 0.15s;
  min-width: 62px;
}

.stat-btn:hover {
  background: #f0e8d8;
  border-color: #a07850;
}

.stat-num {
  font-size: 1.05rem;
  font-weight: 700;
  color: #2c1f0e;
  line-height: 1.3;
}

.stat-label {
  font-size: 0.7rem;
  color: #7a6040;
  letter-spacing: 0.05em;
}

/* ── 팔로우 목록 모달 ── */
.follow-list-sheet {
  background: #faf6ef;
  border: 1px solid #c4a882;
  border-radius: 4px;
  width: 100%;
  max-width: 460px;
  max-height: 72vh;
  display: flex;
  flex-direction: column;
  padding: 1.4rem 1.6rem 1.6rem;
  box-shadow: 0 24px 64px rgba(0,0,0,0.35);
  position: relative;
}

.follow-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.9rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #e0d5c0;
}

.follow-list-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #2c1f0e;
  letter-spacing: 0.04em;
}

.follow-list-content {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.follow-user-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
  color: inherit;
  padding: 0.6rem 0;
  border-bottom: 1px solid #ece4d4;
}

.follow-user-row:last-child { border-bottom: none; }

.follow-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #d4b896;
  border: 1.5px solid #a07850;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  color: #7a5530;
  overflow: hidden;
  flex-shrink: 0;
}

.follow-user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.follow-user-info {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.follow-user-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: #2c1f0e;
}

.follow-user-handle {
  font-size: 0.72rem;
  color: #7a6040;
}

.follow-list-empty {
  padding: 2rem 0;
  text-align: center;
  font-size: 0.85rem;
  color: #9a8a6a;
}

/* ── 친한 친구 진입 버튼 ── */
.cf-entry-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  padding: 0.7rem 0;
  margin-bottom: 0.3rem;
  background: none;
  border: none;
  border-bottom: 1px solid #e0d5c0;
  cursor: pointer;
  text-align: left;
}
.follow-list-content.hidden { display: none; }
.cf-entry-row.hidden { display: none; }
.cf-entry-icon { font-size: 0.95rem; flex-shrink: 0; }
.cf-entry-label {
  flex: 1;
  font-family: 'Noto Serif KR', serif;
  font-size: 0.88rem;
  font-weight: 700;
  color: #2c1f0e;
}
.cf-entry-count {
  font-size: 0.76rem;
  color: #7a6040;
  font-family: 'Noto Serif KR', serif;
}
.cf-entry-arrow { font-size: 1.1rem; color: #9a8a6a; }

/* ── 친한 친구 설정 패널 ── */
.cf-panel {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
.cf-panel.hidden { display: none; }

.cf-panel-nav {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding-bottom: 0.6rem;
  margin-bottom: 0.35rem;
  border-bottom: 1px solid #e0d5c0;
}
.cf-back-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.8rem;
  color: #7a6040;
  padding: 0;
  font-family: 'Noto Serif KR', serif;
  letter-spacing: 0.02em;
}
.cf-back-btn:hover { color: #2c1f0e; }
.cf-panel-title {
  font-family: 'Noto Serif KR', serif;
  font-size: 0.88rem;
  font-weight: 700;
  color: #2c1f0e;
}
.cf-panel-desc {
  font-size: 0.74rem;
  color: #7a6040;
  font-family: 'Noto Serif KR', serif;
  line-height: 1.5;
  padding-bottom: 0.55rem;
  margin-bottom: 0.3rem;
  border-bottom: 1px solid #ece4d4;
}
.cf-toggle {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.15rem;
  padding: 0.1rem 0.25rem;
  flex-shrink: 0;
  margin-left: auto;
  line-height: 1;
  color: #c0b090;
}
.cf-toggle.active { color: #c8a84b; }
.cf-panel .follow-user-info { flex: 1; }

/* ── 책 목록 모달 ── */
.bl-modal {
  max-width: 480px;
  width: 90%;
  padding: 0;
}
.bl-header {
  display: flex;
  align-items: center;
  padding: 1.2rem 1.5rem 0.8rem;
  border-bottom: 1px solid #e0d5c5;
  flex-shrink: 0;
}
.bl-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: #2c1f0e;
  flex: 1;
}
.bl-sort-tabs {
  display: flex;
  gap: 0.4rem;
  padding: 0.55rem 1.5rem;
  border-bottom: 1px solid #e0d5c5;
  flex-shrink: 0;
}
.bl-sort-btn {
  padding: 0.26rem 0.8rem;
  border-radius: 20px;
  border: 1px solid #d8ccb0;
  background: transparent;
  font-family: 'Noto Serif KR', serif;
  font-size: 0.74rem;
  color: #9a8a6a;
  cursor: pointer;
  transition: all 0.15s;
}
.bl-sort-btn.active {
  background: #3a2e1e;
  border-color: #3a2e1e;
  color: #f5f0e8;
}
.bl-sort-btn:hover:not(.active) {
  background: #f5f0e8;
  border-color: #c4a882;
  color: #5a4a30;
}
.bl-list {
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  padding: 0.25rem 0;
}
.bl-empty {
  text-align: center;
  color: #b8a88a;
  font-size: 0.85rem;
  padding: 2.5rem 1rem;
  font-family: 'Noto Serif KR', serif;
}
.bl-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.7rem 1.5rem;
  border-bottom: 1px solid #ece4d4;
  cursor: pointer;
  transition: background 0.12s;
}
.bl-item:last-child { border-bottom: none; }
.bl-item:hover { background: #f5f0e8; }
.bl-item-cover {
  width: 36px;
  height: 54px;
  border-radius: 2px;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 1px 1px 5px rgba(58,46,30,0.18);
}
.bl-item-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bl-item-cover-ph {
  width: 36px;
  height: 54px;
  border-radius: 2px;
  flex-shrink: 0;
  box-shadow: 1px 1px 5px rgba(58,46,30,0.15);
}
.bl-item-info { flex: 1; min-width: 0; }
.bl-item-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.88rem;
  font-weight: 700;
  color: #2c1f0e;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0.1rem;
}
.bl-item-author {
  font-size: 0.73rem;
  color: #7a6040;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0.16rem;
}
.bl-item-stars { display: flex; align-items: center; gap: 1px; }
.bl-item-star { color: #d8ccb0; font-size: 0.67rem; }
.bl-item-star.full { color: #c8943a; }
.bl-item-rating-num { font-size: 0.67rem; color: #9a8a6a; margin-left: 0.2rem; }
.bl-vis-badge {
  font-size: 0.64rem;
  padding: 0.12rem 0.45rem;
  border-radius: 10px;
  flex-shrink: 0;
  line-height: 1.6;
  font-family: 'Noto Serif KR', serif;
}
.bl-vis-badge.followers { background: #e8f0e8; color: #4a7a4a; }
.bl-vis-badge.close-friends { background: #fdf5e0; color: #8a6a20; }
.bl-item-mystery {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.7rem 1.5rem;
  border-bottom: 1px solid #ece4d4;
}
.bl-item-mystery:last-child { border-bottom: none; }
.bl-mystery-cover {
  width: 36px;
  height: 54px;
  border-radius: 2px;
  background: linear-gradient(135deg, #d8ccb0, #c0b090);
  flex-shrink: 0;
  box-shadow: 1px 1px 5px rgba(58,46,30,0.12);
}
.bl-mystery-text {
  font-family: 'Noto Serif KR', serif;
  font-size: 0.8rem;
  color: #b8a88a;
  font-style: italic;
}

/* ── 간판 위젯 ── */
.book-sign {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 88px;
  min-width: 72px;
  max-width: 130px;
  padding: 0 3px;
  cursor: grab;
  user-select: none;
  position: relative;
  flex-shrink: 0;
}
.book-sign:active { cursor: grabbing; }
.book-sign:hover .sign-panel { filter: brightness(0.95); }

.sign-rope-svg {
  width: 100%;
  display: block;
  flex-shrink: 0;
}

.sign-panel {
  background: #f8f4e0;
  border: 2px solid #7a5228;
  border-radius: 3px;
  position: relative;
  width: 92%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 7px 10px;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.1), 2px 3px 8px rgba(0,0,0,0.25);
  overflow: hidden;
}
.sign-panel::before {
  content: '';
  position: absolute;
  inset: 4px;
  border: 1px solid rgba(122,82,40,0.35);
  border-radius: 1px;
  pointer-events: none;
}

.sign-text {
  color: #3a2210;
  font-family: 'Noto Serif KR', serif;
  font-size: 0.7rem;
  font-weight: 700;
  text-align: center;
  line-height: 1.55;
  word-break: keep-all;
  white-space: pre-wrap;
  position: relative;
  z-index: 1;
}

.book-sign.dnd-dragging {
  opacity: 0.35;
  cursor: grabbing;
}

/* ── 간판 편집 팝오버 ── */
.sign-popup {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: #2c1f0e;
  border: 1px solid #7a6a50;
  border-radius: 10px;
  padding: 0.35rem;
  display: flex;
  gap: 2px;
  z-index: 60;
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}
.sign-popup-btn {
  background: none;
  border: none;
  color: #f0d5a0;
  font-family: 'Noto Serif KR', serif;
  font-size: 0.78rem;
  cursor: pointer;
  padding: 0.3rem 0.65rem;
  border-radius: 7px;
}
.sign-popup-btn:hover { background: rgba(255,255,255,0.12); }
.sign-popup-del { color: #e09080; }

/* ── 장식 추가 FAB ── */
.decor-fab-wrap { position: relative; }

.decor-menu {
  background: #2c1f0e;
  border: 1px solid #7a6a50;
  border-radius: 12px;
  padding: 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 2px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  white-space: nowrap;
  z-index: 200;
  transform-origin: bottom right;
  animation: fabMenuIn 0.15s ease;
}
.decor-menu.hidden { display: none; }
@keyframes fabMenuIn {
  from { opacity: 0; transform: scale(0.92) translateY(6px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.decor-menu-item {
  background: none;
  border: none;
  color: #f0d5a0;
  font-family: 'Noto Serif KR', serif;
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0.45rem 1rem;
  border-radius: 8px;
  text-align: left;
  letter-spacing: 0.02em;
}
.decor-menu-item:hover { background: rgba(255,255,255,0.1); }

/* ── 간판 모달 ── */
.sign-modal-inner {
  max-width: 320px;
  width: 90%;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 1.8rem 1.6rem;
}

.sign-modal-hint {
  font-size: 0.8rem;
  color: #7a6a50;
  font-family: 'Noto Serif KR', serif;
}

.sign-text-input {
  width: 100%;
  height: 72px;
  padding: 0.65rem 0.8rem;
  border: 1px solid #c4a882;
  border-radius: 8px;
  font-family: 'Noto Serif KR', serif;
  font-size: 0.92rem;
  background: #faf6ef;
  color: #2c1f0e;
  resize: none;
  line-height: 1.5;
}
.sign-text-input:focus { outline: none; border-color: #7a6a50; box-shadow: 0 0 0 2px rgba(122,106,80,0.15); }

.sign-char-count {
  font-size: 0.72rem;
  color: #9a8a6a;
  text-align: right;
  margin-top: -0.5rem;
  font-family: 'Noto Serif KR', serif;
}

.sign-confirm-btn {
  background: #3a2e1e;
  color: #f5f0e8;
  border: none;
  border-radius: 8px;
  padding: 0.6rem 1rem;
  font-family: 'Noto Serif KR', serif;
  font-size: 0.88rem;
  cursor: pointer;
  transition: background 0.15s;
  width: 100%;
}
.sign-confirm-btn:hover:not(:disabled) { background: #5a4a30; }
.sign-confirm-btn:disabled { opacity: 0.45; cursor: default; }

/* ── 맞춤 추천 섹션 ── */
.rec-section {
  width: 100%;
  max-width: 640px;
  margin-top: 1.8rem;
}

.rec-header {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.9rem;
}

.rec-title {
  font-family: 'Cormorant Garamond', 'Noto Serif KR', serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: #2c1f0e;
  letter-spacing: 0.02em;
}

.rec-label {
  font-size: 0.7rem;
  color: #9a8a6a;
  font-family: 'Noto Serif KR', serif;
}

.rec-scroll {
  display: flex;
  gap: 0.85rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  scrollbar-width: none;
}
.rec-scroll::-webkit-scrollbar { display: none; }

.rec-card {
  flex: 0 0 96px;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.rec-card-cover {
  width: 96px;
  height: 136px;
  border-radius: 4px;
  overflow: hidden;
  background: #e4dac8;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 2px 2px 6px rgba(0,0,0,0.12);
}

.rec-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.rec-card-placeholder {
  font-size: 0.58rem;
  color: #9a8a6a;
  text-align: center;
  padding: 8px;
  font-family: 'Noto Serif KR', serif;
  line-height: 1.4;
}

.rec-card-title {
  font-size: 0.7rem;
  font-family: 'Noto Serif KR', serif;
  color: #2c1f0e;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.45;
}

.rec-card-author {
  font-size: 0.62rem;
  color: #7a6a50;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rec-attribution {
  font-size: 0.58rem;
  color: #b0a090;
  margin-top: 0.75rem;
  text-align: right;
  font-family: 'Noto Serif KR', serif;
}

/* ═══════════════════════════════════════════
   모바일 반응형 (≤ 600px)
   PC 디자인 그대로 유지, 모바일에서만 오버라이드
═══════════════════════════════════════════ */
@media (max-width: 600px) {

  /* ── 헤더: 세로로 쌓고 여백 축소 ── */
  header {
    padding: 1.1rem 1rem 0.9rem;
    flex-direction: column;
    gap: 0.75rem;
    align-items: stretch;
  }

  .header-left {
    gap: 0.85rem;
    align-items: center;
  }

  .profile-photo {
    width: 56px;
    height: 56px;
    font-size: 22px;
  }

  .header-title h1 {
    font-size: 1.3rem;
  }

  .header-title .tagline {
    margin-top: 0.2rem;
  }

  .header-title .intro {
    max-width: 100%;
    font-size: 0.78rem;
    margin-top: 0.4rem;
  }

  .header-right {
    align-items: flex-start;
    width: 100%;
  }

  /* stat 버튼 4개가 균등 배분되도록 */
  .stat-row {
    width: 100%;
    justify-content: space-between;
  }

  .stat-btn {
    min-width: 0;
    flex: 1;
    padding: 0.38rem 0.3rem 0.42rem;
  }

  .stat-num {
    font-size: 0.95rem;
  }

  .stat-label {
    font-size: 0.62rem;
  }

  /* ── 메인: 여백 ── */
  main {
    padding: 2rem 1.2rem calc(2rem + 58px);
  }

  /* ── 책장 프레임 간격 축소 ── */
  .shelf-frame {
    padding: 7px;
  }
  .frame-bar {
    height: 9px;
    margin-bottom: 4px;
  }
  .frame-bar.bottom {
    margin-top: 4px;
  }
  .shelf-row {
    margin-bottom: 4px;
  }
  .shelf-row-outer {
    margin-bottom: 4px;
  }

  /* ── 책장 셀: 높이 고정 (내용물로 늘어나지 않게) ── */
  .shelf-row {
    align-items: flex-start;
  }
  .shelf-row .cell {
    flex-shrink: 0;
    overflow: hidden;
    max-height: none;
    min-height: unset;
  }

  /* ── 책장 수정 모드: 행 삭제 버튼을 셀 안쪽 우상단으로 ── */
  .shelf-row-delete {
    right: 4px;
    top: 6px;
    transform: none;
    font-size: 0.72rem;
    padding: 0.4rem 0.75rem;
    min-height: 32px;
  }

  /* ── 모달 공통: 여백 줄이고 화면 많이 활용 ── */
  .modal-overlay {
    padding: 0.5rem;
  }

  .modal {
    max-height: 92vh;
  }

  /* ── 표지 선택 모달: 미리보기 + 오른쪽 패널을 세로로 ── */
  .cover-middle {
    flex-direction: column;
  }

  .preview-area {
    padding: 1.2rem 1rem 0.8rem;
    min-width: 0;
    justify-content: center;
  }

  .cover-right-panel {
    border-left: none;
    border-top: 1px solid #e0d5c5;
    max-height: 220px;
  }

  /* ── 팔로우 목록 시트: 여백 축소 ── */
  .follow-list-sheet {
    padding: 1rem 1rem 1.2rem;
    max-height: 82vh;
  }

  /* ── 책 목록 모달: 너비 100% 사용 ── */
  .bl-modal {
    width: 100%;
  }

  /* ── FAB 버튼: 약간 위로 올려서 nav bar와 여유 확보 ── */
  /* 모바일: 기존 fab-group은 기본적으로 숨김 */
  .fab-group {
    bottom: 120px;
    right: 12px;
    display: none;
    pointer-events: none;
  }
  .fab-group.fab-open {
    display: flex;
    pointer-events: auto;
    animation: fabMenuIn 0.15s ease;
  }

  /* 모바일 수정 버튼 표시 */
  #mobile-edit-fab {
    display: block;
    position: fixed;
    bottom: 68px;
    right: 12px;
    z-index: 190;
  }
  #mobile-edit-fab.fab-active {
    background: #5a4a30;
  }

  /* ── 칸 선택 그리드: 너무 많은 여백 제거 ── */
  .shelf-pick-grid {
    padding: 0 0.3rem;
  }

}
