:root {
    --ink: #15243c;
    --muted: #6f7b8c;
    --line: #dde3ec;
    --paper: #f7f8fb;
    --blue: #174f93;
    --blue-2: #2c6ab4;
    --navy: #101d38;
    --mint: #dff2ea;
    --shadow: 0 20px 55px rgba(23, 37, 61, .12);
    font-family: "Pretendard", "Noto Sans KR", "Malgun Gothic", system-ui, sans-serif;
    color: var(--ink);
    background: var(--paper);
    font-synthesis: none;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--paper); }
button, input, textarea, select { font: inherit; }
button, a { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { color: inherit; appearance: none; -webkit-appearance: none; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(44, 106, 180, .32); outline-offset: 2px; }
button:disabled { cursor: default; filter: saturate(.7); }
.muted { color: var(--muted); }
.eyebrow { display: inline-block; color: var(--blue); font-size: 11px; font-weight: 800; letter-spacing: .16em; }
.eyebrow.light { color: #a9c5ee; }

.topbar {
    height: 72px; padding: 0 max(28px, calc((100vw - 1240px) / 2)); display: flex; align-items: center; justify-content: space-between;
    background: rgba(255, 255, 255, .92); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; backdrop-filter: blur(16px);
}
.brand { display: inline-flex; align-items: center; gap: 11px; }
.brand-mark { width: 37px; height: 37px; display: grid; place-items: center; color: white; background: var(--blue); border-radius: 10px 4px 10px 4px; font-size: 17px; font-weight: 900; box-shadow: 0 8px 20px rgba(23, 79, 147, .23); }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 16px; }
.brand small { margin-top: 2px; color: #8490a0; font-size: 8px; letter-spacing: .16em; }
.brand.compact .brand-mark { width: 34px; height: 34px; }
.topnav { display: flex; align-items: center; gap: 22px; font-size: 13px; font-weight: 700; }
.topnav a:hover { color: var(--blue); }
.topnav form { margin: 0; }
.user-chip { padding: 8px 12px; border-radius: 99px; background: #eef3fa; color: var(--blue); }
.link-button { padding: 0; border: 0; background: none; cursor: pointer; color: var(--muted); font-size: 12px; }

.page-shell { width: min(1240px, calc(100% - 48px)); margin: 0 auto; padding: 56px 0 80px; }
.welcome-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.welcome-row h1 { margin: 9px 0 8px; font-size: clamp(28px, 3vw, 40px); line-height: 1.2; letter-spacing: -.045em; }
.welcome-row p { margin: 0; }
.date-card { width: 106px; height: 106px; padding: 18px; display: flex; flex-direction: column; align-items: center; justify-content: center; border: 1px solid var(--line); background: white; border-radius: 24px 8px 24px 8px; box-shadow: 0 14px 35px rgba(31, 47, 70, .08); }
.date-card strong { color: var(--blue); font-family: Georgia, serif; font-size: 29px; }
.date-card span { color: var(--muted); font-size: 12px; }
.section-heading { margin: 54px 0 20px; display: flex; align-items: flex-end; justify-content: space-between; }
.section-heading h2 { margin: 6px 0 0; font-size: 22px; letter-spacing: -.03em; }
.count-pill { padding: 7px 11px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 99px; color: var(--muted); background: white; font-size: 12px; line-height: 1.2; white-space: nowrap; }
.book-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; }
.book-card { display: grid; grid-template-columns: 42% 58%; min-height: 345px; overflow: hidden; background: white; border: 1px solid #e2e7ef; border-radius: 24px 10px 24px 10px; box-shadow: 0 16px 45px rgba(30, 48, 73, .08); transition: transform .2s, box-shadow .2s; }
.book-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.book-cover { position: relative; overflow: hidden; background: #14203e; }
.book-cover img { width: 200%; height: 100%; display: block; object-fit: cover; object-position: right center; filter: saturate(.9); }
.book-cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, rgba(5, 15, 35, .65)); }
.secure-badge { position: absolute; z-index: 2; left: 16px; bottom: 16px; padding: 7px 10px; border: 1px solid rgba(255,255,255,.35); border-radius: 99px; color: white; background: rgba(15, 33, 65, .7); backdrop-filter: blur(8px); font-size: 10px; }
.book-info { padding: 30px; display: flex; flex-direction: column; align-items: flex-start; }
.book-meta { width: 100%; display: flex; justify-content: space-between; color: #8691a1; font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.book-info h3 { margin: 18px 0 10px; font-size: 24px; letter-spacing: -.04em; }
.book-info p { margin: 0; min-height: 54px; color: var(--muted); font-size: 13px; line-height: 1.65; }
.access-period { margin: auto 0 18px; width: 100%; padding: 12px 0; display: flex; justify-content: space-between; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.access-period strong { color: var(--ink); font-weight: 700; }
.primary-button, .secondary-button { min-height: 43px; padding: 0 18px; display: inline-flex; align-items: center; justify-content: center; gap: 28px; border: 0; border-radius: 10px 4px 10px 4px; cursor: pointer; font-weight: 800; font-size: 13px; line-height: 1.2; text-align: center; transition: .2s; }
.primary-button { color: white; background: var(--blue); box-shadow: 0 10px 25px rgba(23, 79, 147, .22); }
.primary-button:hover { background: #0d3f7d; transform: translateY(-1px); }
.secondary-button { color: var(--blue); background: #eaf1fa; border: 1px solid #cddbed; }
.secondary-button:hover { background: #dce9f8; }
.wide { width: 100%; }
.security-note { margin-top: 34px; padding: 20px 24px; display: flex; align-items: center; gap: 16px; border: 1px solid #d8e3ef; background: #f0f5fb; border-radius: 16px; }
.security-note p, .security-note strong { margin: 0; }
.security-note p { margin-top: 4px; color: var(--muted); font-size: 12px; }
.security-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; color: var(--blue); background: white; font-weight: 900; }
.empty-state { padding: 70px; text-align: center; background: white; border: 1px dashed #ccd5e0; border-radius: 20px; }
.empty-state p { color: var(--muted); }
.library-toolbar { margin-bottom: 10px; padding: 12px; display: grid; grid-template-columns: minmax(280px, 1fr) 150px 180px auto; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 16px; background: white; box-shadow: 0 10px 30px rgba(30,48,73,.05); }
.library-search { position: relative; }
.library-search > span { position: absolute; z-index: 1; left: 14px; top: 50%; color: #7e8999; font-size: 20px; transform: translateY(-53%) rotate(-18deg); pointer-events: none; }
.library-search input { height: 44px; padding: 10px 38px 10px 42px; border-color: #d7dee8; background: #f8fafc; }
.library-search button { position: absolute; right: 7px; top: 50%; width: 30px; height: 30px; border: 0; border-radius: 8px; color: #7d8795; background: transparent; cursor: pointer; transform: translateY(-50%); }
.library-search button:hover { color: var(--blue); background: #eaf1fa; }
.library-search button[hidden] { display: none; }
.library-select select { height: 44px; padding: 9px 34px 9px 12px; border-color: #d7dee8; background-color: #fff; font-size: 11px; font-weight: 700; }
.library-view-switch { padding: 4px; display: flex; gap: 3px; border: 1px solid #d7dee8; border-radius: 11px; background: #f5f7fa; }
.library-view-switch button { min-width: 54px; height: 34px; padding: 3px 8px; display: flex; align-items: center; justify-content: center; gap: 5px; border: 0; border-radius: 7px; color: #737f90; background: transparent; cursor: pointer; }
.library-view-switch button span { font-size: 15px; }
.library-view-switch button small { font-size: 9px; font-weight: 800; }
.library-view-switch button[aria-pressed="true"] { color: white; background: var(--blue); box-shadow: 0 5px 12px rgba(23,79,147,.2); }
.library-result-row { min-height: 34px; margin-bottom: 10px; display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 10px; }
.library-result-row button { padding: 5px 3px; border: 0; color: var(--blue); background: none; cursor: pointer; font-size: 10px; font-weight: 800; }
.library-result-row button[hidden], .book-card[hidden], .library-filter-empty[hidden], .book-grid[hidden] { display: none !important; }
.library-filter-empty { margin-top: 0; }
.library-filter-empty .secondary-button { margin: 18px auto 0; }
.book-grid[data-view="list"] { grid-template-columns: 1fr; gap: 13px; }
.book-grid[data-view="list"] .book-card { grid-template-columns: 132px minmax(0, 1fr); min-height: 166px; border-radius: 17px 7px 17px 7px; box-shadow: 0 8px 25px rgba(30,48,73,.06); }
.book-grid[data-view="list"] .book-card:hover { transform: translateY(-1px); }
.book-grid[data-view="list"] .book-cover img { width: 200%; object-position: right center; }
.book-grid[data-view="list"] .secure-badge { left: 10px; bottom: 10px; padding: 5px 7px; font-size: 8px; }
.book-grid[data-view="list"] .book-info { padding: 20px 24px; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto 1fr auto; column-gap: 28px; align-items: center; }
.book-grid[data-view="list"] .book-meta { grid-column: 1 / -1; }
.book-grid[data-view="list"] .book-info h3 { grid-column: 1; margin: 9px 0 4px; font-size: 19px; }
.book-grid[data-view="list"] .book-info p { grid-column: 1; min-height: 0; display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; font-size: 11px; }
.book-grid[data-view="list"] .access-period { grid-column: 1; margin: 10px 0 0; padding: 9px 0 0; justify-content: flex-start; gap: 14px; }
.book-grid[data-view="list"] .primary-button { grid-column: 2; grid-row: 2 / 5; min-width: 124px; align-self: center; }

.login-shell { min-height: 100vh; display: grid; grid-template-columns: 58% 42%; background: white; }
.login-visual { position: relative; overflow: hidden; color: white; background: #0b1935; }
.night-sky { position: absolute; inset: 0; background:
    radial-gradient(circle at 18% 20%, rgba(255,255,255,.9) 0 1px, transparent 2px),
    radial-gradient(circle at 76% 14%, rgba(255,255,255,.7) 0 1px, transparent 2px),
    radial-gradient(circle at 56% 42%, rgba(255,255,255,.35) 0 1px, transparent 2px),
    radial-gradient(ellipse at 50% 100%, #163568 0%, #0c1c3d 52%, #07142c 100%);
    background-size: 83px 83px, 121px 121px, 67px 67px, auto;
}
.night-sky::before, .night-sky::after { content: ""; position: absolute; width: 70vw; height: 30vh; left: -5vw; bottom: -12vh; border-radius: 50%; border-top: 1px solid rgba(104, 165, 218, .4); background: rgba(12, 56, 102, .34); transform: rotate(-4deg); }
.night-sky::after { bottom: -19vh; left: 10vw; background: rgba(18, 74, 127, .38); transform: rotate(5deg); }
.login-copy { position: absolute; z-index: 2; left: 12%; top: 17%; }
.login-copy h1 { margin: 18px 0; font-size: clamp(42px, 5.2vw, 76px); line-height: 1.1; letter-spacing: -.06em; font-family: Georgia, "Noto Serif KR", serif; font-weight: 500; }
.login-copy p { color: #c5d3e7; font-size: 15px; line-height: 1.8; }
.floating-card { position: absolute; z-index: 2; padding: 18px 20px; border: 1px solid rgba(255,255,255,.2); border-radius: 18px 5px 18px 5px; background: rgba(255,255,255,.08); backdrop-filter: blur(12px); font-family: Georgia, serif; font-size: 24px; }
.floating-card small { display: block; margin-top: 4px; color: #c5d3e7; font-family: sans-serif; font-size: 10px; }
.card-one { right: 8%; top: 14%; transform: rotate(5deg); }
.card-two { left: 23%; bottom: 12%; transform: rotate(-3deg); }
.login-panel { display: grid; place-items: center; padding: 50px; }
.login-box { width: min(410px, 100%); }
.login-box h2 { margin: 11px 0 7px; font-size: 34px; letter-spacing: -.05em; }
.login-box > p { margin: 0 0 32px; font-size: 13px; }
.mobile-brand { display: none; margin-bottom: 50px; align-items: center; gap: 10px; font-weight: 900; }
.stack-form { display: grid; gap: 16px; }
.stack-form label { display: grid; gap: 8px; color: #536074; font-size: 12px; font-weight: 700; }
.field-label { display: flex; align-items: center; gap: 6px; }
.required-mark, .optional-mark { padding: 3px 6px; display: inline-flex; align-items: center; border-radius: 99px; font-size: 8px; font-style: normal; font-weight: 900; line-height: 1; }
.required-mark { color: #a2343e; background: #fff0f1; }
.optional-mark { color: #667085; background: #eef1f5; }
.field-requirements { margin: 0 0 16px; padding: 11px 13px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 1px solid #dfe5ed; border-radius: 10px; color: var(--muted); background: #f8fafc; font-size: 9px; }
.field-requirements strong, .field-requirements > span { display: flex; align-items: center; gap: 6px; }
.field-requirements strong { color: #3f4b5e; font-size: 10px; }
input, textarea, select { width: 100%; padding: 12px 13px; border: 1px solid #ccd5e0; border-radius: 9px; outline: none; background: white; color: var(--ink); transition: border .2s, box-shadow .2s; }
input:focus, textarea:focus, select:focus { border-color: var(--blue-2); box-shadow: 0 0 0 3px rgba(44, 106, 180, .12); }
.demo-accounts { margin-top: 25px; padding: 16px; display: grid; gap: 4px; border-radius: 12px; background: #f3f6fa; color: var(--muted); font-size: 11px; }
.demo-accounts strong { margin-bottom: 3px; color: var(--ink); }
.auth-switch { margin-top: 18px; color: var(--muted); text-align: center; font-size: 12px; }
.auth-switch a { color: var(--blue); font-weight: 800; }
.register-panel { padding-top: 32px; padding-bottom: 32px; }
.register-box { width: min(520px, 100%); }
.register-box h2 { font-size: 31px; }
.registration-form { gap: 13px; }
.consent-check { padding: 13px; display: flex !important; grid-template-columns: none !important; align-items: flex-start; gap: 10px !important; border: 1px solid #d8e1ec; border-radius: 11px; background: #f8fafc; cursor: pointer; }
.consent-check input { width: 17px; height: 17px; margin: 2px 0 0; flex: 0 0 auto; accent-color: var(--blue); }
.consent-check span, .consent-check strong, .consent-check small { display: block; }
.consent-check strong { color: var(--ink); font-size: 11px; }
.consent-check small { margin-top: 4px; color: var(--muted); font-size: 9px; font-weight: 500; line-height: 1.55; }
.approval-notice { padding: 12px 14px; display: grid; gap: 4px; border-left: 3px solid var(--blue); border-radius: 7px; color: var(--muted); background: #edf4fc; font-size: 10px; }
.approval-notice strong { color: var(--blue); font-size: 11px; }
.alert { margin: 18px 0; padding: 13px 15px; border-radius: 10px; font-size: 12px; }
.alert.error { color: #9f2f3a; background: #fff0f1; border: 1px solid #f5cdd1; }
.alert.success { color: #236a4e; background: #eaf8f2; border: 1px solid #c9eadc; }

.compact-row { align-items: center; }
.admin-badge { padding: 10px 14px; color: var(--blue); background: #e8f0fa; border-radius: 8px; font-size: 11px; font-weight: 900; letter-spacing: .12em; }
.approval-queue-banner { margin-top: 20px; padding: 15px 18px; display: flex; align-items: center; gap: 12px; border: 1px solid #e6cc8d; border-radius: 14px 6px 14px 6px; color: #694816; background: #fff9e9; }
.approval-queue-banner span { padding: 5px 8px; border-radius: 99px; color: white; background: #a77520; font-size: 9px; font-weight: 900; }
.approval-queue-banner strong { font-size: 12px; }
.approval-queue-banner em { margin-left: auto; color: #946019; font-size: 10px; font-style: normal; font-weight: 800; }
.admin-stats { margin: 36px 0 24px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.admin-stats article { padding: 22px; border: 1px solid var(--line); border-radius: 16px 6px 16px 6px; background: white; box-shadow: 0 10px 30px rgba(33,48,70,.05); }
.admin-stats span { display: block; margin-bottom: 12px; color: var(--muted); font-size: 11px; }
.admin-stats strong { font-size: 30px; }
.admin-stats small { margin-left: 4px; color: var(--muted); }
.admin-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 20px; }
.panel { padding: 26px; border: 1px solid var(--line); border-radius: 20px 8px 20px 8px; background: white; box-shadow: 0 12px 36px rgba(33,48,70,.06); }
.panel-heading { margin-bottom: 22px; display: flex; align-items: center; justify-content: space-between; }
.panel-heading h2 { margin: 5px 0 0; font-size: 20px; }
.panel-icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: #eaf1fa; color: var(--blue); font-size: 20px; font-weight: 900; }
.file-drop { padding: 22px; border: 1px dashed #aebdd0; border-radius: 12px; background: #f8fafc; text-align: center; }
.file-drop input { padding: 0; border: 0; box-shadow: none; font-size: 11px; }
.file-drop span { margin-top: 8px; color: var(--muted); font-weight: 400; }
.form-help { margin: -7px 0 0; color: var(--muted); text-align: center; font-size: 10px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.access-shortcut-panel { display: flex; flex-direction: column; }
.access-shortcut-copy { margin: auto 0 22px; padding: 24px; border-radius: 16px 6px 16px 6px; background: #f2f6fb; }
.access-shortcut-copy strong { display: block; color: var(--blue); font-size: 36px; letter-spacing: -.04em; }
.access-shortcut-copy span { display: block; margin-top: 2px; color: var(--ink); font-size: 11px; font-weight: 800; }
.access-shortcut-copy p { margin: 15px 0 0; color: var(--muted); font-size: 11px; line-height: 1.65; }
.toc-options { padding: 13px; display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 10px; border: 1px solid #dce4ee; border-radius: 11px; background: #f7f9fc; }
.toc-options label { min-width: 0; }
.table-panel { margin-top: 20px; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th { padding: 10px 12px; color: var(--muted); background: #f5f7fa; text-align: left; vertical-align: middle; font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
td { padding: 14px 12px; border-bottom: 1px solid #edf0f4; vertical-align: middle; }
td strong, td small { display: block; }
td small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.status { padding: 5px 8px; display: inline-flex; align-items: center; justify-content: center; border-radius: 99px; background: #eef1f5; color: var(--muted); font-size: 10px; font-weight: 800; line-height: 1.2; white-space: nowrap; }
.status.published { color: #267054; background: #e3f5ed; }
.watermark-toggle-form { margin: 0; }
.watermark-toggle { width: 68px; height: 30px; padding: 3px 7px; display: flex; align-items: center; gap: 7px; border: 1px solid #cfd7e2; border-radius: 99px; color: #778292; background: #eef1f5; cursor: pointer; transition: .2s; }
.watermark-toggle span { width: 21px; height: 21px; flex: 0 0 auto; border-radius: 50%; background: white; box-shadow: 0 2px 6px rgba(24,38,59,.18); transition: .2s; }
.watermark-toggle strong { font-size: 9px; }
.watermark-toggle.on { flex-direction: row-reverse; color: white; border-color: var(--blue); background: var(--blue); }
.watermark-toggle:hover { box-shadow: 0 4px 12px rgba(23,79,147,.16); }
.status.processing { color: #9b681e; background: #fff3dc; }
.status.completed { color: #267054; background: #e3f5ed; }
.status.failed { color: #9f2f3a; background: #fff0f1; }
.status.deleted { color: #667085; background: #eef1f5; }
.conversion-message { display: block; max-width: 560px; max-height: 4.2em; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--muted); line-height: 1.4; }
.table-link { color: var(--blue); font-weight: 800; }
.table-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.table-actions form { margin: 0; }
.deleted-book-actions { min-width: 210px; display: flex; align-items: flex-start; gap: 8px; }
.permanent-delete { position: relative; }
.permanent-delete summary { padding: 8px 10px; border-radius: 8px; color: #a23d47; background: #fff0f1; cursor: pointer; font-size: 10px; font-weight: 800; list-style: none; }
.permanent-delete summary::-webkit-details-marker { display: none; }
.permanent-delete-form { width: 310px; margin-top: 8px; padding: 14px; position: absolute; z-index: 20; right: 0; display: grid; gap: 10px; border: 1px solid #efc8cd; border-radius: 12px; background: white; box-shadow: 0 16px 38px rgba(57, 29, 34, .18); }
.permanent-delete-form p { margin: 0; color: #8d3b44; font-size: 10px; line-height: 1.5; }
.permanent-delete-form label { display: grid; gap: 6px; color: #536074; font-size: 10px; font-weight: 700; }
.permanent-delete-form input { padding: 9px 10px; font-size: 10px; }
.permanent-delete-form .confirm-check { display: flex; align-items: center; gap: 7px; }
.permanent-delete-form .confirm-check input { width: auto; }
.danger-button { padding: 9px 12px; border: 0; border-radius: 8px; color: white; background: #b5424c; cursor: pointer; font-size: 10px; font-weight: 800; }
.manual-page { width: min(1180px, calc(100% - 48px)); }
.manual-heading { margin-bottom: 4px; }
.manual-callout { padding: 15px 17px; display: flex; gap: 10px; border: 1px solid #d6e2ef; border-radius: 12px; background: #f2f7fc; color: #516278; font-size: 11px; line-height: 1.5; }
.manual-callout strong { flex: 0 0 auto; color: var(--blue); }
.manual-callout.danger { margin-top: 14px; border-color: #f0cdd1; background: #fff2f3; }
.manual-callout.danger strong, .manual-callout.danger span { color: #963a44; }
.manual-layout { margin-top: 20px; display: grid; grid-template-columns: 210px minmax(0, 1fr); align-items: start; gap: 20px; }
.manual-toc { padding: 18px; position: sticky; top: 86px; display: grid; gap: 5px; border: 1px solid var(--line); border-radius: 15px 6px 15px 6px; background: white; }
.manual-toc strong { margin-bottom: 7px; color: var(--ink); font-size: 12px; }
.manual-toc a { padding: 7px 8px; border-radius: 7px; color: var(--muted); font-size: 10px; font-weight: 700; }
.manual-toc a:hover { color: var(--blue); background: #eef4fb; }
.manual-content { display: grid; gap: 16px; }
.manual-section { padding: 28px; scroll-margin-top: 90px; display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 17px; border: 1px solid var(--line); border-radius: 18px 7px 18px 7px; background: white; box-shadow: 0 10px 30px rgba(33,48,70,.045); }
.manual-step { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px 4px 12px 4px; color: white; background: var(--blue); font-size: 11px; font-weight: 900; }
.manual-section h2 { margin: 2px 0 15px; font-size: 21px; }
.manual-section h3 { margin: 19px 0 7px; font-size: 13px; }
.manual-section p { margin: 0 0 10px; color: #536074; font-size: 11px; line-height: 1.7; }
.manual-section ul, .manual-section ol { margin: 0; padding-left: 20px; color: #536074; font-size: 11px; line-height: 1.85; }
.manual-section code { padding: 2px 5px; border-radius: 5px; color: #315d92; background: #edf3fa; font-family: Consolas, monospace; font-size: 10px; }
.manual-note { margin-top: 13px; padding: 11px 13px; border-left: 3px solid #7fa6d2; border-radius: 0 8px 8px 0; background: #f5f8fc; color: #68778a; font-size: 10px; line-height: 1.6; }
.manual-table { margin-top: 15px; }
.manual-table td { font-size: 10px; }
.manual-faq { margin: 0; }
.manual-faq div { padding: 13px 0; display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 14px; border-bottom: 1px solid #edf0f4; }
.manual-faq dt { color: var(--ink); font-size: 11px; font-weight: 800; }
.manual-faq dd { margin: 0; color: #647184; font-size: 10px; line-height: 1.6; }
.manual-check-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.manual-check-grid > div { padding: 14px; display: grid; gap: 9px; border-radius: 11px; background: #f6f8fb; }
.manual-check-grid strong { color: var(--blue); font-size: 11px; }
.manual-check-grid label { display: flex; align-items: center; gap: 7px; color: #657286; font-size: 10px; }
.manual-check-grid input { width: auto; }
.manual-command { margin-top: 14px !important; }
.contents-admin-page { width: min(1240px, calc(100% - 48px)); }
.contents-summary { margin: 28px 0 20px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.contents-summary article { padding: 19px; border: 1px solid var(--line); border-radius: 15px 6px 15px 6px; background: white; }
.contents-summary span { display: block; margin-bottom: 9px; color: var(--muted); font-size: 10px; }
.contents-summary strong { font-size: 27px; }
.contents-summary small { margin-left: 4px; color: var(--muted); }
.contents-auto-panel, .contents-editor-panel { margin-top: 20px; }
.auto-contents-form { display: grid; grid-template-columns: 1.2fr 1.1fr 1fr 1fr auto; align-items: end; gap: 10px; }
.auto-contents-form label { display: grid; gap: 7px; color: #536074; font-size: 11px; font-weight: 700; }
.auto-contents-form input, .auto-contents-form select, .auto-contents-form button { min-height: 42px; }
.panel-help { margin: 12px 0 0; color: var(--muted); font-size: 10px; }
.contents-help { margin-bottom: 14px; }
.unassigned-pages { margin-bottom: 14px; padding: 12px 14px; display: grid; gap: 4px; border-radius: 10px; background: #fff8e9; color: #75581d; font-size: 10px; }
.unassigned-pages span { max-height: 4.2em; overflow: auto; line-height: 1.4; }
.contents-table-wrap { max-height: 62vh; border: 1px solid #e7ebf0; border-radius: 12px; }
.contents-editor-table thead { position: sticky; top: 0; z-index: 2; }
.contents-editor-table th:nth-child(1) { width: 58px; }
.contents-editor-table th:nth-child(2) { min-width: 260px; }
.contents-editor-table th:nth-child(3) { width: 160px; }
.contents-editor-table th:nth-child(4) { min-width: 190px; }
.contents-editor-table td { padding: 8px; }
.contents-editor-table input { min-width: 0; padding: 9px 10px; font-size: 11px; }
.contents-order { color: var(--muted); text-align: center; font-weight: 800; }
.contents-manual-form { gap: 18px; }
.secondary-button.compact { padding: 9px 12px; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.admin-heading-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.admin-heading-row h1 { margin: 9px 0 8px; font-size: clamp(30px, 3vw, 42px); letter-spacing: -.05em; }
.admin-heading-row p { margin: 0; }
.admin-heading-row > .primary-button, .admin-heading-row > .secondary-button { flex: 0 0 auto; white-space: nowrap; }
.admin-heading-actions { display: flex; align-items: center; gap: 9px; }
.admin-subnav { max-width: 100%; margin: 28px 0 8px; padding: 5px; display: inline-flex; gap: 4px; overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: white; scrollbar-width: none; }
.admin-subnav::-webkit-scrollbar { display: none; }
.admin-subnav a { padding: 9px 14px; flex: 0 0 auto; border-radius: 8px; color: var(--muted); font-size: 12px; font-weight: 800; white-space: nowrap; }
.admin-subnav a.active { color: white; background: var(--blue); box-shadow: 0 5px 14px rgba(23,79,147,.2); }
.member-stats { margin-top: 22px; grid-template-columns: repeat(5, 1fr); }
.member-stats .pending-stat { border-color: #ebcf96; background: #fffbf1; }
.member-stats .pending-stat strong { color: #946019; }
.member-list-panel { margin-top: 20px; }
.filter-bar { margin: -5px 0 24px; padding: 14px; display: grid; grid-template-columns: minmax(260px, 1fr) 150px 140px auto auto; align-items: center; gap: 10px; border-radius: 14px; background: #f5f7fa; }
.filter-bar input, .filter-bar select { min-height: 42px; }
.filter-bar .secondary-button { min-height: 42px; }
.filter-bar .text-button { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; }
.search-field { position: relative; }
.text-button { padding: 8px 4px; color: var(--muted); border: 0; background: none; cursor: pointer; font-size: 12px; font-weight: 800; text-align: center; }
.text-button:hover { color: var(--blue); }
.bulk-approval-bar { margin: 0 0 22px; padding: 13px 15px; display: flex; align-items: center; gap: 14px; border: 1px solid #d7e3f0; border-radius: 13px; background: #f3f7fc; }
.bulk-approval-bar > div { min-width: 0; display: grid; gap: 3px; }
.bulk-approval-bar strong { color: var(--ink); font-size: 12px; }
.bulk-approval-bar span { color: var(--muted); font-size: 10px; }
.bulk-approval-bar .bulk-selected-count { margin-left: auto; padding: 6px 9px; flex: 0 0 auto; border-radius: 99px; color: var(--blue); background: white; font-weight: 800; }
.primary-button.compact { min-height: 36px; padding: 0 13px; font-size: 10px; }
.member-select-column { width: 42px; padding-right: 4px; text-align: center; }
.table-check { min-width: 22px; min-height: 22px; display: inline-grid; place-items: center; cursor: pointer; }
.table-check input { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; }
.table-check span { width: 17px; height: 17px; display: block; border: 1px solid #b9c5d3; border-radius: 5px; background: white; transition: .15s; }
.table-check input:checked + span { border-color: var(--blue); background: var(--blue); box-shadow: inset 0 0 0 3px white; }
.table-check input:focus-visible + span { outline: 3px solid rgba(44,106,180,.2); outline-offset: 2px; }
.table-check input:indeterminate + span { border-color: var(--blue); background: linear-gradient(var(--blue), var(--blue)) center / 9px 2px no-repeat white; }
.selection-unavailable { color: #c2c8d0; }
.list-heading { margin-bottom: 12px; }
.member-cell { min-width: 230px; display: flex; align-items: center; gap: 11px; }
.avatar { width: 35px; height: 35px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 11px 4px 11px 4px; color: var(--blue); background: #e6eef8; font-size: 13px; font-weight: 900; }
.avatar.large { width: 64px; height: 64px; border-radius: 18px 7px 18px 7px; color: white; background: var(--blue); font-size: 24px; box-shadow: 0 12px 28px rgba(23,79,147,.2); }
.status.active { color: #267054; background: #e3f5ed; }
.status.pending, .status.scheduled { color: #946019; background: #fff3dc; }
.status.suspended, .status.revoked, .status.rejected { color: #9f2f3a; background: #fff0f1; }
.status.withdrawn, .status.expired { color: #667085; background: #eef1f5; }
.quick-approval-form { margin-top: 6px; }
.quick-approval-form button { padding: 4px 9px; border: 0; border-radius: 7px; color: white; background: var(--blue); cursor: pointer; font-size: 9px; font-weight: 800; }
.lock-note { margin-top: 5px; display: block; color: #a3414a; }
.table-empty { padding: 34px 16px; color: var(--muted); text-align: center; }
.pagination { padding-top: 20px; display: flex; justify-content: center; gap: 6px; }
.pagination a { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: white; font-size: 11px; font-weight: 800; }
.pagination a.active { color: white; border-color: var(--blue); background: var(--blue); }
.narrow-admin-page { width: min(820px, calc(100% - 48px)); }
.breadcrumb { margin-bottom: 22px; display: inline-flex; color: var(--muted); font-size: 12px; font-weight: 800; }
.breadcrumb:hover { color: var(--blue); }
.create-member-panel { margin-top: 28px; padding: 34px; }
.stack-form label small { color: #9aa3af; font-weight: 500; }
.security-callout { padding: 15px 17px; display: grid; gap: 4px; border: 1px solid #d5e1ef; border-radius: 11px; background: #f1f6fb; }
.security-callout strong { color: var(--blue); font-size: 11px; }
.security-callout span { color: var(--muted); font-size: 11px; line-height: 1.5; }
.form-actions { display: flex; align-items: center; justify-content: flex-end; gap: 16px; }
.member-profile-head { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.profile-identity { display: flex; align-items: center; gap: 17px; }
.profile-identity h1 { margin: 5px 0 4px; font-size: 32px; letter-spacing: -.05em; }
.profile-identity p { margin: 0; color: var(--muted); font-size: 13px; }
.profile-badges { display: flex; gap: 8px; }
.role-badge { padding: 6px 9px; border-radius: 99px; color: var(--blue); background: #e8f0fa; font-size: 10px; font-weight: 800; }
.member-summary-grid { margin: 28px 0 20px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.member-summary-grid article { min-height: 104px; padding: 20px; border: 1px solid var(--line); border-radius: 15px 6px 15px 6px; background: white; }
.member-summary-grid span { display: block; margin-bottom: 13px; color: var(--muted); font-size: 10px; }
.member-summary-grid strong { font-size: 27px; }
.member-summary-grid small { margin-left: 4px; color: var(--muted); }
.member-summary-grid .summary-date { font-size: 20px; }
.approval-panel { margin: 22px 0; display: grid; grid-template-columns: minmax(260px, .85fr) minmax(380px, 1.15fr); align-items: end; gap: 28px; border-color: #dfc47f; background: linear-gradient(120deg, #fffaf0, #fff); }
.approval-panel.rejected { border-color: #edc8cc; background: linear-gradient(120deg, #fff4f5, #fff); }
.approval-panel h2 { margin: 6px 0 7px; font-size: 22px; }
.approval-panel p { margin: 0; color: var(--muted); font-size: 11px; }
.approval-form { display: grid; grid-template-columns: minmax(220px, 1fr) auto; align-items: end; gap: 12px; }
.approval-form label { display: grid; gap: 7px; color: #536074; font-size: 11px; font-weight: 700; }
.approval-actions { display: flex; gap: 8px; }
.danger-button { min-height: 43px; padding: 0 16px; border: 1px solid #edc2c7; border-radius: 10px 4px 10px 4px; color: #a43842; background: #fff0f1; cursor: pointer; font-size: 12px; font-weight: 800; }
.detail-grid { margin-top: 20px; display: grid; grid-template-columns: 1.15fr .85fr; gap: 20px; }
.account-facts { margin: 0; display: grid; gap: 0; }
.account-facts div { padding: 12px 0; display: flex; justify-content: space-between; gap: 16px; border-bottom: 1px solid #edf0f4; }
.account-facts dt { color: var(--muted); font-size: 11px; }
.account-facts dd { margin: 0; font-size: 11px; font-weight: 800; text-align: right; }
.password-form { margin-top: 20px; }
.entitlement-grid { grid-template-columns: .85fr 1.15fr; }
.entitlement-list { display: grid; gap: 8px; }
.entitlement-list article { padding: 13px 14px; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 12px; border: 1px solid #e5e9ef; border-radius: 11px; }
.entitlement-list strong, .entitlement-list small { display: block; }
.entitlement-list small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.danger-link { padding: 5px; border: 0; color: #a23d47; background: none; cursor: pointer; font-size: 10px; font-weight: 800; }
.compact-log-list { display: grid; }
.compact-log-list article { padding: 12px 0; display: grid; grid-template-columns: 9px minmax(0, 1fr) auto; align-items: center; gap: 10px; border-bottom: 1px solid #edf0f4; }
.compact-log-list article:last-child { border-bottom: 0; }
.compact-log-list strong, .compact-log-list small { display: block; }
.compact-log-list strong { font-size: 11px; }
.compact-log-list small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.compact-log-list code { color: #8993a1; font-family: inherit; font-size: 9px; }
.log-dot { width: 8px; height: 8px; border-radius: 50%; background: #9aa3af; }
.log-dot.success { background: #42a379; box-shadow: 0 0 0 3px rgba(66,163,121,.12); }
.log-dot.failed { background: #d16069; box-shadow: 0 0 0 3px rgba(209,96,105,.11); }
.log-dot.audit { background: var(--blue-2); box-shadow: 0 0 0 3px rgba(44,106,180,.1); }
.log-dot.security { background: #e08b35; box-shadow: 0 0 0 3px rgba(224,139,53,.13); }
.dashboard-audit-list { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 28px; }
.dashboard-audit-list article { grid-template-columns: 9px minmax(0, 1fr); }

.bulk-grant-form { gap: 13px; }
.bulk-choice-group { min-width: 0; margin: 0; padding: 0; border: 0; }
.bulk-choice-heading { min-height: 24px; margin-bottom: 7px; display: flex; align-items: center; justify-content: space-between; gap: 12px; color: #536074; font-size: 12px; }
.bulk-choice-heading > div { min-width: 0; display: flex; align-items: baseline; gap: 9px; }
.bulk-choice-heading strong { font-weight: 700; }
.bulk-choice-count { color: var(--muted); font-size: 9px; font-weight: 600; white-space: nowrap; }
.bulk-choice-heading button { padding: 4px 5px; flex: 0 0 auto; border: 0; color: var(--blue); background: transparent; cursor: pointer; font-size: 9px; font-weight: 800; line-height: 1.2; }
.bulk-choice-search { position: relative; margin-bottom: 9px; display: block; }
.bulk-choice-search > span { position: absolute; z-index: 1; left: 13px; top: 50%; color: #718096; font-size: 17px; transform: translateY(-54%) rotate(-15deg); pointer-events: none; }
.bulk-choice-search input { height: 42px; padding: 9px 34px 9px 38px; border-color: #d7dee8; background: #f8fafc; font-size: 11px; }
.bulk-choice-list { max-height: 155px; padding: 7px; display: grid; gap: 5px; overflow: auto; border: 1px solid #dce3ec; border-radius: 10px; background: #f8fafc; }
.bulk-choice-list label { padding: 8px 9px; display: flex; align-items: center; gap: 9px; border: 1px solid transparent; border-radius: 8px; background: white; cursor: pointer; }
.bulk-choice-list label[hidden], .filter-choice-empty[hidden] { display: none !important; }
.bulk-choice-list label:hover { border-color: #cbd9e9; }
.bulk-choice-list input { width: 16px; height: 16px; margin: 0; flex: 0 0 auto; accent-color: var(--blue); }
.bulk-choice-list span, .bulk-choice-list strong, .bulk-choice-list small { min-width: 0; display: block; }
.bulk-choice-list strong { color: var(--ink); font-size: 10px; }
.bulk-choice-list small { margin-top: 3px; overflow: hidden; color: var(--muted); font-size: 8px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.book-choice-list { max-height: 126px; }
.choice-empty { margin: 5px; color: var(--muted); text-align: center; font-size: 10px; }
.bulk-grant-summary { padding: 9px 11px; border-radius: 8px; color: #52637a; background: #edf3fa; font-size: 10px; font-weight: 700; text-align: center; }
button:disabled { cursor: not-allowed; opacity: .5; transform: none !important; box-shadow: none !important; }

.access-admin-page { width: min(1500px, calc(100% - 32px)); }
.access-stats { margin-top: 22px; grid-template-columns: repeat(5, 1fr); }
.access-grant-panel { margin-top: 20px; padding: 32px; scroll-margin-top: 90px; }
.access-grant-panel .panel-heading { align-items: flex-start; }
.access-grant-panel .panel-help { margin-top: 6px; }
.access-choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.access-choice-list { height: 360px; max-height: 360px; align-content: start; }
.access-setting-grid { display: grid; grid-template-columns: 1fr 1fr 1.2fr; gap: 12px; }
.access-setting-grid > label { min-width: 0; }
.access-setting-grid input { min-height: 43px; }
.bulk-grant-footer { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; }
.bulk-grant-footer .bulk-grant-summary { min-height: 43px; display: grid; place-items: center; }
.bulk-grant-footer .secondary-button { min-width: 190px; min-height: 43px; white-space: nowrap; }
.access-directory-panel { scroll-margin-top: 85px; }
.access-filter-bar { margin: 0 0 18px; grid-template-columns: minmax(300px, 1fr) 160px auto auto; }
.access-table { min-width: 980px; }
.access-table th:nth-child(1) { min-width: 235px; }
.access-table th:nth-child(2) { min-width: 170px; }
.access-table th:nth-child(3) { min-width: 185px; }
.access-table th:last-child, .access-table td:last-child { text-align: right; }
.access-table td:last-child form { margin: 0; display: flex; justify-content: flex-end; }
.access-member-link { color: var(--ink); }
.access-member-link:hover strong { color: var(--blue); }
.access-member-state { margin-top: 6px; color: #a3414a; }

.reader-body { overflow: hidden; background: #101725; user-select: none; -webkit-user-select: none; }
.reader-body input, .reader-body textarea { user-select: text; -webkit-user-select: text; }
.reader-app { position: fixed; inset: 0; width: 100%; height: 100vh; height: 100dvh; display: grid; grid-template-columns: 284px minmax(0, 1fr); }
.reader-sidebar { min-width: 0; min-height: 0; height: 100vh; height: 100dvh; overflow: hidden; display: flex; flex-direction: column; background: #f8f9fb; border-right: 1px solid #dce2ea; z-index: 40; }
.reader-brand-row { height: 72px; flex: 0 0 72px; padding: 0 20px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #e1e5eb; background: white; }
.sidebar-book { flex: 0 0 auto; padding: 24px 22px 20px; }
.sidebar-book h1 { margin: 7px 0; font-size: 18px; letter-spacing: -.035em; }
.sidebar-book p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.sidebar-section-title { flex: 0 0 auto; padding: 12px 18px 8px; display: flex; justify-content: space-between; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .08em; }
.day-list { min-height: 0; flex: 1 1 auto; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; padding: 4px 8px 18px 10px; }
.day-list::-webkit-scrollbar { width: 8px; }
.day-list::-webkit-scrollbar-track { background: transparent; }
.day-list::-webkit-scrollbar-thumb { border: 2px solid #f8f9fb; border-radius: 99px; background: #c6d0dd; }
.day-item { width: 100%; padding: 10px 9px; display: grid; grid-template-columns: 35px 1fr 12px; align-items: center; gap: 9px; border: 0; border-radius: 11px; background: transparent; text-align: left; cursor: pointer; }
.day-item:hover { background: #edf2f8; }
.day-item.active { background: white; box-shadow: 0 6px 20px rgba(27, 48, 78, .09); }
.day-number { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px 3px 10px 3px; color: var(--blue); background: #e3edf8; font-family: Georgia, serif; font-size: 15px; font-weight: 800; }
.day-item.active .day-number { color: white; background: var(--blue); }
.day-item strong, .day-item small { display: block; }
.day-item strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.day-item small { margin-top: 2px; color: #8a94a3; font-size: 9px; }
.day-item i { color: #a1aab6; font-style: normal; }
.sidebar-footer { flex: 0 0 auto; padding: 15px 20px; border-top: 1px solid #e1e5eb; color: var(--muted); background: #f8f9fb; font-size: 10px; }
.online-dot, .saving-dot { width: 7px; height: 7px; display: inline-block; border-radius: 50%; background: #43a97e; box-shadow: 0 0 0 3px rgba(67,169,126,.13); }
.reader-main { min-width: 0; height: 100vh; height: 100dvh; display: grid; grid-template-rows: 72px 26px minmax(0, 1fr) 44px; background: #151d2b; }
.reader-toolbar { min-width: 0; padding: 0 16px; display: grid; grid-template-columns: minmax(220px, 1fr) auto minmax(180px, 1fr); align-items: center; gap: 14px; background: white; border-bottom: 1px solid #dce2ea; }
.toolbar-left, .toolbar-right { min-width: 0; display: flex; align-items: center; gap: 10px; }
.toolbar-right { justify-content: flex-end; }
.back-link { color: #5f6c7c; font-size: 11px; font-weight: 700; }
.toolbar-divider { width: 1px; height: 28px; background: var(--line); }
.current-title { min-width: 0; }
.current-title small, .current-title strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.current-title small { color: var(--blue); font-size: 8px; letter-spacing: .13em; }
.current-title strong { margin-top: 2px; font-size: 11px; }
.tool-palette { padding: 5px; display: flex; align-items: center; gap: 2px; border: 1px solid #dde3ea; border-radius: 12px; background: #f7f9fb; }
.tool { min-width: 47px; height: 46px; padding: 4px 6px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: 0; border-radius: 8px; background: transparent; cursor: pointer; }
.tool span { font-size: 16px; line-height: 1; }
.tool small { color: #7b8796; font-size: 8px; }
.tool:hover { background: #e9eff7; }
.tool.active { color: white; background: var(--blue); box-shadow: 0 5px 12px rgba(23,79,147,.25); }
.tool.active small { color: white; }
.underline-icon { text-decoration: underline; font-family: Georgia, serif; font-weight: 900; }
.highlight-icon { color: #f3d15f; }
.pen-width-control { --pen-width-preview: 3px; height: 36px; padding: 0 7px; display: flex; align-items: center; gap: 6px; border-left: 1px solid #d7dee8; border-right: 1px solid #d7dee8; color: #536174; cursor: pointer; }
.pen-width-control[hidden] { display: none !important; }
.pen-width-preview { width: 15px; height: var(--pen-width-preview); flex: 0 0 auto; border-radius: 99px; background: currentColor; }
.pen-width-control input { width: 64px; height: 20px; padding: 0; border: 0; border-radius: 0; outline: none; box-shadow: none; accent-color: var(--blue); cursor: pointer; }
.pen-width-control input:focus { border: 0; box-shadow: none; }
.pen-width-control output { min-width: 18px; color: var(--blue); font-size: 9px; font-weight: 900; text-align: center; }
.pen-width-control[data-width-tool="highlight"] { color: #c59a00; }
.pen-width-control[data-width-tool="highlight"] input { accent-color: #c59a00; }
.pen-width-control[data-width-tool="highlight"] output { color: #967500; }
.eraser-mode-control { height: 36px; padding: 3px; display: flex; align-items: center; gap: 2px; border: 1px solid #d7dee8; border-radius: 9px; background: white; }
.eraser-mode-control[hidden] { display: none !important; }
.eraser-mode-control button { height: 28px; padding: 0 8px; border: 0; border-radius: 6px; color: #667386; background: transparent; cursor: pointer; font-size: 9px; font-weight: 800; white-space: nowrap; }
.eraser-mode-control button:hover { background: #edf2f8; }
.eraser-mode-control button[aria-pressed="true"] { color: white; background: var(--blue); }
.color-control { position: relative; width: 30px; height: 30px; margin: 0 4px; overflow: hidden; border-radius: 50%; border: 3px solid white; box-shadow: 0 0 0 1px #cbd3df; }
.color-control input { position: absolute; inset: -10px; width: 50px; height: 50px; padding: 0; border: 0; cursor: pointer; }
.icon-button { width: 34px; height: 34px; padding: 0; display: grid; place-items: center; border: 1px solid #dce2ea; border-radius: 9px; background: white; cursor: pointer; font-size: 15px; }
.icon-button:hover { background: #f0f4f8; }
.fullscreen-button[aria-pressed="true"] { color: white; border-color: var(--blue); background: var(--blue); }
.zoom-label { min-width: 36px; color: var(--muted); text-align: center; font-size: 9px; }
.reader-status { padding: 0 16px; display: flex; align-items: center; justify-content: center; gap: 8px; color: #94a0b2; background: #101724; font-size: 9px; }
.page-stage { min-height: 0; position: relative; display: grid; grid-template-columns: 52px minmax(0, 1fr) 52px; align-items: center; }
.page-viewport { width: 100%; height: 100%; overflow: auto; display: grid; place-items: center; place-items: safe center; overscroll-behavior: contain; scrollbar-gutter: stable both-edges; touch-action: none; -webkit-overflow-scrolling: touch; -webkit-touch-callout: none; }
.page-surface { position: relative; flex: none; box-shadow: 0 28px 70px rgba(0,0,0,.38); transform-origin: center center; background: #fff; }
#page-image { max-width: none; display: block; user-select: none; pointer-events: none; }
#annotation-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
#annotation-canvas { z-index: 3; touch-action: none; -webkit-touch-callout: none; }
.page-surface.move-mode #annotation-canvas { cursor: grab; }
.page-surface.move-mode.dragging-page #annotation-canvas { cursor: grabbing; }
.page-surface.move-mode.dragging-note #annotation-canvas { cursor: grabbing; }
.page-surface.pen-mode #annotation-canvas, .page-surface.highlight-mode #annotation-canvas, .page-surface.underline-mode #annotation-canvas { cursor: crosshair; }
.page-surface.note-mode #annotation-canvas { cursor: pointer; }
.page-surface.eraser-mode #annotation-canvas { cursor: cell; }
.page-nav { width: 38px; height: 54px; margin: auto; border: 1px solid rgba(255,255,255,.08); border-radius: 10px; color: #b7c2d1; background: rgba(255,255,255,.055); cursor: pointer; font-size: 34px; line-height: 1; }
.page-nav:hover { color: white; background: rgba(255,255,255,.1); }
.page-nav:disabled { opacity: .2; cursor: default; }
.reader-footer { padding: 0 16px; display: grid; grid-template-columns: 110px minmax(100px, 1fr) 210px; align-items: center; gap: 14px; color: #9ba7b7; background: #101724; border-top: 1px solid #242e3d; font-size: 9px; }
#page-slider { height: 3px; padding: 0; border: 0; accent-color: #5d8ec7; box-shadow: none; }
.secure-footer { text-align: right; }
.note-editor { position: absolute; z-index: 8; width: 260px; padding: 11px; border: 1px solid #e2c96f; border-radius: 10px 3px 10px 3px; background: #fff8cf; box-shadow: 0 15px 35px rgba(31,36,43,.24); color: #4f4829; }
.note-editor textarea { height: 100px; resize: none; border-color: #e8d98f; background: rgba(255,255,255,.7); font-size: 12px; }
.note-editor .note-editor-head { margin: 0 0 8px; display: grid; gap: 2px; }
.note-editor-head strong { font-size: 12px; }
.note-editor-head span { color: #85794a; font-size: 9px; }
.note-editor .note-editor-actions { margin-top: 7px; display: flex; align-items: center; gap: 6px; }
.note-editor-actions .spacer { flex: 1; }
.note-editor button { padding: 6px 9px; border: 0; border-radius: 6px; cursor: pointer; background: white; font-size: 10px; }
.note-editor button[data-action="save"] { color: white; background: var(--blue); }
.note-editor button.danger { color: #a53b42; background: #fff0ed; }
.reader-privacy-shield { position: fixed; inset: 0; z-index: 500; padding: 24px; display: grid; place-items: center; color: white; background: rgba(7, 13, 24, .98); backdrop-filter: blur(18px); }
.reader-privacy-shield[hidden] { display: none !important; }
.privacy-shield-card { width: min(430px, 100%); padding: 36px 30px; display: grid; justify-items: center; border: 1px solid rgba(255,255,255,.12); border-radius: 24px 8px 24px 8px; background: linear-gradient(145deg, rgba(33,48,72,.95), rgba(15,25,41,.98)); box-shadow: 0 28px 80px rgba(0,0,0,.45); text-align: center; }
.privacy-shield-icon { width: 58px; height: 58px; margin-bottom: 16px; display: grid; place-items: center; border-radius: 18px 5px 18px 5px; color: #a9caef; background: rgba(75,126,187,.18); font-size: 26px; }
.privacy-shield-card small { color: #8fb4df; font-size: 9px; font-weight: 900; letter-spacing: .2em; }
.privacy-shield-card h2 { margin: 10px 0 8px; font-size: 23px; letter-spacing: -.035em; }
.privacy-shield-card p { margin: 0; color: #aeb9c8; font-size: 12px; line-height: 1.6; }
.privacy-shield-card button { margin-top: 24px; padding: 11px 22px; border: 0; border-radius: 10px; color: white; background: var(--blue-2); cursor: pointer; font-size: 12px; font-weight: 800; }
.privacy-shield-card button:hover { background: #377bc7; }
.privacy-shield-card em { margin-top: 18px; color: #768499; font-size: 9px; font-style: normal; }
.reader-app.privacy-locked > .reader-sidebar, .reader-app.privacy-locked > .reader-main { filter: blur(12px); }
.reader-app.reader-fullscreen { grid-template-columns: 1fr; background: #101725; }
.reader-app.reader-fullscreen .reader-sidebar { position: fixed; inset: 0 auto 0 0; width: min(86vw, 320px); height: 100dvh; transform: translateX(-105%); transition: transform .25s; box-shadow: 20px 0 50px rgba(0,0,0,.35); }
.reader-app.reader-fullscreen .reader-sidebar.open { transform: translateX(0); }
.reader-app.reader-fullscreen .mobile-only { display: grid; }
.reader-app.reader-fullscreen .reader-main { height: 100dvh; }
.reader-print-blocker { display: none; }
.mobile-only { display: none; }

@media print {
    .topbar, .admin-subnav, .manual-heading button, .manual-toc { display: none !important; }
    body { background: white; }
    .manual-page { width: 100%; padding: 0; }
    .manual-layout { display: block; }
    .manual-content { gap: 10px; }
    .manual-section { padding: 18px; break-inside: avoid; box-shadow: none; }
    body.reader-body { background: white !important; }
    body.reader-body .reader-app { display: none !important; }
    body.reader-body .reader-print-blocker { min-height: 80vh; display: grid !important; place-content: center; gap: 10px; color: #1b2b43; text-align: center; }
    body.reader-body .reader-print-blocker strong { font-size: 22px; }
    body.reader-body .reader-print-blocker span, body.reader-body .reader-print-blocker small { color: #647083; }
}

@media (max-width: 1100px) {
    .book-grid { grid-template-columns: 1fr; }
    .reader-toolbar { grid-template-columns: minmax(96px, 1fr) minmax(200px, auto) auto; gap: 8px; }
    .tool-palette { min-width: 0; max-width: 340px; overflow-x: auto; scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
    .toolbar-right { display: flex; gap: 5px; }
    .toolbar-right .icon-button { width: 32px; height: 32px; }
    .tool { min-width: 40px; }
}

@media (pointer: coarse) {
    .primary-button, .secondary-button, .danger-button, .icon-button, .library-view-switch button { min-height: 44px; }
    .icon-button { min-width: 44px; }
}

@media (max-width: 820px), (max-height: 600px) and (pointer: coarse) {
    .topbar { padding: 0 18px; }
    .topnav > a, .user-chip { display: none; }
    .page-shell { width: min(100% - 28px, 620px); padding-top: 36px; }
    .welcome-row { align-items: center; }
    .date-card { width: 78px; height: 78px; padding: 10px; }
    .date-card strong { font-size: 22px; }
    .book-card { grid-template-columns: 38% 62%; }
    .book-info { padding: 22px; }
    .library-toolbar { grid-template-columns: 1fr 1fr auto; }
    .library-search { grid-column: 1 / -1; }
    .book-grid[data-view="list"] .book-card { grid-template-columns: 116px minmax(0, 1fr); }
    .book-grid[data-view="list"] .book-info { padding: 17px 19px; column-gap: 16px; }
    .admin-stats { grid-template-columns: repeat(2, 1fr); }
    .access-stats { grid-template-columns: repeat(3, 1fr); }
    .admin-grid { grid-template-columns: 1fr; }
    .filter-bar { grid-template-columns: 1fr 1fr; }
    .filter-bar .search-field { grid-column: 1 / -1; }
    .access-filter-bar { grid-template-columns: 1fr 150px auto; }
    .access-filter-bar .search-field { grid-column: 1 / -1; }
    .access-setting-grid { grid-template-columns: 1fr 1fr; }
    .access-setting-grid > label:last-child { grid-column: 1 / -1; }
    .detail-grid { grid-template-columns: 1fr; }
    .approval-panel { grid-template-columns: 1fr; align-items: stretch; }
    .member-summary-grid { grid-template-columns: repeat(2, 1fr); }
    .dashboard-audit-list { grid-template-columns: 1fr; }
    .manual-layout { grid-template-columns: 1fr; }
    .manual-toc { position: static; grid-template-columns: repeat(3, 1fr); }
    .manual-toc strong { grid-column: 1 / -1; }
    .toc-options { grid-template-columns: 1fr; }
    .contents-summary { grid-template-columns: repeat(2, 1fr); }
    .auto-contents-form { grid-template-columns: 1fr 1fr; }
    .auto-contents-form button { grid-column: 1 / -1; }
    .login-shell { grid-template-columns: 1fr; }
    .login-visual { display: none; }
    .login-panel { padding: 30px; }
    .mobile-brand { display: flex; }
    .reader-app { grid-template-columns: 1fr; }
    .reader-sidebar { position: fixed; inset: 0 auto 0 0; width: min(86vw, 320px); height: 100dvh; transform: translateX(-105%); transition: transform .25s; box-shadow: 20px 0 50px rgba(0,0,0,.25); }
    .reader-sidebar.open { transform: translateX(0); }
    .mobile-only { display: grid; }
    .reader-main { height: 100dvh; grid-template-rows: 104px 24px minmax(0, 1fr) 48px; }
    .reader-toolbar { padding: max(4px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) 4px max(8px, env(safe-area-inset-left)); grid-template-columns: auto minmax(0, 1fr); grid-template-rows: 48px 44px; align-items: center; gap: 4px 8px; }
    .toolbar-left { grid-column: 1; grid-row: 1; gap: 5px; }
    .toolbar-divider, .current-title, .back-link span { display: none; }
    .tool-palette { grid-column: 2; grid-row: 1; width: 100%; max-width: none; overflow-x: auto; }
    .toolbar-right { grid-column: 1 / -1; grid-row: 2; min-width: 0; display: flex; justify-content: center; gap: 8px; border-top: 1px solid #edf0f4; }
    .toolbar-right .icon-button { width: 44px; height: 44px; min-height: 44px; }
    .zoom-label { min-width: 48px; font-size: 10px; font-weight: 800; }
    .tool { min-width: 40px; }
    .tool small { display: none; }
    .reader-footer { padding-right: max(12px, env(safe-area-inset-right)); padding-left: max(12px, env(safe-area-inset-left)); grid-template-columns: 90px 1fr; }
    .secure-footer { display: none; }
    .page-stage { grid-template-columns: 38px minmax(0, 1fr) 38px; }
    .page-nav { width: 32px; height: 52px; }
}

@media (max-width: 560px) {
    .welcome-row h1 { font-size: 27px; }
    .welcome-row .muted { display: none; }
    .book-card { display: block; }
    .book-cover { display: block; height: 230px; }
    .book-cover img { width: 100%; object-position: center; }
    .library-heading { margin-bottom: 14px; }
    .library-toolbar { grid-template-columns: 1fr 1fr; padding: 9px; }
    .library-search { grid-column: 1 / -1; }
    .library-view-switch { grid-column: 1 / -1; }
    .library-view-switch button { flex: 1; }
    .book-grid[data-view="list"] .book-card { display: grid; grid-template-columns: 88px minmax(0, 1fr); min-height: 126px; }
    .book-grid[data-view="list"] .book-cover { height: auto; min-height: 126px; }
    .book-grid[data-view="list"] .book-info { padding: 13px 14px; display: block; }
    .book-grid[data-view="list"] .book-meta span:first-child, .book-grid[data-view="list"] .book-info p, .book-grid[data-view="list"] .access-period { display: none; }
    .book-grid[data-view="list"] .book-info h3 { margin: 10px 0 14px; font-size: 16px; line-height: 1.3; }
    .book-grid[data-view="list"] .primary-button { min-width: 0; min-height: 37px; padding: 0 12px; gap: 12px; font-size: 11px; }
    .access-period { margin-top: 20px; }
    .security-note { align-items: flex-start; }
    .form-row { grid-template-columns: 1fr; }
    .field-requirements { align-items: flex-start; flex-direction: column; }
    .approval-form { grid-template-columns: 1fr; }
    .approval-actions { flex-wrap: wrap; }
    .admin-stats article { padding: 16px; }
    .admin-stats strong { font-size: 24px; }
    .admin-heading-row, .member-profile-head { align-items: flex-start; flex-direction: column; }
    .admin-heading-row > .primary-button, .admin-heading-row > .secondary-button { width: 100%; white-space: normal; }
    .admin-heading-actions { width: 100%; flex-wrap: wrap; }
    .filter-bar { grid-template-columns: 1fr; }
    .filter-bar .search-field { grid-column: auto; }
    .access-choice-grid, .access-setting-grid, .bulk-grant-footer { grid-template-columns: 1fr; }
    .access-grant-panel { padding: 22px; }
    .access-choice-list { height: 260px; max-height: 260px; }
    .access-setting-grid > label:last-child { grid-column: auto; }
    .bulk-grant-footer .secondary-button { width: 100%; min-width: 0; white-space: normal; }
    .access-stats { grid-template-columns: repeat(2, 1fr); }
    .bulk-approval-bar { align-items: stretch; flex-direction: column; }
    .bulk-approval-bar .bulk-selected-count { margin-left: 0; align-self: flex-start; }
    .profile-badges { align-self: flex-start; }
    .member-summary-grid { gap: 8px; }
    .member-summary-grid article { min-height: 90px; padding: 15px; }
    .create-member-panel { padding: 22px; }
    .contents-admin-page { width: min(100% - 28px, 620px); }
    .contents-summary { gap: 8px; }
    .contents-summary article { padding: 15px; }
    .auto-contents-form { grid-template-columns: 1fr; }
    .auto-contents-form button { grid-column: auto; }
    .permanent-delete-form { width: auto; position: fixed; inset: 18vh 14px auto; }
    .manual-page { width: min(100% - 28px, 620px); }
    .manual-toc { grid-template-columns: 1fr 1fr; }
    .manual-section { padding: 20px; grid-template-columns: 1fr; }
    .manual-step { width: 36px; height: 36px; }
    .manual-faq div { grid-template-columns: 1fr; gap: 5px; }
    .manual-check-grid { grid-template-columns: 1fr; }
    .login-panel { place-items: start center; padding-top: 54px; }
}
