/* E-book library (EbookShelf). In the "room" layout every anchored control
   is sized in world pixels and placed with transform: translate(screen) +
   scale(camera zoom) by EbookShelf.positionControls(). In the "sheet" layout
   (phones, short windows) search and detail use fixed screen positions. */
.ebook-library-ui { position: fixed; inset: 0; z-index: 12; pointer-events: none; font-family: system-ui, -apple-system, "Segoe UI", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif; }
.ebook-library-ui .elib-anchor { position: absolute; left: 0; top: 0; box-sizing: border-box; transform-origin: 0 0; pointer-events: auto; }
.ebook-library-ui button { font: inherit; cursor: pointer; touch-action: manipulation; }
.ebook-library-ui :focus-visible { outline: 3px solid #ffd27a; outline-offset: 2px; }

/* Search: a cream capsule on the plate's search board. */
.elib-search { height: auto !important; }
.elib-search input { box-sizing: border-box; width: 100%; height: 50px; padding: 0 56px 0 26px; border: 2px solid rgba(171, 128, 74, 0.55); border-radius: 25px; background: #fbf4e6; color: #3a2a1a; font: 500 22px/1 inherit; box-shadow: inset 0 2px 4px rgba(90, 60, 25, 0.12), 0 4px 14px rgba(70, 40, 10, 0.18); }
.elib-search input::placeholder { color: #9a8467; }
.elib-search input::-webkit-search-cancel-button { display: none; }
.elib-clear { position: absolute; top: 7px; right: 10px; width: 36px; height: 36px; border: 0; border-radius: 50%; background: #e9dcc4; color: #5a4128; font-size: 24px; line-height: 1; }
.elib-clear[hidden] { display: none; }
.elib-results { margin-top: 8px; padding: 8px; border-radius: 16px; background: rgba(255, 250, 240, 0.98); box-shadow: 0 14px 40px rgba(40, 22, 6, 0.32); max-height: 420px; overflow: auto; }
.elib-results[hidden] { display: none; }
.elib-results button { display: grid; gap: 3px; width: 100%; padding: 12px 16px; border: 0; border-radius: 10px; background: transparent; color: #3a2a1a; text-align: left; }
.elib-results button:hover, .elib-results button:focus-visible { background: #f1e3c8; }
.elib-results strong { font-size: 20px; }
.elib-results span { font-size: 16px; color: #806a4f; }
.elib-note { margin: 0; padding: 12px 16px; color: #6d5a43; font-size: 18px; }

/* Carousel controls on the stage. */
.elib-arrow { width: 52px; height: 52px; padding: 0; border: 2px solid rgba(255, 238, 205, 0.8); border-radius: 50%; background: rgba(54, 34, 18, 0.72); color: #fff3dc; font-size: 34px; line-height: 1; box-shadow: 0 4px 14px rgba(30, 15, 4, 0.35); }
.elib-arrow:disabled { opacity: 0.35; cursor: default; }
.elib-dots { display: flex; justify-content: center; align-items: center; gap: 10px; pointer-events: none; }
.elib-dots button { width: 14px; height: 14px; padding: 0; border: 0; border-radius: 50%; background: rgba(255, 244, 222, 0.5); pointer-events: auto; }
.elib-dots button[aria-current="true"] { background: #fff6e2; box-shadow: 0 0 8px rgba(255, 220, 150, 0.9); }
.elib-caption { display: flex; justify-content: center; pointer-events: auto; }
.elib-caption span { max-width: 100%; padding: 4px 16px; border-radius: 16px; background: rgba(48, 30, 16, 0.72); color: #fff4df; font: 600 16px/1.5 inherit; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ebook-library-ui[data-state="error"] .elib-caption span, .ebook-library-ui[data-state="empty"] .elib-caption span { white-space: normal; }

/* Detail display: dark glass over the plate's right-hand frame. */
.elib-panel { display: flex; flex-direction: column; padding: 22px 24px; border-radius: 22px; background: linear-gradient(160deg, #22293a, #161b28); color: #eef2fa; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 10px 30px rgba(0, 0, 0, 0.3); }
.elib-panel-body { display: flex; flex-direction: column; gap: 14px; min-height: 0; height: 100%; }
.elib-panel-eyebrow { margin: 0; color: #f2c879; font-size: 15px; font-weight: 700; letter-spacing: 0.06em; }
.elib-panel-head { display: grid; grid-template-columns: 118px 1fr; gap: 16px; align-items: start; }
.elib-panel-cover { width: 118px; aspect-ratio: 2 / 3; border-radius: 6px; background: #394460; overflow: hidden; box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35); }
.elib-panel-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.elib-panel-identity h3 { margin: 0 0 8px; font-size: 23px; line-height: 1.3; color: #fff; word-break: keep-all; }
.elib-panel-subtitle { margin: 0 0 8px; color: #c7cfdf; font-size: 15px; line-height: 1.45; }
.elib-panel-byline { margin: 0; color: #aeb9cf; font-size: 15px; }
.elib-panel-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.elib-panel-tags li { padding: 4px 12px; border: 1px solid rgba(160, 182, 222, 0.45); border-radius: 14px; color: #d4def2; font-size: 14px; }
.elib-panel-description { flex: 1 1 auto; min-height: 0; margin: 0; overflow: auto; color: #dfe5f1; font-size: 17px; line-height: 1.6; white-space: pre-line; word-break: keep-all; }
.elib-panel-action { flex: 0 0 auto; min-height: 54px; border: 1px solid rgba(255, 255, 255, 0.5); border-radius: 12px; background: #e9edf5; color: #1b2436; font-size: 19px; font-weight: 700; }
.elib-panel-action:hover { background: #fff; }
.elib-panel .elib-note { color: #c9d2e3; padding: 0; }
.elib-sheet-close, .elib-sheet-open { display: none; }
.elib-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); margin: 0; padding: 0; }

/* Phones / short windows. */
/* Phones: EbookShelf places the search unscaled on the board (screen px). */
.ebook-library-ui[data-layout="sheet"] .elib-search input { height: 44px; font-size: 16px; padding-left: 18px; }
.ebook-library-ui[data-layout="sheet"] .elib-clear { top: 6px; width: 32px; height: 32px; font-size: 20px; }
.ebook-library-ui[data-layout="sheet"] .elib-results strong { font-size: 16px; }
.ebook-library-ui[data-layout="sheet"] .elib-results span, .ebook-library-ui[data-layout="sheet"] .elib-note { font-size: 14px; }
.ebook-library-ui[data-layout="sheet"] .elib-panel { top: auto; left: 0; right: 0; bottom: 0; width: auto !important; height: auto !important; max-height: 48vh; transform: none !important; border-radius: 20px 20px 0 0; padding: 16px 18px calc(16px + env(safe-area-inset-bottom, 0px)); display: none; }
.ebook-library-ui[data-layout="sheet"].is-sheet-open .elib-panel { display: flex; }
.ebook-library-ui[data-layout="sheet"] .elib-panel-head { grid-template-columns: 76px 1fr; }
.ebook-library-ui[data-layout="sheet"] .elib-panel-cover { width: 76px; }
.ebook-library-ui[data-layout="sheet"] .elib-panel-identity h3 { font-size: 18px; }
.ebook-library-ui[data-layout="sheet"] .elib-panel-description { font-size: 14px; max-height: 22vh; }
.ebook-library-ui[data-layout="sheet"] .elib-panel-action { min-height: 46px; font-size: 16px; }
.ebook-library-ui[data-layout="sheet"] .elib-sheet-close { display: block; position: absolute; top: 8px; right: 10px; width: 36px; height: 36px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.12); color: #fff; font-size: 22px; }
.ebook-library-ui[data-layout="sheet"] .elib-sheet-open:not([hidden]) { display: block; position: fixed; left: 50%; bottom: calc(104px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); padding: 10px 20px; border: 1px solid rgba(255, 255, 255, 0.5); border-radius: 22px; background: rgba(28, 34, 50, 0.92); color: #fff; font-size: 15px; font-weight: 700; pointer-events: auto; }
/* 「읽기」: opens the Coding Campus web PDF reader (EbookReaderLink.js) */
.elib-panel-action.elib-panel-read { background: #ffd45a; color: #1c2333; border-color: #ffd45a; font-weight: 700; margin-bottom: 8px; }
