@import "https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap";:root{--bg-primary:#0a0f1a;--bg-secondary:#111827;--bg-card:#1e293b;--bg-glass:#1e293b99;--bg-glass-hover:#1e293bcc;--bg-input:#0f172a;--text-primary:#f1f5f9;--text-secondary:#94a3b8;--text-muted:#64748b;--text-accent:#38bdf8;--accent-blue:#3b82f6;--accent-violet:#8b5cf6;--accent-cyan:#06b6d4;--accent-emerald:#10b981;--accent-rose:#f43f5e;--gradient-primary:linear-gradient(135deg, #3b82f6, #8b5cf6);--gradient-accent:linear-gradient(135deg, #06b6d4, #3b82f6);--gradient-warm:linear-gradient(135deg, #f43f5e, #8b5cf6);--border-subtle:#94a3b81a;--border-medium:#94a3b833;--shadow-sm:0 1px 2px #0000004d;--shadow-md:0 4px 12px #0006;--shadow-lg:0 8px 32px #00000080;--shadow-glow:0 0 20px #3b82f626;--radius-sm:8px;--radius-md:12px;--radius-lg:16px;--radius-xl:24px;--radius-full:9999px;--transition-fast:.15s cubic-bezier(.4, 0, .2, 1);--transition-base:.25s cubic-bezier(.4, 0, .2, 1);--transition-slow:.4s cubic-bezier(.4, 0, .2, 1);color:var(--text-primary);background-color:var(--bg-primary);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:Inter,-apple-system,BlinkMacSystemFont,sans-serif;font-size:15px;line-height:1.6}*,:before,:after{box-sizing:border-box;margin:0;padding:0}html,body,#root{width:100%;height:100%;overflow:hidden}::-webkit-scrollbar{width:6px}::-webkit-scrollbar-track{background:0 0}::-webkit-scrollbar-thumb{background:var(--text-muted);border-radius:var(--radius-full)}::-webkit-scrollbar-thumb:hover{background:var(--text-secondary)}.app{background:var(--bg-primary);flex-direction:column;width:100%;height:100%;display:flex}.app-header{background:var(--bg-secondary);border-bottom:1px solid var(--border-subtle);z-index:10;flex-shrink:0;justify-content:space-between;align-items:center;padding:12px 24px;display:flex}.app-header .logo{align-items:center;gap:10px;font-size:1.2rem;font-weight:700;display:flex}.app-header .logo-icon{background:var(--gradient-primary);border-radius:var(--radius-sm);justify-content:center;align-items:center;width:32px;height:32px;font-size:1rem;display:flex}.app-header .book-info{color:var(--text-secondary);align-items:center;gap:12px;font-size:.875rem;display:flex}.reader-layout{flex:1;display:flex;overflow:hidden}.upload-screen{flex:1;justify-content:center;align-items:center;padding:40px;display:flex}.upload-zone{border-radius:var(--radius-xl);background:var(--bg-secondary);border:2px dashed var(--border-medium);cursor:pointer;width:100%;max-width:560px;transition:all var(--transition-base);text-align:center;flex-direction:column;justify-content:center;align-items:center;padding:60px 40px;display:flex;position:relative}.upload-zone:hover,.upload-zone.drag-over{border-color:var(--accent-blue);background:var(--bg-glass);box-shadow:var(--shadow-glow);transform:translateY(-2px)}.upload-zone .upload-icon{border-radius:var(--radius-lg);background:var(--gradient-primary);width:72px;height:72px;transition:transform var(--transition-base);justify-content:center;align-items:center;margin-bottom:24px;display:flex;box-shadow:0 4px 20px #3b82f64d}.upload-zone:hover .upload-icon{transform:scale(1.05)}.upload-zone h2{margin-bottom:8px;font-size:1.4rem;font-weight:600}.upload-zone p{color:var(--text-secondary);margin-bottom:4px;font-size:.9rem}.upload-zone .file-types{color:var(--text-muted);font-size:.8rem}.upload-zone input[type=file]{display:none}.upload-progress{text-align:center;width:100%;max-width:560px}.progress-bar-container{background:var(--bg-card);border-radius:var(--radius-full);width:100%;height:6px;margin:20px 0 12px;overflow:hidden}.progress-bar-fill{background:var(--gradient-primary);border-radius:var(--radius-full);height:100%;transition:width var(--transition-base)}.upload-status{color:var(--text-secondary);font-size:.9rem}.upload-status .spinner{border:2px solid var(--text-muted);border-top-color:var(--accent-blue);vertical-align:middle;border-radius:50%;width:16px;height:16px;margin-right:8px;animation:.8s linear infinite spin;display:inline-block}@keyframes spin{to{transform:rotate(360deg)}}.pdf-panel{background:var(--bg-primary);border-right:1px solid var(--border-subtle);flex-direction:column;flex:1;min-width:0;display:flex}.pdf-controls{background:var(--bg-secondary);border-bottom:1px solid var(--border-subtle);flex-shrink:0;justify-content:center;align-items:center;gap:16px;padding:12px 20px;display:flex}.pdf-controls button{border-radius:var(--radius-sm);background:var(--bg-card);width:36px;height:36px;color:var(--text-primary);cursor:pointer;transition:all var(--transition-fast);border:none;justify-content:center;align-items:center;display:flex}.pdf-controls button:hover:not(:disabled){background:var(--accent-blue);color:#fff}.pdf-controls button:disabled{opacity:.3;cursor:not-allowed}.pdf-controls .page-info{color:var(--text-secondary);align-items:center;gap:8px;font-size:.875rem;display:flex}.pdf-controls .page-input{text-align:center;background:var(--bg-input);border:1px solid var(--border-medium);border-radius:var(--radius-sm);width:48px;height:32px;color:var(--text-primary);transition:border-color var(--transition-fast);outline:none;font-family:inherit;font-size:.875rem}.pdf-controls .page-input:focus{border-color:var(--accent-blue)}.pdf-container{flex:1;justify-content:center;align-items:flex-start;padding:24px;display:flex;overflow:auto}.pdf-container .react-pdf__Page{box-shadow:var(--shadow-lg);border-radius:var(--radius-sm);overflow:hidden}.pdf-container .react-pdf__Page canvas{max-width:100%!important;height:auto!important}.chat-panel{background:var(--bg-secondary);-webkit-backdrop-filter:blur(16px);backdrop-filter:blur(16px);flex-direction:column;width:420px;min-width:380px;display:flex}.chat-header{border-bottom:1px solid var(--border-subtle);flex-shrink:0;padding:16px 20px}.chat-header h3{margin-bottom:8px;font-size:1rem;font-weight:600}.gate-indicator{border-radius:var(--radius-full);color:var(--text-accent);background:#3b82f61a;border:1px solid #3b82f633;align-items:center;gap:6px;padding:4px 12px;font-size:.8rem;font-weight:500;display:inline-flex}.chat-messages{flex-direction:column;flex:1;gap:12px;padding:16px;display:flex;overflow-y:auto}.chat-empty{text-align:center;color:var(--text-muted);flex-direction:column;flex:1;justify-content:center;align-items:center;gap:12px;padding:32px;display:flex}.chat-empty .empty-icon{margin-bottom:4px;font-size:2.5rem}.chat-empty h4{color:var(--text-secondary);font-weight:500}.chat-empty p{font-size:.85rem;line-height:1.5}.message{max-width:90%;animation:messageIn var(--transition-base) ease-out;flex-direction:column;gap:4px;display:flex}@keyframes messageIn{0%{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}.message.user{align-self:flex-end}.message.ai{align-self:flex-start}.message-bubble{border-radius:var(--radius-md);word-wrap:break-word;padding:10px 14px;font-size:.9rem;line-height:1.6}.message.user .message-bubble{background:var(--gradient-primary);color:#fff;border-bottom-right-radius:4px}.message.ai .message-bubble{background:var(--bg-glass);-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);border:1px solid var(--border-subtle);color:var(--text-primary);border-bottom-left-radius:4px}.message.ai .message-bubble p{margin-bottom:8px}.message.ai .message-bubble p:last-child{margin-bottom:0}.message.ai .message-bubble strong{color:var(--text-accent)}.message.ai .message-bubble code{background:var(--bg-input);border-radius:4px;padding:2px 6px;font-size:.85em}.message-sources{flex-wrap:wrap;gap:4px;margin-top:4px;display:flex}.source-badge{border-radius:var(--radius-full);color:var(--text-accent);background:#3b82f61a;border:1px solid #3b82f626;align-items:center;gap:3px;padding:2px 8px;font-size:.7rem;font-weight:500;display:inline-flex}.typing-indicator{background:var(--bg-glass);border:1px solid var(--border-subtle);border-radius:var(--radius-md);border-bottom-left-radius:4px;align-self:flex-start;align-items:center;gap:4px;padding:12px 16px;display:flex}.typing-dot{background:var(--text-muted);border-radius:50%;width:7px;height:7px;animation:1.4s ease-in-out infinite typingBounce}.typing-dot:first-child{animation-delay:0s}.typing-dot:nth-child(2){animation-delay:.2s}.typing-dot:nth-child(3){animation-delay:.4s}@keyframes typingBounce{0%,80%,to{opacity:.4;transform:scale(.6)}40%{opacity:1;transform:scale(1)}}.chat-input-area{border-top:1px solid var(--border-subtle);flex-shrink:0;padding:16px}.chat-input-wrapper{background:var(--bg-input);border:1px solid var(--border-medium);border-radius:var(--radius-md);transition:border-color var(--transition-fast);align-items:center;gap:8px;padding:4px 4px 4px 14px;display:flex}.chat-input-wrapper:focus-within{border-color:var(--accent-blue);box-shadow:0 0 0 3px #3b82f61a}.chat-input{color:var(--text-primary);background:0 0;border:none;outline:none;flex:1;padding:8px 0;font-family:inherit;font-size:.9rem}.chat-input::placeholder{color:var(--text-muted)}.chat-send-btn{border-radius:var(--radius-sm);background:var(--gradient-primary);color:#fff;cursor:pointer;width:36px;height:36px;transition:all var(--transition-fast);border:none;flex-shrink:0;justify-content:center;align-items:center;display:flex}.chat-send-btn:hover:not(:disabled){transform:scale(1.05);box-shadow:0 2px 12px #3b82f666}.chat-send-btn:disabled{opacity:.4;cursor:not-allowed;transform:none}.error-banner{border-radius:var(--radius-md);color:var(--accent-rose);background:#f43f5e1a;border:1px solid #f43f5e33;align-items:center;gap:8px;margin:12px;padding:12px 20px;font-size:.85rem;display:flex}@media (width<=900px){.reader-layout{flex-direction:column}.chat-panel{width:100%;min-width:unset;border-top:1px solid var(--border-subtle);height:50%}.pdf-panel{border-right:none}}:root{--react-pdf-annotation-layer:1;--annotation-unfocused-field-background:url("data:image/svg+xml;charset=UTF-8,<svg width='1px' height='1px' xmlns='http://www.w3.org/2000/svg'><rect width='100%' height='100%' style='fill:rgba(0, 54, 255, 0.13);'/></svg>");--input-focus-border-color:Highlight;--input-focus-outline:1px solid Canvas;--input-unfocused-border-color:transparent;--input-disabled-border-color:transparent;--input-hover-border-color:black;--link-outline:none}@media screen and (forced-colors:active){:root{--input-focus-border-color:CanvasText;--input-unfocused-border-color:ActiveText;--input-disabled-border-color:GrayText;--input-hover-border-color:Highlight;--link-outline:1.5px solid LinkText}.annotationLayer .textWidgetAnnotation :is(input,textarea):required,.annotationLayer .choiceWidgetAnnotation select:required,.annotationLayer .buttonWidgetAnnotation:is(.checkBox,.radioButton) input:required{outline:1.5px solid selecteditem}.annotationLayer .linkAnnotation:hover{-webkit-backdrop-filter:invert();backdrop-filter:invert()}}.annotationLayer{pointer-events:none;transform-origin:0 0;z-index:3;position:absolute;top:0;left:0}.annotationLayer[data-main-rotation="90"] .norotate{transform:rotate(270deg)translate(-100%)}.annotationLayer[data-main-rotation="180"] .norotate{transform:rotate(180deg)translate(-100%,-100%)}.annotationLayer[data-main-rotation="270"] .norotate{transform:rotate(90deg)translateY(-100%)}.annotationLayer canvas{width:100%;height:100%;position:absolute}.annotationLayer section{text-align:initial;pointer-events:auto;box-sizing:border-box;transform-origin:0 0;margin:0;position:absolute}.annotationLayer .linkAnnotation{outline:var(--link-outline)}.textLayer.selecting~.annotationLayer section{pointer-events:none}.annotationLayer :is(.linkAnnotation,.buttonWidgetAnnotation.pushButton)>a{width:100%;height:100%;font-size:1em;position:absolute;top:0;left:0}.annotationLayer :is(.linkAnnotation,.buttonWidgetAnnotation.pushButton)>a:hover{opacity:.2;background:#ff0;box-shadow:0 2px 10px #ff0}.annotationLayer .textAnnotation img{cursor:pointer;width:100%;height:100%;position:absolute;top:0;left:0}.annotationLayer .textWidgetAnnotation :is(input,textarea),.annotationLayer .choiceWidgetAnnotation select,.annotationLayer .buttonWidgetAnnotation:is(.checkBox,.radioButton) input{background-image:var(--annotation-unfocused-field-background);border:2px solid var(--input-unfocused-border-color);box-sizing:border-box;font:calc(9px * var(--total-scale-factor)) sans-serif;vertical-align:top;width:100%;height:100%;margin:0}.annotationLayer .textWidgetAnnotation :is(input,textarea):required,.annotationLayer .choiceWidgetAnnotation select:required,.annotationLayer .buttonWidgetAnnotation:is(.checkBox,.radioButton) input:required{outline:1.5px solid red}.annotationLayer .choiceWidgetAnnotation select option{padding:0}.annotationLayer .buttonWidgetAnnotation.radioButton input{border-radius:50%}.annotationLayer .textWidgetAnnotation textarea{resize:none}.annotationLayer .textWidgetAnnotation :is(input,textarea)[disabled],.annotationLayer .choiceWidgetAnnotation select[disabled],.annotationLayer .buttonWidgetAnnotation:is(.checkBox,.radioButton) input[disabled]{border:2px solid var(--input-disabled-border-color);cursor:not-allowed;background:0 0}.annotationLayer .textWidgetAnnotation :is(input,textarea):hover,.annotationLayer .choiceWidgetAnnotation select:hover,.annotationLayer .buttonWidgetAnnotation:is(.checkBox,.radioButton) input:hover{border:2px solid var(--input-hover-border-color)}.annotationLayer .textWidgetAnnotation :is(input,textarea):hover,.annotationLayer .choiceWidgetAnnotation select:hover,.annotationLayer .buttonWidgetAnnotation.checkBox input:hover{border-radius:2px}.annotationLayer .textWidgetAnnotation :is(input,textarea):focus,.annotationLayer .choiceWidgetAnnotation select:focus{border:2px solid var(--input-focus-border-color);outline:var(--input-focus-outline);background:0 0;border-radius:2px}.annotationLayer .buttonWidgetAnnotation:is(.checkBox,.radioButton) :focus{background-color:#0000;background-image:none}.annotationLayer .buttonWidgetAnnotation.checkBox :focus{border:2px solid var(--input-focus-border-color);outline:var(--input-focus-outline);border-radius:2px}.annotationLayer .buttonWidgetAnnotation.radioButton :focus{border:2px solid var(--input-focus-border-color);outline:var(--input-focus-outline)}.annotationLayer .buttonWidgetAnnotation.checkBox input:checked:before,.annotationLayer .buttonWidgetAnnotation.checkBox input:checked:after,.annotationLayer .buttonWidgetAnnotation.radioButton input:checked:before{content:"";background-color:canvastext;display:block;position:absolute}.annotationLayer .buttonWidgetAnnotation.checkBox input:checked:before,.annotationLayer .buttonWidgetAnnotation.checkBox input:checked:after{width:1px;height:80%;left:45%}.annotationLayer .buttonWidgetAnnotation.checkBox input:checked:before{transform:rotate(45deg)}.annotationLayer .buttonWidgetAnnotation.checkBox input:checked:after{transform:rotate(-45deg)}.annotationLayer .buttonWidgetAnnotation.radioButton input:checked:before{border-radius:50%;width:50%;height:50%;top:20%;left:30%}.annotationLayer .textWidgetAnnotation input.comb{padding-left:2px;padding-right:0;font-family:monospace}.annotationLayer .textWidgetAnnotation input.comb:focus{width:103%}.annotationLayer .buttonWidgetAnnotation:is(.checkBox,.radioButton) input{appearance:none}.annotationLayer .popupTriggerArea{width:100%;height:100%}.annotationLayer .fileAttachmentAnnotation .popupTriggerArea{position:absolute}.annotationLayer .popupWrapper{font-size:calc(9px * var(--total-scale-factor));width:100%;min-width:calc(180px * var(--total-scale-factor));pointer-events:none;position:absolute}.annotationLayer .popup{max-width:calc(180px * var(--total-scale-factor));box-shadow:0 calc(2px * var(--total-scale-factor)) calc(5px * var(--total-scale-factor)) #888;border-radius:calc(2px * var(--total-scale-factor));padding:calc(6px * var(--total-scale-factor));margin-left:calc(5px * var(--total-scale-factor));cursor:pointer;font:message-box;white-space:normal;word-wrap:break-word;pointer-events:auto;background-color:#ff9;position:absolute}.annotationLayer .popup>*{font-size:calc(9px * var(--total-scale-factor))}.annotationLayer .popup h1{display:inline-block}.annotationLayer .popupDate{margin-left:calc(5px * var(--total-scale-factor));display:inline-block}.annotationLayer .popupContent{margin-top:calc(2px * var(--total-scale-factor));padding-top:calc(2px * var(--total-scale-factor));border-top:1px solid #333}.annotationLayer .richText>*{white-space:pre-wrap;font-size:calc(9px * var(--total-scale-factor))}.annotationLayer .highlightAnnotation,.annotationLayer .underlineAnnotation,.annotationLayer .squigglyAnnotation,.annotationLayer .strikeoutAnnotation,.annotationLayer .freeTextAnnotation,.annotationLayer .lineAnnotation svg line,.annotationLayer .squareAnnotation svg rect,.annotationLayer .circleAnnotation svg ellipse,.annotationLayer .polylineAnnotation svg polyline,.annotationLayer .polygonAnnotation svg polygon,.annotationLayer .caretAnnotation,.annotationLayer .inkAnnotation svg polyline,.annotationLayer .stampAnnotation,.annotationLayer .fileAttachmentAnnotation{cursor:pointer}.annotationLayer section svg{width:100%;height:100%;position:absolute;top:0;left:0}.annotationLayer .annotationTextContent{opacity:0;color:#0000;-webkit-user-select:none;user-select:none;pointer-events:none;width:100%;height:100%;position:absolute}.annotationLayer .annotationTextContent span{width:100%;display:inline-block}:root{--react-pdf-text-layer:1;--highlight-bg-color:#b400aa;--highlight-selected-bg-color:#006400}@media screen and (forced-colors:active){:root{--highlight-bg-color:Highlight;--highlight-selected-bg-color:ButtonText}}[data-main-rotation="90"]{transform:rotate(90deg)translateY(-100%)}[data-main-rotation="180"]{transform:rotate(180deg)translate(-100%,-100%)}[data-main-rotation="270"]{transform:rotate(270deg)translate(-100%)}.textLayer{text-align:initial;-webkit-text-size-adjust:none;-moz-text-size-adjust:none;text-size-adjust:none;forced-color-adjust:none;transform-origin:0 0;z-index:2;line-height:1;position:absolute;inset:0;overflow:hidden}.textLayer :is(span,br){color:#0000;white-space:pre;cursor:text;transform-origin:0 0;margin:0;position:absolute}.textLayer span.markedContent{height:0;top:0}.textLayer .highlight{background-color:var(--highlight-bg-color);border-radius:4px;margin:-1px;padding:1px}.textLayer .highlight.appended{position:initial}.textLayer .highlight.begin{border-radius:4px 0 0 4px}.textLayer .highlight.end{border-radius:0 4px 4px 0}.textLayer .highlight.middle{border-radius:0}.textLayer .highlight.selected{background-color:var(--highlight-selected-bg-color)}.textLayer br::selection{background:0 0}.textLayer .endOfContent{z-index:-1;cursor:default;-webkit-user-select:none;user-select:none;display:block;position:absolute;inset:100% 0 0}.textLayer.selecting .endOfContent{top:0}.hiddenCanvasElement{width:0;height:0;display:none;position:absolute;top:0;left:0}
