#book-action {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  min-height: 44px; padding: .55rem .9rem; border: 1px solid #f7eed7c4; border-radius: 30px;
  background: #314438; color: #fffaf0; box-shadow: 0 3px 12px #17201640;
  font: 650 .94rem/1.2 system-ui,sans-serif; cursor: pointer; touch-action: manipulation;
}
#book-action .book-symbol { display: inline-block; position: relative; width: 18px; height: 14px; }
.book-symbol::before,.book-symbol::after {
  content: ''; position: absolute; top: 1px; width: 7px; height: 11px;
  border: 1.2px solid currentColor; border-radius: 2px 2px 0 0;
}
.book-symbol::before { left: 0; transform: skewY(10deg); }
.book-symbol::after { right: 0; transform: skewY(-10deg); }
#book-action[hidden],#book-dialog [hidden],#book-notice[hidden] { display: none; }
#book-notice {
  position: absolute; z-index: 4; top: 29%; left: 50%; transform: translateX(-50%);
  width: max-content; max-width: calc(100% - 26px); margin: 0; padding: 8px 15px; border-radius: 9px;
  background: #23392fee; color: #fcfbef; text-align: center; pointer-events: none;
  font: 550 .91rem/1.5 system-ui,sans-serif;
}
#book-dialog {
  --paper: #faf8f1; --ink: #25332c; --rule: #dad7cb; --jacket: #475744;
  padding: 0; width: min(660px,calc(100vw - 28px)); max-width: 100%;
  max-height: calc(100dvh - max(26px,env(safe-area-inset-top) + env(safe-area-inset-bottom)));
  color: var(--ink); background: var(--paper); border: 1px solid #c9c6b9; border-radius: 14px;
  box-shadow: 0 20px 80px #10231d5c; overflow: hidden; touch-action: pan-y;
}
#book-dialog[open] { display: flex; flex-direction: column; }
#book-dialog::backdrop { background: #101b17ba; }
#book-dialog .book-toolbar {
  flex: none; display: flex; align-items: center; justify-content: space-between; gap: 14px;
  min-height: 62px; padding: 12px clamp(16px,4.5vw,32px) 10px;
  border-bottom: 1px solid var(--rule); background: #f8f6ed;
}
#book-heading,#book-leaf h3,#book-dialog .book-name strong {
  font-family: 'Noto Serif KR','Nanum Myeongjo','Batang',Georgia,serif;
  word-break: keep-all; overflow-wrap: anywhere;
}
#book-heading { margin: 0; font-size: clamp(1.28rem,4.6vw,1.7rem); line-height: 1.35; letter-spacing: -.045em; }
#book-genre,#book-dialog .book-name small {
  display: block; font: 600 .78rem/1.4 system-ui,sans-serif; letter-spacing: .025em; color: #526353;
}
#book-close {
  min-width: 44px; min-height: 44px; flex: none; margin: 0 -8px 0 0;
  border: 0; border-radius: 50%; color: var(--ink); background: transparent; cursor: pointer;
  font: 400 1.75rem/1 system-ui,sans-serif;
}
#book-close:hover { background: #eae9dd; }
#book-dialog .book-scroll {
  min-height: 0; overflow: auto; overscroll-behavior: contain; touch-action: pan-y;
  scrollbar-width: thin; scrollbar-color: #b8b7a8 transparent;
}
#book-browse { padding: 0 clamp(16px,4.5vw,32px) 20px; }
#book-dialog .book-instruction { margin: 15px 0 19px; color: #4a5b50; font: 400 .94rem/1.6 system-ui,sans-serif; }
#book-list { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 23px 18px; }
#book-list .book-choice {
  --jacket: #5a6658;
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
  min-width: 0; padding: 3px; margin: 0; text-align: left;
  border: 0; border-radius: 4px; background: transparent; cursor: pointer; color: var(--ink);
  touch-action: manipulation;
}
#book-list .book-jacket {
  display: block; width: 100%; height: auto; aspect-ratio: 194/246; object-fit: cover;
  background: var(--jacket); border-radius: 1px 2px 2px 1px;
  box-shadow: 1px 1px #ddd4bf, 2px 2px #c4b8a0, 3px 3px #e9e2d5, 3px 5px 7px #36271625;
}
#book-dialog .book-choice:not(:disabled):hover .book-jacket { box-shadow: 1px 2px #d6cbb6, 3px 5px 9px #36271650; }
#book-dialog .book-name { display: block; width: 100%; }
#book-dialog .book-name strong { display: block; font-size: 1rem; line-height: 1.35; margin-top: 2px; }
#book-dialog .book-pick {
  position: absolute; top: 9px; right: 8px; display: block; width: 1px; height: 1px;
  clip-path: inset(50%); overflow: hidden; white-space: nowrap;
}
#book-dialog .is-held .book-pick {
  width: auto; height: auto; clip-path: none; border-radius: 12px; padding: 3px 8px;
  color: #fff; background: #2d4538; font: 650 .76rem/1.4 system-ui,sans-serif;
}
#book-list .book-choice:disabled { cursor: default; }
#book-dialog button:focus-visible,#book-leaf:focus-visible { outline: 3px solid #8a5429; outline-offset: 1px; }
#book-shelf-foot,#book-read-foot {
  flex: none; display: flex; justify-content: space-between; align-items: center; gap: 9px;
  padding: 8px clamp(16px,4.5vw,32px); border-top: 1px solid var(--rule); background: #f4f2e8;
  font: 500 .9rem/1.4 system-ui,sans-serif;
}
#book-shelf-foot button,#book-read-foot button {
  flex: none; min-height: 44px; padding: 5px 15px; background: transparent;
  border: 1px solid #b8bfaf; border-radius: 24px; color: #304637;
  font: 650 .92rem/1.3 system-ui,sans-serif; cursor: pointer; touch-action: manipulation;
}
#book-read-foot #book-reader-next { background: #304637; color: #fffdf0; border-color: #304637; }
#book-read-foot button:disabled { opacity: .45; cursor: default; }
#book-folio { color: #536153; font-variant-numeric: tabular-nums; white-space: nowrap; }
#book-dialog[data-mode='reader'] { width: min(620px,calc(100vw - 24px)); border-inline-start: 5px solid var(--jacket); }
#book-leaf {
  padding: clamp(16px,4vh,32px) clamp(20px,6vw,54px); min-height: min(210px,28dvh);
  font: 400 clamp(1.04rem,3.7vw,1.16rem)/1.9 'Noto Serif KR','Nanum Myeongjo','Batang',Georgia,serif;
  letter-spacing: -.014em; word-break: keep-all; overflow-wrap: anywhere; color: #262e28;
  user-select: text; -webkit-user-select: text; background: linear-gradient(90deg,#eae5d5 0%,#faf8f1 10px);
}
#book-leaf h3 { margin: .15em 0 1.1em; font-size: 1.12em; line-height: 1.55; }
#book-leaf p { margin: 0 0 1.05em; white-space: pre-line; }
#book-leaf p:last-child { margin-bottom: .3em; }
#book-dialog[data-genre='시집'] #book-leaf { line-height: 1.95; }
#book-leaf .book-panel { display: block; width: 100%; height: auto; margin: 0 auto 1em; }
#book-dialog[data-genre='만화'] #book-leaf p { font-family: system-ui,sans-serif; }
#book-status { margin: 0; padding: 10px clamp(16px,4.5vw,32px); font: 600 .91rem/1.5 system-ui,sans-serif; color: #704931; }
@media (max-width: 520px) {
  #book-list { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px 10px; }
  #book-dialog .book-name strong { font-size: .94rem; }
}
@media (max-width: 345px) {
  #book-list { grid-template-columns: repeat(2,minmax(0,1fr)); }
  #book-shelf-foot,#book-read-foot { padding-inline: 12px; }
  #book-action { padding-inline: .65rem; }
}
@media (max-height: 465px) {
  #book-dialog .book-toolbar { min-height: 44px; padding-block: 1px; }
  #book-shelf-foot,#book-read-foot { padding-block: 3px; }
  #book-leaf { padding-block: 14px; }
  #book-action { min-height: 38px; }
}
