:root {
  --bg: #101214;
  --surface: #191c1f;
  --surface-2: #22262a;
  --line: rgba(255, 255, 255, .09);
  --text: #f5f3ef;
  --muted: #9ca2a7;
  --accent: #3db7e9;
  --accent-soft: rgba(61, 183, 233, .15);
  --panel-width: 282px;
  --topbar-height: 54px;
  --bottombar-height: 48px;
  font-family: Pretendard, "Noto Sans KR", "Malgun Gothic", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; background: var(--bg); color: var(--text); }
button, input { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.hidden { display: none !important; }
.mobile-only { display: none !important; }
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.app-shell {
  display: grid;
  grid-template: var(--topbar-height) minmax(0, 1fr) var(--bottombar-height) / var(--panel-width) minmax(0, 1fr);
  width: 100%; height: 100%;
}
.app-shell.panel-collapsed { grid-template-columns: 0 minmax(0, 1fr); }
.app-shell.panel-collapsed .side-panel { visibility: hidden; opacity: 0; transform: translateX(-100%); pointer-events: none; }
.app-shell.panel-collapsed .viewer { grid-row: 2 / 4; }
.app-shell.panel-collapsed .bottombar { display: none; }
.app-shell.panel-collapsed .stage { inset: 4px 58px; }
.app-shell.panel-collapsed .book { height: calc(100vh - var(--topbar-height) - 8px); }
.app-shell.panel-collapsed .page { height: calc(100vh - var(--topbar-height) - 8px); max-height: calc(100vh - var(--topbar-height) - 8px); }
.app-shell.panel-collapsed .page img { width: auto; height: 100%; max-width: 100%; max-height: none; object-fit: contain; }

.topbar {
  grid-area: 1 / 1 / 2 / 3;
  display: flex; align-items: center; gap: 18px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(20, 23, 25, .92);
  backdrop-filter: blur(18px);
  z-index: 20;
}
.brand-block { position: relative; display: flex; align-items: center; gap: 11px; min-width: 0; padding: 2px 13px 2px 2px; border: 1px solid rgba(61,183,233,.2); border-radius: 14px; background: linear-gradient(100deg, rgba(28,105,142,.3), rgba(24,66,86,.18) 62%, rgba(20,23,25,.08)); box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 5px 18px rgba(0,62,94,.16); }
.brand-mark {
  display: block; flex: 0 0 auto;
  width: 48px; height: 48px; border: 0; border-radius: 12px;
  background: transparent; overflow: hidden; filter: drop-shadow(0 0 7px rgba(61,183,233,.48)) drop-shadow(0 5px 8px rgba(0,57,88,.34));
}
.brand-mark img { display: block; width: auto; height: 100%; max-width: 100%; margin: 0 auto; object-fit: contain; object-position: center; }
.brand-copy { display: flex; flex-direction: column; justify-content: center; min-width: 0; gap: 5px; }
.brand-copy strong { max-width: min(44vw, 620px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 16px; font-weight: 800; line-height: 1.05; letter-spacing: -.025em; text-shadow: 0 1px 8px rgba(0,0,0,.24); }
.brand-copy span { color: #aab3ba; font-size: 12px; font-weight: 600; line-height: 1; letter-spacing: .015em; }
.top-actions { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.action-divider { width: 1px; height: 22px; margin: 0 7px; background: var(--line); }
.quick-tools {
  position: fixed; z-index: 18; top: calc(var(--topbar-height) + 18px); right: 14px;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 7px 6px; border: 1px solid rgba(255,255,255,.12); border-radius: 14px;
  background: rgba(22,26,29,.9); box-shadow: 0 10px 30px rgba(0,0,0,.24), inset 0 1px 0 rgba(255,255,255,.04);
  backdrop-filter: blur(14px); transition: opacity .16s ease, transform .16s ease;
}
.quick-tools .action-divider { width: 22px; height: 1px; margin: 4px 0; opacity: .72; }
.app-shell.archive-open .quick-tools { opacity: 0; transform: translateX(12px); pointer-events: none; }

.icon-button {
  display: inline-grid; place-items: center; width: 36px; height: 36px; padding: 0;
  border: 0; border-radius: 11px; color: #b6bbc0; background: transparent; cursor: pointer;
  transition: color .2s, background .2s, transform .2s;
}
.icon-button:hover { color: #fff; background: rgba(255,255,255,.07); }
.icon-button:active { transform: scale(.94); }
.icon-button.active { color: var(--accent); background: var(--accent-soft); }
#bookmarkButton.active svg { fill: currentColor; }
.icon-button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.archive-trigger { display: inline-flex; align-items: center; gap: 7px; height: 34px; margin: 0 3px; padding: 0 12px 0 10px; border: 1px solid rgba(61,183,233,.38); border-radius: 10px; color: #62c8f0; background: linear-gradient(135deg,rgba(61,183,233,.15),rgba(61,183,233,.06)); cursor: pointer; transition: color .2s,background .2s,border-color .2s,transform .2s; }
.archive-trigger:hover { color: #8bdafa; border-color: rgba(61,183,233,.72); background: rgba(61,183,233,.2); }
.archive-trigger:active { transform: scale(.96); }
.archive-trigger.active { color: #17130e; border-color: var(--accent); background: var(--accent); }
.archive-trigger svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.archive-trigger span { font-size: 12px; font-weight: 800; white-space: nowrap; }
.fullscreen-trigger { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; margin: 0; padding: 0; border: 0; border-radius: 11px; color: #b6bbc0; background: transparent; cursor: pointer; transition: color .2s,background .2s,transform .2s; }
.fullscreen-trigger:hover { color: #fff; background: rgba(255,255,255,.07); }
.fullscreen-trigger:active { transform: scale(.96); }
.fullscreen-trigger svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.fullscreen-trigger span { font-size: 12px; font-weight: 750; white-space: nowrap; }
.utility-trigger { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 10px; border: 1px solid rgba(255,255,255,.13); border-radius: 10px; color: #cbd0d3; background: transparent; cursor: pointer; transition: color .2s,background .2s,border-color .2s,transform .2s; }
.utility-trigger:hover { color: #fff; border-color: rgba(255,255,255,.3); background: rgba(255,255,255,.075); }
.utility-trigger:active { transform: scale(.96); }
.utility-trigger svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.utility-trigger span { font-size: 12px; font-weight: 750; white-space: nowrap; }
.close-trigger:hover { color: #ffd8d8; border-color: rgba(255,125,125,.35); background: rgba(255,90,90,.1); }

.side-panel {
  grid-area: 2 / 1 / 4 / 2; min-height: 0;
  display: grid; grid-template-rows: 60px minmax(0, 1fr) 48px;
  border-right: 1px solid var(--line); background: #15181a; z-index: 15;
  transition: transform .22s ease, opacity .22s ease, visibility .22s;
}
.panel-head { display: flex; align-items: center; padding: 0 18px; border-bottom: 1px solid var(--line); }
.panel-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; width: 100%; height: 100%; }
.panel-tab { position: relative; min-width: 0; padding: 0 3px; border: 0; color: var(--muted); background: none; font-size: 13px; font-weight: 700; line-height: 1; white-space: nowrap; word-break: keep-all; cursor: pointer; }
.panel-tab.active { color: var(--text); }
.panel-tab.active::after { content: ""; position: absolute; right: 0; bottom: -1px; left: 0; height: 2px; background: var(--accent); }
.smart-search-tab { display: inline-flex; align-items: center; justify-content: center; gap: 5px; }
.smart-search-symbol { display:inline-block; color:#62d5ff; font-size:15px; font-weight:900; line-height:1; transform:translateY(-1px); text-shadow:0 0 4px rgba(98,213,255,.75),0 0 10px rgba(61,183,233,.5); animation:smart-symbol-glow 2.4s ease-in-out infinite; }
.smart-search-tab.active .smart-search-symbol { color:#8ae2ff; text-shadow:0 0 5px rgba(138,226,255,.95),0 0 13px rgba(61,183,233,.78); }
@keyframes smart-symbol-glow { 0%,100% { opacity:.82; transform:translateY(-1px) scale(.94); } 50% { opacity:1; transform:translateY(-1px) scale(1.08); } }
.bookmark-tab { display: inline-flex; align-items: center; justify-content: center; gap: 4px; }
.bookmark-count { position: absolute; top: 8px; right: 0; display: inline-grid; place-items: center; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 9px; color: #082b3b; background: var(--accent); font: 800 9px/1 ui-monospace,monospace; }
.panel-content { min-height: 0; padding: 10px; overflow: auto; scrollbar-color: #42474b transparent; scrollbar-width: thin; }
.toc-item {
  display: grid; grid-template-columns: 38px minmax(0, 1fr); align-items: center; gap: 10px;
  width: 100%; min-height: 48px; padding: 7px 10px; border: 0; border-radius: 10px;
  color: #c7cbce; text-align: left; background: transparent; cursor: pointer;
}
.box-toc-section{margin-top:20px;padding-top:16px;border-top:1px solid rgba(255,255,255,.12)}
.box-toc-section h3{margin:0 12px 10px;font-size:13px;color:#e9f5fa;font-weight:700}
.box-toc-section .toc-title{white-space:normal;line-height:1.5;overflow-wrap:anywhere}
.box-toc-jobs{margin:4px 0}
@media (min-width:881px) and (pointer:fine) {
  #tocPanel{padding:6px 10px}
  #tocPanel .toc-item{min-height:28px;margin:0;padding:3px 9px;grid-template-columns:29px minmax(0,1fr);gap:6px}
  #tocPanel .toc-title{font-size:13px;line-height:1.4;color:#dce3e7}
  #tocPanel .box-toc-section{margin-top:10px;padding-top:10px}
  #tocPanel .box-toc-section h3{margin:0 9px 6px;font-size:14px}
  #tocPanel .box-toc-jobs{margin:0}
  #tocPanel .box-toc-jobs summary{padding:5px 9px;font-size:13px;line-height:18px;color:#dce3e7}
  #tocPanel .box-toc-jobs .box-toc-item{margin-left:14px;width:calc(100% - 14px)}
}
.box-toc-jobs summary{padding:10px 13px;color:#d6e2e7;cursor:pointer;font-size:13px;font-weight:700}
.box-toc-jobs .box-toc-item{margin-left:14px;width:calc(100% - 14px);border-left:1px solid rgba(255,255,255,.12)}
.toc-item:hover { color: #fff; background: rgba(255,255,255,.055); }
.toc-item.active { color: #fff; background: var(--accent-soft); }
.toc-number { color: var(--accent); font: 12px/1 ui-monospace, monospace; }
.toc-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.panel-footer { display: flex; align-items: center; padding: 0 20px; border-top: 1px solid var(--line); color: #737a80; font: 10px/1 ui-monospace, monospace; letter-spacing: .12em; text-transform: uppercase; }
.mobile-panel-actions{display:none;margin-left:auto;gap:5px}.mobile-panel-actions button{display:grid;place-items:center;width:32px;height:32px;padding:0;border:0;border-radius:9px;color:#9da5aa;background:rgba(255,255,255,.055)}.mobile-panel-actions svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.7}
.help-trigger{display:flex;align-items:center;gap:8px;margin-left:auto;padding:7px 10px 7px 7px;border:1px solid rgba(114,217,207,.18);border-radius:10px;color:#e7edef;background:rgba(255,255,255,.035);font-size:13px;font-weight:800;letter-spacing:-.02em;cursor:pointer;transition:.18s}.help-trigger:hover{color:#fff;border-color:rgba(114,217,207,.52);background:rgba(114,217,207,.1)}.help-trigger-icon{display:grid;place-items:center;width:22px;height:22px;border-radius:50%;color:#102529;background:var(--accent);box-shadow:0 0 0 3px rgba(114,217,207,.1)}.help-trigger-icon svg{width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.help-modal,.tour-overlay{position:fixed;inset:0;z-index:120;display:grid;place-items:center;padding:18px;background:rgba(4,7,9,.72);backdrop-filter:blur(8px);opacity:0;visibility:hidden;pointer-events:none;transition:.18s}.help-modal.open,.tour-overlay.open{opacity:1;visibility:visible;pointer-events:auto}.help-card,.tour-card{width:min(520px,100%);border:1px solid var(--line);border-radius:20px;color:var(--text);background:#171b1e;box-shadow:0 28px 80px rgba(0,0,0,.48)}.help-head{display:flex;align-items:center;justify-content:space-between;padding:18px 18px 14px;border-bottom:1px solid var(--line)}.help-head>div{display:flex;flex-direction:column;gap:5px}.help-head small,.tour-kicker{color:var(--accent);font:9px/1 ui-monospace,monospace;letter-spacing:.16em}.help-head strong{font-size:17px}.help-head button{display:grid;place-items:center;width:34px;height:34px;padding:0;border:0;border-radius:10px;color:var(--muted);background:transparent;cursor:pointer}.help-head svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8}.help-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;padding:14px}.help-grid article{display:flex;flex-direction:column;gap:7px;padding:13px;border-radius:12px;background:rgba(255,255,255,.035)}.help-grid b{color:#edf1f2;font-size:13px}.help-grid span{color:#929ba0;font-size:11px;line-height:1.6}.tour-replay{display:block;margin:0 14px 14px auto;padding:9px 13px;border:1px solid var(--line);border-radius:9px;color:#c7cdcf;background:transparent;font-size:11px;cursor:pointer}.tour-card{padding:24px}.tour-visual{width:58px;height:58px;margin:16px 0;border-radius:17px;background:var(--accent-soft);position:relative}.tour-visual::before{content:'↔';position:absolute;inset:0;display:grid;place-items:center;color:var(--accent);font-size:27px;font-weight:800}.tour-card strong{display:block;font-size:20px}.tour-card p{min-height:48px;margin:10px 0 18px;color:#a8b0b4;font-size:13px;line-height:1.7}.tour-dots{display:flex;gap:6px}.tour-dots span{width:6px;height:6px;border-radius:50%;background:#4b5357}.tour-dots span.active{width:20px;border-radius:4px;background:var(--accent)}.tour-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:18px}.tour-actions button{padding:10px 15px;border:0;border-radius:10px;font-size:12px;font-weight:750;cursor:pointer}.tour-actions #tourSkip{color:#929ba0;background:transparent}.tour-actions #tourNext{color:#17130e;background:var(--accent)}

.help-card{width:min(780px,100%);max-height:calc(100vh - 36px);overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin}.help-head{position:sticky;top:0;z-index:3;background:rgba(23,27,30,.97);backdrop-filter:blur(10px)}.help-head>div>span{color:#9ba6ab;font-size:11px;line-height:1.45}.help-grid{gap:10px;padding:16px}.help-grid article{gap:10px;padding:15px;border:1px solid rgba(255,255,255,.045);background:rgba(255,255,255,.032)}.help-item-head{display:flex;align-items:center;gap:9px}.help-item-head i{display:grid;place-items:center;flex:0 0 25px;height:25px;border-radius:8px;color:#102529;background:var(--accent);font:800 9px/1 ui-monospace,monospace}.help-item-head b{font-size:13px}.help-grid ul{display:grid;gap:5px;margin:0;padding:0;list-style:none}.help-grid li{position:relative;padding-left:12px;color:#b9c2c6;font-size:11px;line-height:1.55}.help-grid li::before{content:"";position:absolute;left:1px;top:.66em;width:4px;height:4px;border-radius:50%;background:#5fc9c0}.help-grid li strong{color:#eef4f5;font-weight:750}.help-grid kbd,.help-shortcuts kbd{display:inline-grid;min-width:20px;height:18px;margin:0 2px;padding:0 4px;place-items:center;border:1px solid #4b555a;border-bottom-color:#30373b;border-radius:4px;color:#e5ebed;background:#252b2f;box-shadow:0 1px 0 #0b0d0e;font:9px/1 ui-monospace,monospace}.help-shortcuts{display:flex;align-items:center;flex-wrap:wrap;gap:8px 14px;margin:0 16px 14px;padding:11px 13px;border:1px solid rgba(114,217,207,.13);border-radius:11px;color:#aeb8bc;background:rgba(114,217,207,.045);font-size:10px}.help-shortcuts strong{margin-right:3px;color:#dff7f4;font-size:11px}.help-shortcuts span{display:flex;align-items:center;gap:2px;white-space:nowrap}
.thumbnail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: max-content; align-items: start; gap: 12px 10px; padding: 14px; }
.thumbnail-grid:not(.hidden) { display: grid; align-content: start; }
.thumbnail { position: relative; display: block; align-self: start; width: 100%; height: auto; padding: 0; border: 1px solid transparent; border-radius: 7px; overflow: hidden; background: #222; cursor: pointer; }
.thumbnail img { display: block; width: 100%; height: auto; aspect-ratio: 245 / 350; object-fit: contain; background: #eee; }
.thumbnail span { position: absolute; right: 4px; bottom: 4px; min-width: 23px; padding: 3px 5px; border-radius: 5px; color: #fff; background: rgba(0,0,0,.68); font-size: 9px; }
.thumbnail.active { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(40,184,170,.16); }
.search-panel { padding: 0; overflow: hidden; }
.search-panel:not(.hidden) { display: grid; grid-template-rows: auto auto auto auto minmax(0,1fr); }
.ai-panel{padding:0;overflow:hidden;background:linear-gradient(180deg,rgba(61,183,233,.035),transparent 28%)}
.ai-panel:not(.hidden){display:grid;grid-template-rows:minmax(0,1fr) auto}
.ai-chat{min-height:0;padding:16px 12px 20px;overflow-y:auto;scrollbar-width:thin;scrollbar-color:#42474b transparent}
.ai-message{display:flex;align-items:flex-start;gap:8px;margin:0 0 14px}
.ai-message.user{justify-content:flex-end;padding-left:28px}
.ai-avatar{display:grid;place-items:center;flex:0 0 29px;width:29px;height:29px;border-radius:10px;color:#071d27;background:var(--accent);font:900 10px/1 ui-monospace,monospace;box-shadow:0 5px 14px rgba(61,183,233,.18)}
.ai-bubble{display:flex;flex-direction:column;gap:8px;max-width:calc(100% - 37px);padding:11px 12px;border:1px solid rgba(255,255,255,.075);border-radius:4px 14px 14px 14px;color:#bdc5ca;background:#1c2124;font-size:12px;line-height:1.55;box-shadow:0 8px 24px rgba(0,0,0,.12)}
.ai-message.user .ai-bubble{max-width:92%;border-color:rgba(61,183,233,.2);border-radius:14px 4px 14px 14px;color:#e9f8ff;background:rgba(61,183,233,.14)}
.ai-bubble strong{color:#f3f6f7;font-size:13px}.ai-bubble small{color:#788187;font-size:10px}.ai-message.loading .ai-bubble{color:#8c969b;animation:ai-pulse 1.1s ease-in-out infinite}
.ai-keywords{display:flex;flex-wrap:wrap;gap:5px}.ai-keywords span{padding:4px 7px;border:1px solid rgba(61,183,233,.18);border-radius:999px;color:var(--accent);background:rgba(61,183,233,.07);font-size:9px}
.ai-result{display:grid;grid-template-columns:32px minmax(0,1fr);gap:9px;width:100%;padding:9px;border:1px solid rgba(255,255,255,.07);border-radius:10px;color:#d8dde0;text-align:left;background:rgba(0,0,0,.13);cursor:pointer}.ai-result:hover{border-color:rgba(61,183,233,.35);background:rgba(61,183,233,.08)}
.ai-result-copy{display:flex;min-width:0;flex-direction:column;gap:3px}.ai-result-copy b{font-size:11px}.ai-result-copy>span{display:-webkit-box;overflow:hidden;color:#929ba0;font-size:10px;line-height:1.45;-webkit-line-clamp:2;-webkit-box-orient:vertical}.ai-result-copy mark{padding:0 1px;color:#fff1b4;background:rgba(255,190,44,.22)}
.ai-form{display:grid;grid-template-columns:minmax(0,1fr) 38px;gap:7px;padding:10px;border-top:1px solid var(--line);background:#15181a}.ai-form input{min-width:0;height:40px;padding:0 13px;border:1px solid #363d41;border-radius:12px;outline:0;color:#f2f5f6;background:#1b1f22;font-size:12px}.ai-form input:focus{border-color:var(--accent);box-shadow:0 0 0 3px rgba(61,183,233,.1)}.ai-form button{display:grid;place-items:center;width:38px;height:38px;padding:0;border:0;border-radius:12px;color:#09232e;background:var(--accent);cursor:pointer}.ai-form button svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2}
@keyframes ai-pulse{50%{opacity:.55}}

.viewer { grid-area: 2 / 2 / 3 / 3; position: relative; min-width: 0; min-height: 0; overflow: hidden; background: radial-gradient(circle at 50% 36%, #303438 0, #1c2023 36%, #111416 90%); }
.viewer::before { content: ""; position: absolute; inset: 0; opacity: .18; pointer-events: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.16'/%3E%3C/svg%3E"); }
.viewer-glow { position: absolute; top: 12%; left: 50%; width: 66%; height: 60%; translate: -50% 0; border-radius: 50%; background: rgba(40,184,170,.055); filter: blur(70px); pointer-events: none; }
.stage { position: absolute; inset: 4px 58px 6px; display: grid; place-items: center; overflow: hidden; touch-action: none; }
.book { position: relative; display: flex; justify-content: center; align-items: center; width: 100%; height: 100%; transform-origin: center; transition: transform .18s ease; will-change: auto; backface-visibility: visible; }
.book.zoomed { transition: none; }
.page { position: relative; display: none; max-width: 50%; max-height: 100%; margin: 0; background: #e8e5df; box-shadow: 0 20px 60px rgba(0,0,0,.42); overflow: hidden; }
.page.visible { display: block; }
.page img { display: block; max-width: 100%; max-height: calc(100vh - var(--topbar-height) - var(--bottombar-height) - 10px); width: auto; height: auto; object-fit: contain; user-select: none; -webkit-user-drag: none; opacity: 0; transition: opacity .25s ease; }
.page img.loaded { opacity: 1; }
.page img { backface-visibility: visible; transform: none; image-rendering: auto; }
.page img.mobile-repaint { transform: translateZ(.01px); }
.page figcaption { position: absolute; bottom: 10px; min-width: 27px; padding: 5px 7px; border-radius: 7px; color: white; background: rgba(13,15,16,.66); backdrop-filter: blur(5px); font: 10px/1 ui-monospace, monospace; }
.left-page { border-radius: 5px 0 0 5px; }
.right-page { border-radius: 0 5px 5px 0; }
.left-page figcaption { left: 10px; }
.right-page figcaption { right: 10px; }
.book:not(.spread) .page { max-width: 100%; border-radius: 5px; }
.book:not(.spread) .page figcaption { right: 10px; left: auto; }
.book-spine { display: none; position: relative; align-self: stretch; z-index: 2; flex: 0 0 1px; background: rgba(0,0,0,.28); box-shadow: 0 0 18px 8px rgba(0,0,0,.2); }
.book.spread .book-spine { display: block; }
.page-loader { position: absolute; inset: 0; display: grid; place-items: center; background: #d9d6d0; }
.page:has(img.loaded) .page-loader { display: none; }
.page-loader span { width: 24px; height: 24px; border: 2px solid rgba(0,0,0,.15); border-top-color: #896d45; border-radius: 50%; animation: spin .8s linear infinite; }
.page{overflow:visible}.page img,.page-loader,.page-error{border-radius:inherit}.page-bookmark{position:absolute;top:0;z-index:4;display:grid;place-items:center;width:34px;height:34px;padding:0;border:1px solid rgba(255,255,255,.2);border-radius:10px;color:#fff;background:rgba(15,18,20,.72);box-shadow:0 5px 16px rgba(0,0,0,.24);backdrop-filter:blur(8px);cursor:pointer;opacity:.78;transition:opacity .18s,scale .18s}.page-bookmark:hover{opacity:1;scale:1.06}.page-bookmark svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8}.page-bookmark.active{color:#17130e;border-color:var(--accent);background:var(--accent);opacity:1}.page-bookmark.active svg{fill:currentColor}.left-page .page-bookmark{left:-8px;translate:-100% 0}.right-page .page-bookmark{right:-8px;translate:100% 0}
.page-error{position:absolute;inset:0;z-index:5;display:none;place-content:center;justify-items:center;gap:12px;padding:20px;color:#50575c;text-align:center;background:#e4e2dc}.page-error.visible{display:grid}.page-error strong{font-size:13px}.page-error button{padding:8px 14px;border:0;border-radius:9px;color:#17130e;background:var(--accent);font-size:12px;font-weight:800;cursor:pointer}
@keyframes spin { to { transform: rotate(360deg); } }

.page-arrow { position: absolute; top: 50%; z-index: 5; display: grid; place-items: center; width: 46px; height: 70px; translate: 0 -50%; border: 1px solid var(--line); border-radius: 14px; color: #bfc4c7; background: rgba(15,17,19,.5); backdrop-filter: blur(12px); cursor: pointer; transition: .2s; }
.page-arrow:hover { color: #fff; border-color: rgba(40,184,170,.38); background: rgba(30,33,35,.82); }
.page-arrow:disabled { opacity: .22; cursor: default; }
.page-arrow svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.page-arrow.previous { left: 18px; }
.page-arrow.next { right: 18px; }
.zoom-controls { position: absolute; right: 18px; bottom: 16px; z-index: 6; display: flex; align-items: center; gap: 2px; padding: 4px; border: 1px solid var(--line); border-radius: 13px; background: rgba(16,18,20,.72); backdrop-filter: blur(14px); }
.zoom-controls .icon-button { width: 32px; height: 32px; }
.zoom-controls .icon-button svg { width: 16px; height: 16px; }
#zoomValue { min-width: 48px; color: #aeb3b7; text-align: center; font: 10px/1 ui-monospace, monospace; }

.bottombar { grid-area: 3 / 2 / 4 / 3; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 0 20px; border-top: 1px solid var(--line); background: #15181a; z-index: 10; }
.icon-button.compact { width: 34px; height: 34px; }
.page-scrubber { display: flex; align-items: center; gap: 18px; width: min(720px, 76%); }
#pageRange { width: 100%; height: 3px; appearance: none; border-radius: 2px; background: linear-gradient(to right, var(--accent) var(--range-progress, 0%), #3a3f43 var(--range-progress, 0%)); cursor: pointer; }
#pageRange::-webkit-slider-thumb { width: 14px; height: 14px; appearance: none; border: 3px solid #17191b; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.page-readout { display: flex; align-items: center; flex: 0 0 auto; color: #7f868b; font: 11px/1 ui-monospace, monospace; }
.page-readout label { margin-right: 9px; color: #666d72; font-size: 9px; letter-spacing: .12em; }
#pageInput { width: 42px; padding: 5px 2px; border: 0; border-bottom: 1px solid #4b5155; color: var(--text); text-align: center; background: transparent; -moz-appearance: textfield; }
#pageInput::-webkit-inner-spin-button { display: none; }

.link-layer { position: absolute; inset: 0; pointer-events: none; }
.page-link { position: absolute; border: 1px solid transparent; pointer-events: auto; }
.page-link:hover { border-color: var(--accent); background: rgba(40,184,170,.12); }
.detail-link-marker{position:absolute;z-index:6;display:grid;place-items:center;box-sizing:border-box;width:12px;height:12px;translate:-100% 0;border:1px solid #34414b;border-radius:3px;color:#26343e;background:#fff;box-shadow:0 1px 2px rgba(0,0,0,.25);pointer-events:auto;opacity:1;transition:scale .14s,background .14s,color .14s}.detail-link-marker::before{content:"";position:absolute;inset:-5px}.detail-link-marker svg{display:block;width:9px;height:9px;fill:none;stroke:currentColor;stroke-width:2.1;stroke-linecap:round;stroke-linejoin:round}.detail-link-marker:hover,.detail-link-marker:focus-visible{color:#101d27;background:#f2f7fa;scale:1.12}.detail-link-marker:focus-visible{outline:2px solid #34414b;outline-offset:2px}@media(pointer:coarse){.detail-link-marker{width:14px;height:14px}.detail-link-marker svg{width:11px;height:11px}}
.detail-link-marker.detail-link-left{translate:0 0}
.detail-link-marker.dense{width:11px;height:11px}.detail-link-marker.dense::before{inset:-6px}.detail-link-marker.dense svg{width:8px;height:8px;stroke-width:2.2}.detail-link-marker.dense:hover,.detail-link-marker.dense:focus-visible{scale:1.14}@media(pointer:coarse){.detail-link-marker.dense{width:13px;height:13px}.detail-link-marker.dense svg{width:10px;height:10px}}
.detail-link-marker.detail-link-orange{width:10px;height:10px;border:0;border-radius:0;color:#e66c1a;background:transparent;box-shadow:none;opacity:.96}.detail-link-marker.detail-link-orange svg{width:10px;height:10px;stroke-width:2;filter:drop-shadow(0 0 1px #fff)}.detail-link-marker.detail-link-orange:hover,.detail-link-marker.detail-link-orange:focus-visible{color:#bd4700;background:transparent;scale:1.16}.detail-link-marker.detail-link-orange:focus-visible{outline:1px solid #e66c1a}.detail-link-marker.detail-link-orange.dense{width:9px;height:9px;opacity:.94}.detail-link-marker.detail-link-orange.dense svg{width:9px;height:9px;stroke-width:2.1}@media(pointer:coarse){.detail-link-marker.detail-link-orange{width:12px;height:12px}.detail-link-marker.detail-link-orange svg{width:12px;height:12px}.detail-link-marker.detail-link-orange.dense{width:11px;height:11px}.detail-link-marker.detail-link-orange.dense svg{width:11px;height:11px}}
.book:not(.zoomed) .detail-link-marker{display:none}
@media(hover:hover){.detail-link-marker::after{content:attr(data-tip);position:absolute;left:50%;bottom:calc(100% + 2px);z-index:2;width:max-content;padding:2px 4px;border:1px solid rgba(255,255,255,.28);border-radius:3px;color:#fff;background:rgba(25,35,43,.94);box-shadow:0 3px 9px rgba(0,0,0,.25);font:500 7px/1.1 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;letter-spacing:-.035em;white-space:nowrap;pointer-events:none;opacity:0;visibility:hidden;translate:-50% 2px;transform:scale(var(--detail-tip-scale,1));transform-origin:50% 100%;transition:opacity .12s,translate .12s,visibility .12s;backdrop-filter:blur(5px)}.detail-link-marker:hover::after,.detail-link-marker:focus-visible::after{opacity:1;visibility:visible;translate:-50% 0}}
.promo-agency-link{position:absolute;z-index:3;left:69.3%;top:1.45%;width:27.4%;height:4.05%;border:1px solid transparent;border-radius:5px;pointer-events:auto;cursor:pointer;transition:border-color .18s,background .18s,box-shadow .18s}.promo-agency-link:hover,.promo-agency-link:focus-visible{border-color:rgba(61,183,233,.75);background:rgba(61,183,233,.1);box-shadow:0 0 0 2px rgba(61,183,233,.14)}.promo-agency-link:focus-visible{outline:2px solid #fff;outline-offset:2px}.promo-click-cue{position:absolute;right:-20%;top:76%;z-index:2;display:grid;place-items:center;width:22px;height:22px;color:#fff;border:1px solid rgba(255,255,255,.58);border-radius:50%;background:rgba(11,43,58,.82);box-shadow:0 4px 12px rgba(0,0,0,.26);backdrop-filter:blur(7px);animation:promo-cue 1s ease-in-out 3}.promo-click-cue svg{position:relative;z-index:2;width:14px;height:14px;fill:currentColor;stroke:#0b2b3a;stroke-width:.45}.promo-click-cue i{position:absolute;inset:-3px;border:2px solid rgba(61,183,233,.75);border-radius:50%;animation:promo-ripple 1s ease-out 3}.promo-agency-link:hover .promo-click-cue{color:#082b3b;background:var(--accent);border-color:var(--accent)}@keyframes promo-cue{0%,100%{translate:0 0;opacity:1}45%{translate:-4px -4px;opacity:.45}70%{translate:-2px -2px;opacity:1}}@keyframes promo-ripple{0%{scale:.65;opacity:.9}100%{scale:1.4;opacity:0}}
.search-highlight { position: absolute; z-index: 2; box-sizing: border-box; border: 0; border-radius: 2px; outline: 1px solid #ff3b8d; outline-offset: 0; background: rgba(255,59,141,.11); box-shadow: none; pointer-events: none; }
.search-highlight.selected { z-index: 4; outline: 1px solid #ff7a00; outline-offset: 0; background: rgba(255,122,0,.22); box-shadow: none; animation: selected-search-pulse 1s ease-in-out 3; }
@keyframes selected-search-pulse { 0%,100% { outline-color:#ff7a00; background-color:rgba(255,122,0,.2); } 50% { outline-color:#ff9a32; background-color:rgba(255,153,51,.32); } }
.search-form { display: grid; grid-template-columns: 22px minmax(0,1fr) auto; align-items: center; gap: 8px; padding: 12px 10px 12px 16px; border-bottom: 1px solid var(--line); }
.search-form:focus-within { border-bottom-color: var(--accent); box-shadow: inset 0 -1px 0 var(--accent); }
.search-form > svg { width: 18px; height: 18px; fill: none; stroke: var(--accent); stroke-width: 1.8; }
.search-form input { min-width: 0; padding: 9px 4px; border: 0; color: #fff; background: transparent; outline: 0; font-size: 14px; }
.search-form input::placeholder { color: #6f767b; }
.voice-search-button { display:none; place-items:center; width:34px; height:34px; padding:0; border:1px solid rgba(61,183,233,.35); border-radius:50%; color:#70d2f7; background:rgba(61,183,233,.09); cursor:pointer; }
.voice-search-button svg { width:17px; height:17px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.voice-search-button.listening { color:#fff; border-color:#ef5a67; background:#d63f4d; box-shadow:0 0 0 4px rgba(239,90,103,.16); animation:voice-listening 1.1s ease-in-out infinite; }
@keyframes voice-listening { 50% { box-shadow:0 0 0 7px rgba(239,90,103,.06); } }
@media (max-width:880px) {
  .search-form.voice-ready { grid-template-columns:22px minmax(0,1fr) auto auto; gap:6px; padding-right:8px; }
  .search-form.voice-ready .voice-search-button { display:grid; }
}
.search-submit { padding: 8px 13px; border: 0; border-radius: 9px; color: #1a1712; background: var(--accent); font-size: 12px; font-weight: 800; cursor: pointer; }
.search-options { display:flex; align-items:center; justify-content:flex-end; min-height:32px; padding:5px 11px 0; }
.exact-search-option { display:inline-flex; align-items:center; gap:7px; color:#b9c2c7; font-size:11px; font-weight:700; cursor:pointer; user-select:none; }
.exact-search-option input { position:absolute; opacity:0; pointer-events:none; }
.exact-search-check { position:relative; width:30px; height:17px; border:1px solid #58636a; border-radius:999px; background:#252a2d; transition:.16s ease; }
.exact-search-check::after { position:absolute; top:2px; left:2px; width:11px; height:11px; border-radius:50%; background:#a6afb4; content:''; transition:.16s ease; }
.exact-search-option input:checked + .exact-search-check { border-color:#3db7e9; background:rgba(61,183,233,.25); }
.exact-search-option input:checked + .exact-search-check::after { left:15px; background:#55c8f5; }
.exact-search-option input:focus-visible + .exact-search-check { outline:2px solid rgba(61,183,233,.45); outline-offset:2px; }
.search-smart-guide { margin: 10px 10px 0; padding: 10px 11px; border: 1px solid rgba(61,183,233,.22); border-radius: 10px; color: #b9c8cf; background: rgba(61,183,233,.065); font-size: 11px; line-height: 1.55; }
.search-smart-guide strong { display: block; margin-bottom: 3px; color: #55c8f5; font-size: 11px; font-weight: 800; }
.search-smart-guide code { color: #edf7fb; font: inherit; font-weight: 700; }
.search-summary { padding: 12px 16px; color: #c9d2d7; border-bottom: 1px solid var(--line); background: rgba(61,183,233,.035); font-size: 12px; font-weight: 650; line-height: 1.55; letter-spacing: .01em; }
.search-results { min-height: 0; padding: 8px; overflow: auto; }
.search-page-group { margin-bottom: 6px; overflow: hidden; border: 1px solid rgba(255,255,255,.065); border-radius: 11px; background: rgba(255,255,255,.018); }
.search-page-header { display: grid; grid-template-columns: 38px minmax(0,1fr) auto 18px; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; color: #e3e6e8; text-align: left; background: transparent; cursor: pointer; }
.search-page-header:hover,.search-page-group.open .search-page-header { background: rgba(61,183,233,.075); }
.search-page-title { color: #f0f4f6; font-size: 13px; font-weight: 800; }
.search-page-count { padding: 4px 8px; border-radius: 999px; color: #55c8f5; background: rgba(61,183,233,.15); font-size: 11px; font-weight: 800; }
.search-page-chevron { width: 17px; height: 17px; fill: none; stroke: #788187; stroke-width: 1.8; transition: transform .16s ease; }
.search-page-group.open .search-page-chevron { transform: rotate(180deg); }
.search-page-items { padding: 3px 7px 7px; border-top: 1px solid rgba(255,255,255,.055); }
.search-page-items[hidden] { display: none; }
.search-ad-result { display: grid; grid-template-columns: 26px minmax(0,1fr); align-items: start; gap: 8px; width: 100%; padding: 9px 7px; border: 0; border-radius: 8px; color: #d7dadd; text-align: left; background: transparent; cursor: pointer; }
.search-ad-result:hover,.search-ad-result:focus-visible { background: rgba(255,255,255,.055); outline: 0; }
.search-ad-result.selected { color: #fff5e8; background: rgba(255,122,0,.12); box-shadow: inset 2px 0 0 #ff7a00; }
.search-ad-result.selected .search-ad-number { color: #211002; background: #ff9a32; }
.search-ad-number { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 6px; color: #8b969c; background: rgba(255,255,255,.055); font: 700 10px/1 ui-monospace,monospace; }
.search-result-page { display: grid; place-items: center; align-self: start; height: 28px; border-radius: 7px; color: #55c8f5; background: rgba(61,183,233,.15); font: 800 13px/1 ui-monospace,monospace; }
.search-result-text { display: -webkit-box; overflow: hidden; color: #c6cacf; font-size: 12px; line-height: 1.55; cursor: help; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.search-result-text mark{padding:0 2px;border-radius:3px;color:#fff1b4;background:rgba(255,190,44,.24)}
.search-tooltip{position:fixed;z-index:100;max-width:min(380px,calc(100vw - 24px));padding:12px 14px;border:1px solid rgba(40,184,170,.3);border-radius:11px;color:#eef1f2;background:rgba(12,15,17,.96);box-shadow:0 14px 38px rgba(0,0,0,.38);font-size:12px;line-height:1.65;opacity:0;visibility:hidden;pointer-events:none;transform:translateY(4px);transition:opacity .1s,transform .1s,visibility .1s}.search-tooltip.visible{opacity:1;visibility:visible;transform:translateY(0)}
.search-empty { padding: 42px 20px; color: #777f84; text-align: center; font-size: 12px; }
.search-load-more { display:flex; width:100%; margin:10px 0 4px; padding:12px 14px; align-items:center; justify-content:space-between; gap:10px; border:1px solid rgba(61,183,233,.28); border-radius:10px; color:#eef9fd; background:rgba(61,183,233,.12); cursor:pointer; }
.search-load-more:hover,.search-load-more:focus-visible { border-color:rgba(85,200,245,.55); background:rgba(61,183,233,.2); outline:0; }
.search-load-more:disabled { cursor:wait; opacity:.65; }
.search-load-more span { font-size:13px; font-weight:800; white-space:nowrap; }
.search-load-more small { color:#7fd5f6; font-size:10px; font-weight:700; white-space:nowrap; }
.search-loading { display: flex; min-height: 190px; padding: 34px 20px; flex-direction: column; align-items: center; justify-content: center; color: #dfe8ec; text-align: center; }
.search-loading-spinner { width: 32px; height: 32px; margin-bottom: 16px; border: 3px solid rgba(61,183,233,.18); border-top-color: #3db7e9; border-radius: 50%; box-shadow: 0 0 18px rgba(61,183,233,.13); animation: search-spin .8s linear infinite; }
.search-loading strong { font-size: 13px; font-weight: 800; letter-spacing: -.01em; }
.search-loading-note { max-width: 220px; margin-top: 7px; color: #8f9ba1; font-size: 11px; line-height: 1.55; }
.search-loading-dots { display: flex; gap: 5px; margin-top: 15px; }
.search-loading-dots i { width: 5px; height: 5px; border-radius: 50%; background: #3db7e9; animation: search-dot 1.1s ease-in-out infinite; }
.search-loading-dots i:nth-child(2) { animation-delay: .14s; }
.search-loading-dots i:nth-child(3) { animation-delay: .28s; }
@keyframes search-spin { to { transform: rotate(360deg); } }
@keyframes search-dot { 0%,60%,100% { opacity: .25; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-4px); } }
@media (prefers-reduced-motion: reduce) { .search-loading-spinner,.search-loading-dots i,.search-highlight.selected,.smart-search-symbol { animation: none; } }
.bookmark-panel { padding: 10px; }
.bookmark-item { display: grid; grid-template-columns: minmax(0,1fr) 34px; align-items: center; margin-bottom: 6px; border-radius: 10px; background: transparent; }
.bookmark-item:hover { background: rgba(255,255,255,.05); }
.bookmark-item.active { background: var(--accent-soft); }
.bookmark-move { display: grid; grid-template-columns: 38px minmax(0,1fr); align-items: center; gap: 10px; min-width: 0; padding: 9px 6px; border: 0; color: #d9dcde; text-align: left; background: transparent; cursor: pointer; }
.bookmark-page { display: grid; place-items: center; width: 34px; height: 32px; border-radius: 8px; color: var(--accent); background: rgba(40,184,170,.12); font: 700 12px/1 ui-monospace,monospace; }
.bookmark-copy { display: flex; flex-direction: column; min-width: 0; gap: 4px; }
.bookmark-copy strong { font-size: 13px; }
.bookmark-copy small { color: #747c81; font-size: 10px; }
.bookmark-remove { display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 8px; color: #777f84; background: transparent; cursor: pointer; }
.bookmark-remove:hover { color: #fff; background: rgba(255,255,255,.08); }
.bookmark-remove svg, .bookmark-empty svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.bookmark-empty { display: flex; flex-direction: column; align-items: center; gap: 9px; padding: 54px 14px; color: #737b80; text-align: center; }
.bookmark-empty svg { width: 28px; height: 28px; margin-bottom: 5px; color: var(--accent); }
.bookmark-empty strong { color: #b9bec1; font-size: 13px; }
.bookmark-empty span { font-size: 11px; line-height: 1.55; }
.archive-drawer { position: absolute; top: 16px; right: 16px; z-index: 12; display: grid; grid-template-rows: auto auto minmax(0,1fr); width: min(380px, calc(100% - 32px)); max-height: calc(100% - 32px); border: 1px solid var(--line); border-radius: 20px; background: rgba(22,25,27,.97); box-shadow: 0 24px 70px rgba(0,0,0,.42); backdrop-filter: blur(20px); opacity: 0; translate: 18px 0; pointer-events: none; transition: .22s ease; overflow: hidden; }
.archive-drawer.open { opacity: 1; translate: 0; pointer-events: auto; }
.archive-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 10px 14px 18px; border-bottom: 1px solid var(--line); }
.archive-head > div { display: flex; flex-direction: column; gap: 4px; }
.archive-head span { color: var(--accent); font: 9px/1 ui-monospace,monospace; letter-spacing: .18em; }
.archive-head strong { font-size: 15px; }
.archive-current { display: grid; gap: 4px; padding: 11px 18px; background: linear-gradient(100deg,rgba(40,184,170,.15),rgba(40,184,170,.03)); border-bottom: 1px solid var(--line); }
.archive-current span { color: #92999e; font-size: 10px; }
.archive-current strong { grid-area: 1 / 2 / 3; color: var(--accent); font: 20px/1 ui-monospace,monospace; }
.archive-current small { color: #e0e2e3; font-size: 12px; }
.archive-results { min-height: 0; padding: 8px; overflow: auto; }
.archive-calendar{padding:8px 10px 12px}
.archive-calendar-toolbar{display:grid;grid-template-columns:38px minmax(0,1fr) 38px;align-items:center;gap:8px;padding:5px 0 13px}
.archive-calendar-toolbar button{display:grid;width:36px;height:36px;padding:0;place-items:center;border:1px solid rgba(255,255,255,.09);border-radius:12px;color:#dce5e9;background:rgba(255,255,255,.045);font-size:23px;line-height:1;cursor:pointer;transition:background .16s,border-color .16s,color .16s,transform .12s}
.archive-calendar-toolbar button:hover:not(:disabled){border-color:rgba(98,200,240,.42);color:#79d4f6;background:rgba(61,183,233,.11)}
.archive-calendar-toolbar button:active:not(:disabled){transform:scale(.94)}
.archive-calendar-toolbar button:disabled{color:#4f575c;cursor:default;opacity:.42}
.archive-month-label{text-align:center;color:#f1f5f6;font-size:15px;font-weight:800;letter-spacing:-.02em}
.archive-weekdays,.archive-calendar-grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:5px}
.archive-weekdays{padding:0 0 7px;color:#768087;font-size:10px;font-weight:750;text-align:center}
.archive-weekdays span:first-child{color:#c87982}.archive-weekdays span:last-child{color:#6d9bc8}
.archive-calendar-grid{grid-auto-rows:39px}
.archive-day{display:grid;min-width:0;height:39px;padding:0;place-items:center;border:0;border-radius:12px;font:700 12px/1 ui-monospace,monospace}
.archive-day.empty{visibility:hidden}
.archive-day.unavailable{color:#4b5358;background:transparent}
button.archive-day.available{position:relative;color:#d9e6eb;background:rgba(255,255,255,.055);cursor:pointer;transition:color .15s,background .15s,transform .12s,box-shadow .15s}
button.archive-day.available::after{content:"";position:absolute;bottom:5px;width:3px;height:3px;border-radius:50%;background:#54c7ec;opacity:.82}
button.archive-day.available:hover{color:#fff;background:rgba(61,183,233,.17);transform:translateY(-1px)}
button.archive-day.current{color:#07161c;background:linear-gradient(135deg,#67d5f7,#38b6e4);box-shadow:0 8px 20px rgba(30,157,205,.28);cursor:default}
button.archive-day.current::after{background:#123b4a}
.archive-calendar-help{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:8px 10px;margin:12px 3px 0;padding-top:11px;border-top:1px solid rgba(255,255,255,.07);color:#707b81;font-size:10px}
.archive-calendar-help span{display:flex;align-items:center;gap:7px;min-width:0}
.archive-calendar-help i{flex:0 0 6px;width:6px;height:6px;border-radius:50%;background:#54c7ec;box-shadow:0 0 0 4px rgba(84,199,236,.1)}
.archive-calendar-start{flex:0 0 auto;color:#92a1a8;font-size:10px;font-weight:700;white-space:nowrap}
.archive-item { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; border: 0; border-radius: 10px; color: #d8dbdd; text-align: left; background: transparent; cursor: pointer; }
.archive-item:hover { background: rgba(255,255,255,.055); }
.archive-item.current { background: var(--accent-soft); cursor: default; }
.archive-date { color: var(--accent); font: 12px/1.2 ui-monospace,monospace; white-space: nowrap; }
.archive-copy { min-width: 0; }
.archive-copy strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 600; }
.archive-copy span { display: block; margin-top: 4px; color: #777f84; font-size: 10px; }
.archive-arrow { color: #656c71; font-size: 18px; }
.panel-scrim { display: none; }
.toast { position: fixed; bottom: 92px; left: 50%; z-index: 100; padding: 11px 16px; border: 1px solid var(--line); border-radius: 10px; color: #fff; background: rgba(20,22,24,.92); box-shadow: 0 12px 40px rgba(0,0,0,.35); opacity: 0; translate: -50% 12px; pointer-events: none; transition: .25s; font-size: 12px; }
.toast.visible { opacity: 1; translate: -50% 0; }

/* 화면 가득 보기: 신문 외의 UI를 숨기고 페이지 영역을 최대화한다. */
.app-shell.focus-mode { display: block; background: #0d0f10; }
.app-shell.focus-mode .topbar,
.app-shell.focus-mode .side-panel,
.app-shell.focus-mode .bottombar { display: none; }
.app-shell.focus-mode .viewer { position: fixed; inset: 0; }
.app-shell.focus-mode .stage { inset: 4px 58px; }
.app-shell.focus-mode .book { height: calc(100vh - 8px); }
.app-shell.focus-mode .page { height: calc(100vh - 8px); max-height: calc(100vh - 8px); }
.app-shell.focus-mode .page img { width: auto; height: 100%; max-width: 100%; max-height: none; object-fit: contain; }
.app-shell.focus-mode .zoom-controls { bottom: 14px; }
.app-shell.focus-mode .page-arrow { background: rgba(13,15,16,.72); }

@media (max-width: 880px), (max-width: 1024px) and (pointer: coarse) {
  :root { --topbar-height: 52px; --bottombar-height: 64px; }
  .mobile-only { display: inline-grid !important; }
  .app-shell { grid-template-columns: 1fr; }
  .topbar { grid-area: 1 / 1; padding: 0 10px; gap: 7px; }
  .quick-tools { display: contents; }
  .app-shell.archive-open .quick-tools { opacity: 1; transform: none; }
  .brand-mark { width: 40px; height: 40px; }
  .brand-copy strong { max-width: 38vw; font-size: 13px; }
  .brand-copy span { display: none; }
  .top-actions .action-divider, #singleButton, #spreadButton, #shareButton, #printButton, #closeButton { display: none; }
  .archive-trigger { height: 36px; padding: 0 9px; gap: 5px; }
  .archive-trigger span { font-size: 11px; }
  .fullscreen-trigger { width: 36px; height: 36px; padding: 0; justify-content: center; }
  .fullscreen-trigger span { display: none; }
  .utility-trigger { width: 36px; height: 36px; padding: 0; justify-content: center; }
  .utility-trigger span { display: none; }
  .side-panel { position: fixed; top: var(--topbar-height); bottom: 0; left: 0; width: min(86vw, 320px); transform: translateX(-102%); transition: transform .25s ease; box-shadow: 20px 0 50px rgba(0,0,0,.36); }
  .app-shell.panel-collapsed { grid-template-columns: 1fr; }
  .app-shell.panel-collapsed .side-panel { visibility: visible; opacity: 1; }
  .app-shell.panel-collapsed .viewer { grid-row: 2; }
  .app-shell.panel-collapsed .book { height: 100%; }
  .app-shell.panel-collapsed .page { height: auto; max-height: 100%; }
  .app-shell.panel-collapsed .page img { width: auto; height: auto; max-width: 100%; max-height: calc(100vh - var(--topbar-height) - var(--bottombar-height) - 78px); }
  .side-panel.open { transform: translateX(0); }
  .panel-head { justify-content: space-between; }
  .page-bookmark{display:none}
  .mobile-panel-actions{display:flex}
  .help-trigger{margin-left:8px}
  .help-grid{grid-template-columns:1fr}.tour-card{padding:20px}
  .panel-scrim { position: fixed; inset: 0; z-index: 14; background: rgba(0,0,0,.58); opacity: 0; pointer-events: none; transition: .25s; }
  .panel-scrim.visible { display: block; opacity: 1; pointer-events: auto; }
  .viewer { grid-area: 2 / 1; }
  .bottombar { grid-area: 3 / 1; display: grid; grid-template-columns: 34px minmax(0,1fr) 34px; padding: 0 10px; gap: 5px; }
  .stage { inset: 15px 12px 58px; }
  .book.spread { display: block; }
  .book.spread .book-spine { display: none; }
  .page { max-width: 100%; }
  .page img { max-height: calc(100vh - var(--topbar-height) - var(--bottombar-height) - 78px); }
  .app-shell.focus-mode .stage { inset: 4px 4px 58px; }
  .app-shell.focus-mode .book { height: calc(100vh - 62px); }
  .app-shell.focus-mode .page { height: calc(100vh - 62px); max-height: calc(100vh - 62px); }
  .app-shell.focus-mode .page img { height: 100%; max-height: none; }
  .page-arrow { top: auto; bottom: 11px; width: 42px; height: 42px; translate: none; border-radius: 50%; }
  .page-arrow.previous { left: 16px; }
  .page-arrow.next { right: 16px; }
  .zoom-controls { right: 50%; bottom: 12px; translate: 50% 0; }
  .archive-drawer { top: 10px; right: 10px; width: min(380px, calc(100% - 20px)); max-height: calc(100% - 20px); }
  .page-scrubber { display: grid; grid-template-columns: minmax(70px,1fr) auto; width: 100%; min-width: 0; gap: 7px; }
  .page-readout { min-width: 62px; justify-content: flex-end; }
  .page-readout label { display: none; }
  #pageRange { width: 100%; min-width: 0; }
}

/* 모바일에서는 중복 페이지 버튼과 하단 도구가 지면 높이를 과도하게 차지하지 않게 압축한다. */
@media (max-width: 880px), (max-width: 1024px) and (pointer: coarse) {
  :root { --bottombar-height: 34px; }
  .stage { inset: 2px; }
  .page img,
  .app-shell.panel-collapsed .page img {
    max-height: calc(100dvh - var(--topbar-height) - var(--bottombar-height) - 4px);
  }
  .app-shell.focus-mode .stage { inset: 2px; }
  .app-shell.focus-mode .book { height: calc(100dvh - 4px); }
  .app-shell.focus-mode .page { height: auto; max-height: calc(100dvh - 4px); }
  .app-shell.focus-mode .page img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: calc(100dvh - 4px);
    object-fit: contain;
  }
  .viewer > .page-arrow { display: none; }
  .zoom-controls {
    right: 50%;
    bottom: 3px;
    gap: 0;
    padding: 2px;
    border-radius: 10px;
    translate: 50% 0;
  }
  .zoom-controls .icon-button { width: 27px; height: 27px; }
  .zoom-controls .icon-button svg { width: 13px; height: 13px; }
  #zoomValue { min-width: 36px; font-size: 9px; }
  .bottombar {
    grid-template-columns: 28px minmax(0,1fr) 28px;
    gap: 3px;
    padding: 0 6px;
  }
  .bottombar .icon-button.compact { width: 28px; height: 28px; }
  .bottombar .icon-button.compact svg { width: 16px; height: 16px; }
  .page-scrubber { grid-template-columns: minmax(55px,1fr) auto; gap: 5px; }
  .page-readout { min-width: 53px; font-size: 9px; }
  #pageInput { width: 29px; padding: 2px 1px; font-size: 10px; }
  #pageRange::-webkit-slider-thumb { width: 12px; height: 12px; border-width: 3px; }
}

@media print {
  .topbar, .side-panel, .bottombar, .page-arrow, .zoom-controls, .archive-drawer, .panel-scrim, .toast { display: none !important; }
  .app-shell { display: block; }
  .viewer { position: fixed; inset: 0; background: #fff; }
  .stage { inset: 0; }
  .page { box-shadow: none; }
  .page figcaption { display: none; }
}
.panel-footer{color:#b4bec3;font-size:11px;font-weight:600;letter-spacing:.1em}.help-trigger{color:#e7edef;font-size:13px;font-weight:800}.help-head small{color:#72d9cf;font-size:11px;font-weight:700}.help-grid b{font-size:14px}.tour-replay{color:#d4dadd;font-size:12px}
.tour-visual::before{content:attr(data-icon)}
.tour-visual.has-symbol{display:grid;place-items:center}.tour-visual.has-symbol::before{display:none}.tour-symbol-badge{display:grid;place-items:center;width:36px;height:36px;border:1px solid rgba(114,217,207,.35);border-radius:11px;color:var(--accent);background:rgba(14,36,39,.72);box-shadow:0 7px 18px rgba(0,0,0,.22)}.tour-symbol-badge svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}.tour-visual.bookmark .tour-symbol-badge svg{fill:rgba(114,217,207,.2)}.tour-visual.detail{width:150px}.tour-detail-icons{display:flex;align-items:center;justify-content:center;gap:24px}.tour-detail-icons i{display:grid;place-items:center;width:34px;height:34px;font-style:normal}.tour-detail-icons svg{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}.tour-detail-neutral{box-sizing:border-box;border:1px solid #45545e;border-radius:8px;color:#26343e;background:#fff;box-shadow:0 4px 12px rgba(0,0,0,.22)}.tour-detail-orange{color:#e66c1a;filter:drop-shadow(0 0 1px #fff)}
.page.promo-page .page-bookmark,.page.promo-page figcaption{display:none}
.promo-agency-link .promo-click-cue{right:-14%;top:70%}

/* SRB brand-blue skin */
.thumbnail.active{box-shadow:0 0 0 2px rgba(61,183,233,.16)}
.viewer-glow{background:rgba(61,183,233,.055)}
.page-arrow:hover{border-color:rgba(61,183,233,.38)}
.page-link:hover{background:rgba(61,183,233,.12)}
.search-result-page{background:rgba(61,183,233,.11)}
.search-tooltip{border-color:rgba(61,183,233,.3)}
.bookmark-page{background:rgba(61,183,233,.12)}

/* V6 quality refinements: restrained branding, clearer hierarchy and navigation. */
.brand-block{gap:12px;padding:0 10px 0 0;border:0;background:transparent;box-shadow:none}
.brand-mark{filter:drop-shadow(0 3px 7px rgba(0,73,110,.28))}
.brand-copy strong{text-shadow:none}
.brand-copy span{color:#929da4}

.top-actions{gap:3px}
.top-actions .action-divider{margin:0 5px;opacity:.56}
.top-actions .icon-button svg,.top-actions .fullscreen-trigger svg{width:18px;height:18px}
#singleButton,#spreadButton,#shareButton,#closeButton{color:#858f95}
#singleButton:hover,#spreadButton:hover,#shareButton:hover,#closeButton:hover{color:#e8eef1}
#bookmarkButton,#printButton{color:#bbc5ca}
#spreadButton.active,#singleButton.active{color:var(--accent);background:rgba(61,183,233,.11)}
.archive-trigger{height:33px;margin-right:4px;background:rgba(61,183,233,.08);border-color:rgba(61,183,233,.28)}

.toc-item{position:relative;grid-template-columns:34px minmax(0,1fr);gap:7px;min-height:46px;padding:7px 10px 7px 13px;border-radius:8px}
.toc-item.active{background:rgba(61,183,233,.1);box-shadow:inset 3px 0 0 var(--accent)}
.toc-item.active .toc-number{color:#78d3f6}
.toc-item.active .toc-title{font-weight:750}

.promo-agency-link{left:69.3%;top:1.45%;width:27.4%;height:4.05%;border-color:transparent;background:transparent;box-shadow:none}
.promo-agency-link:hover,.promo-agency-link:focus-visible{border-color:rgba(61,183,233,.65);background:rgba(61,183,233,.055);box-shadow:0 0 0 2px rgba(61,183,233,.1)}
.promo-agency-link .promo-click-cue{right:-8%;top:68%;width:19px;height:19px;color:#dff6ff;border-color:rgba(151,221,248,.68);background:rgba(15,73,98,.78);box-shadow:0 3px 10px rgba(0,0,0,.22);animation:v6-link-cue .9s ease-in-out 2}
.promo-agency-link .promo-click-cue svg{width:13px;height:13px;fill:currentColor;stroke:#0f4962;stroke-width:.4;stroke-linecap:round;stroke-linejoin:round}
.promo-agency-link .promo-click-cue i{inset:-3px;border-width:1px;animation:v6-link-ripple .9s ease-out 2}
@keyframes v6-link-cue{0%,100%{translate:0 0;opacity:1}50%{translate:-2px -2px;opacity:.68}}
@keyframes v6-link-ripple{0%{scale:.75;opacity:.7}100%{scale:1.35;opacity:0}}

/* V6 compact brand lockup: keeps the 54px top bar unchanged. */
.brand-block{gap:8px;padding-right:10px}
.brand-mark{width:44px;height:44px;border-radius:10px;filter:drop-shadow(0 3px 6px rgba(0,65,98,.22))}
.brand-copy{position:relative;gap:3px;padding-left:10px}
.brand-copy::before{content:"";position:absolute;top:50%;left:0;width:1px;height:26px;translate:0 -50%;background:linear-gradient(to bottom,transparent,rgba(61,183,233,.3) 25%,rgba(255,255,255,.13) 75%,transparent)}
.brand-copy strong{font-size:15px;font-weight:750;line-height:1.05;letter-spacing:-.02em}
.brand-copy span{font-size:11px;font-weight:600;line-height:1;letter-spacing:.015em}
.brand-copy span{align-self:stretch;text-align:center}
.top-actions .icon-button,.top-actions .fullscreen-trigger{width:34px;height:34px;border-radius:10px}
@media (max-width:880px){.brand-block{gap:7px;padding-right:5px}.brand-mark{width:40px;height:40px}.brand-copy{padding-left:8px}.brand-copy::before{height:23px}.brand-copy strong{font-size:14px}.brand-copy span{font-size:10.5px}}
.archive-current{background:linear-gradient(100deg,rgba(61,183,233,.15),rgba(61,183,233,.03))}
.help-head small{color:#62c8f0}

/* V6 production polish */
.topbar{background:rgba(22,26,29,.97);border-bottom-color:rgba(255,255,255,.115);box-shadow:0 2px 14px rgba(0,0,0,.14)}
.brand-copy::before{background:linear-gradient(to bottom,transparent,rgba(61,183,233,.46) 25%,rgba(255,255,255,.18) 75%,transparent)}
.brand-copy span{color:#89959c}

.page-bookmark{top:3px;width:31px;height:31px;border-color:rgba(255,255,255,.14);border-radius:9px;color:#c7cfd3;background:rgba(25,30,33,.58);box-shadow:0 3px 12px rgba(0,0,0,.18);opacity:.48}
.page-bookmark:hover{color:#fff;border-color:rgba(61,183,233,.5);background:rgba(25,47,57,.82);opacity:1;scale:1.04}
.page-bookmark.active{color:#092c3b;border-color:var(--accent);background:var(--accent);opacity:1}
.left-page .page-bookmark{left:-5px}.right-page .page-bookmark{right:-5px}

.toc-item{transition:color .16s,background .16s,box-shadow .16s}
.toc-item.active{background:rgba(61,183,233,.085);box-shadow:inset 3px 0 0 var(--accent)}
.panel-content{scrollbar-color:#343b3f transparent}
.panel-content::-webkit-scrollbar{width:6px}.panel-content::-webkit-scrollbar-thumb{border-radius:6px;background:#343b3f}.panel-content::-webkit-scrollbar-thumb:hover{background:#4b565c}

.book{transition:transform .18s ease}
.page-loader{z-index:2}
.page.is-loading .page-loader{display:grid;background:rgba(222,220,214,.2);pointer-events:none}
.page.is-loading .page-loader span{box-shadow:0 0 0 4px rgba(255,255,255,.3)}
.page.is-loading img.loaded{opacity:.78;filter:brightness(.94)}
.page img{transition:opacity .18s ease,filter .18s ease}
.page.load-failed{background:#e4e2dc}

.top-actions button{touch-action:manipulation}
.top-actions .icon-button,.top-actions .fullscreen-trigger,.archive-trigger{transition:color .16s,background .16s,border-color .16s,transform .12s,opacity .16s}
#singleButton,#spreadButton{opacity:.86}
#shareButton,#bookmarkButton,#printButton,#fullscreenButton,#closeButton{color:#aeb9be;opacity:.94}
#shareButton:hover,#bookmarkButton:hover,#printButton:hover,#fullscreenButton:hover,#closeButton:hover{color:#f4f8fa;background:rgba(255,255,255,.085);opacity:1}
#bookmarkButton.active{color:#071e28;opacity:1}

.promo-agency-link .promo-click-cue{right:-8%;top:68%}

@media (max-width:880px), (max-width:1024px) and (pointer:coarse){
  .top-actions .icon-button,.top-actions .fullscreen-trigger{width:40px;height:40px}
  #mobileSearchButton,#fullscreenButton{display:inline-grid}
  #bookmarkButton{display:none!important}
  .archive-trigger{min-width:40px;height:40px;padding:0 9px}
  .panel-tab{min-height:44px}
  .toc-item{min-height:46px}
  .promo-agency-link .promo-click-cue{width:18px;height:18px;right:-5%}
}

@media (max-width:480px){
  .topbar{gap:5px;padding-inline:8px}
  .brand-block{gap:5px;padding-right:2px}
  .brand-mark{width:38px;height:38px}
  .brand-copy{padding-left:7px}
  .brand-copy strong{max-width:112px;font-size:13px}
  .top-actions{gap:2px}
  .archive-trigger{width:40px;min-width:40px;padding:0;justify-content:center}
  .archive-trigger span{display:none}
  .top-actions .icon-button,.top-actions .fullscreen-trigger{width:38px;height:38px}
  .bottombar{padding-inline:7px;gap:3px}
  .page-scrubber{gap:5px}
}

@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{scroll-behavior:auto!important;animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}
}
