:root{font-family:system-ui,Avenir,Helvetica,Arial,sans-serif;line-height:1.5;font-weight:400;color-scheme:light dark;color:#ffffffde;background-color:#242424;font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}a{font-weight:500;color:#646cff;text-decoration:inherit}a:hover{color:#535bf2}body{margin:0;min-width:320px;min-height:100vh}h1{font-size:3.2em;line-height:1.1}button{border-radius:8px;border:1px solid transparent;padding:.6em 1.2em;font-size:1em;font-weight:500;font-family:inherit;background-color:#1a1a1a;cursor:pointer;transition:border-color .25s}button:hover{border-color:#646cff}button:focus,button:focus-visible{outline:4px auto -webkit-focus-ring-color}@media(prefers-color-scheme:light){:root{color:#213547;background-color:#fff}a:hover{color:#747bff}button{background-color:#f9f9f9}}.history-item{background:#fff;border:2px solid #e0e0e0;border-radius:8px;padding:14px;cursor:pointer;transition:all .2s ease;display:flex;flex-direction:column;gap:10px;min-height:140px}.history-item:hover{border-color:#2196f3;box-shadow:0 4px 12px #2196f333;transform:translateY(-2px)}.history-item-header{display:flex;flex-wrap:wrap;gap:8px;align-items:center}.video-id-badge{background:#667eea;color:#fff;padding:4px 12px;border-radius:12px;font-size:.85rem;font-weight:600;font-family:monospace}.transcript-badge{background:#4caf50;color:#fff;padding:4px 10px;border-radius:12px;font-size:.8rem}.chat-badge{background:#ff9800;color:#fff;padding:4px 10px;border-radius:12px;font-size:.8rem}.history-item-content{flex:1;display:flex;flex-direction:column;gap:12px}.history-item-stats{display:flex;gap:16px;flex-wrap:wrap}.stat{display:flex;align-items:center;gap:6px}.stat-label{font-size:.85rem;color:#666;font-weight:500}.stat-value{font-size:.9rem;color:#333;font-weight:600}.history-item-dates{display:flex;flex-direction:column;gap:6px}.date-info{display:flex;align-items:center;gap:8px;font-size:.85rem}.date-label{color:#666;font-weight:500}.date-value{color:#333}.history-item-footer{padding-top:8px;border-top:1px solid #e0e0e0}.click-hint{font-size:.8rem;color:#999;font-style:italic}.history-view{width:100%;height:100%;min-height:400px;max-height:calc(100vh - 400px);padding:20px;background:#fff;border-radius:8px;box-shadow:0 2px 8px #0000001a;display:flex;flex-direction:column;overflow:hidden}.history-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:15px;padding-bottom:15px;border-bottom:2px solid #e0e0e0;flex-shrink:0}.history-header h2{margin:0;color:#333;font-size:1.5rem;font-weight:600}.refresh-btn,.retry-btn{padding:8px 16px;background:#2196f3;color:#fff;border:none;border-radius:4px;cursor:pointer;font-size:.9rem;transition:background .2s}.refresh-btn:hover,.retry-btn:hover{background:#1976d2}.history-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:16px;flex:1;overflow-y:auto;padding:10px;margin-top:10px}.history-grid::-webkit-scrollbar{width:8px}.history-grid::-webkit-scrollbar-track{background:#f1f1f1;border-radius:4px}.history-grid::-webkit-scrollbar-thumb{background:#888;border-radius:4px}.history-grid::-webkit-scrollbar-thumb:hover{background:#555}.empty-history{text-align:center;padding:60px 20px;color:#666}.empty-history p{margin:10px 0;font-size:1.1rem}.empty-history .hint{font-size:.9rem;color:#999}.loading,.error-message{text-align:center;padding:40px;font-size:1.1rem}.error-message{color:#d32f2f;background:#ffebee;border-radius:4px;margin-bottom:15px}@media(max-width:768px){.history-grid{grid-template-columns:1fr}}.youtube-input-container{width:100%;display:flex;flex-direction:column;gap:20px}.input-section{width:100%;padding:1.5rem;background:#fff;border-radius:12px;box-shadow:0 2px 8px #0000001a}.input-section h2{margin:0 0 1.5rem;color:#333;font-size:1.5rem}.history-section{width:100%;flex:1;min-height:400px}.youtube-form{width:100%}.input-group{display:flex;gap:1rem;margin-bottom:1rem}.url-input{flex:1;padding:.75rem 1rem;border:2px solid #e0e0e0;border-radius:8px;font-size:1rem;transition:border-color .3s}.url-input:focus{outline:none;border-color:#646cff}.url-input:disabled{background-color:#f5f5f5;cursor:not-allowed}.submit-btn{padding:.75rem 2rem;background-color:#646cff;color:#fff;border:none;border-radius:8px;font-size:1rem;font-weight:500;cursor:pointer;transition:background-color .3s}.submit-btn:hover:not(:disabled){background-color:#535bf2}.submit-btn:disabled{background-color:#ccc;cursor:not-allowed}.error-message{padding:.75rem;background-color:#fee;color:#c33;border-radius:6px;border-left:4px solid #c33}.success-message{padding:.75rem;background-color:#efe;color:#3c3;border-radius:6px;border-left:4px solid #3c3}.guide-section{width:100%;padding:1.25rem 1.5rem;background:#fff;border-radius:12px;box-shadow:0 2px 8px #0000001a}.guide-title{margin:0 0 1rem;color:#333;font-size:1.1rem;font-weight:600;display:flex;align-items:center;gap:.5rem}.guide-content{display:flex;flex-direction:column;gap:.75rem}.guide-step{display:flex;gap:.75rem;align-items:center}.step-number{flex-shrink:0;width:24px;height:24px;background:linear-gradient(135deg,#646cff,#535bf2);color:#fff;border-radius:50%;display:flex;align-items:center;justify-content:center;font-weight:600;font-size:.85rem}.step-text{flex:1;color:#555;font-size:.9rem;line-height:1.5}.step-text strong{color:#333;font-weight:600}.chat-interface{display:flex;flex-direction:column;height:100%;min-height:600px;max-height:calc(100vh - 200px);background:#fff;border-radius:12px;box-shadow:0 2px 8px #0000001a;overflow:hidden}.chat-interface-placeholder{padding:2rem;text-align:center;background:#fff;border-radius:12px;box-shadow:0 2px 8px #0000001a;color:#666}.chat-header{padding:1rem 1.5rem;background:linear-gradient(135deg,#646cff,#535bf2);color:#fff;display:flex;justify-content:space-between;align-items:center}.chat-header h3{margin:0;font-size:1.25rem}.video-id{font-size:.875rem;opacity:.9}.chat-messages{flex:1;overflow-y:auto;padding:1.25rem 1.5rem;display:flex;flex-direction:column;gap:1rem}.message{padding:1rem 1.25rem;border-radius:12px;max-width:85%;word-wrap:break-word;box-shadow:0 2px 4px #00000014;position:relative;pointer-events:auto}.message.user{align-self:flex-end;background:linear-gradient(135deg,#646cff,#535bf2);color:#fff;border-bottom-right-radius:4px}.message.assistant{align-self:flex-start;background-color:#fff;color:#333;border:1px solid #e0e0e0;border-bottom-left-radius:4px}.message.system{align-self:center;background-color:#e3f2fd;color:#1976d2;text-align:center;max-width:100%;border:1px solid #bbdefb}.message.error{align-self:center;background-color:#ffebee;color:#c62828;max-width:100%;border:1px solid #ffcdd2}.message.loading{align-self:flex-start;background-color:#f5f5f5;border:1px solid #e0e0e0}.message-header{display:flex;align-items:center;gap:.5rem;margin-bottom:.5rem;font-size:.875rem;font-weight:600;opacity:.9}.message-avatar{font-size:1.2rem;line-height:1}.message-label{text-transform:uppercase;font-size:.75rem;letter-spacing:.5px}.message-content{line-height:1.7;white-space:pre-wrap;word-break:break-word;font-size:.95rem;pointer-events:auto}.message.assistant .message-content{color:#2c3e50}.message.user .message-content{color:#fff}.message-sources{margin-top:.5rem;padding-top:.5rem;border-top:1px solid rgba(0,0,0,.1)}.message-sources small{color:#666;font-style:italic}.typing-indicator{display:inline-flex;align-items:center;gap:4px;margin-right:8px}.typing-indicator span{width:8px;height:8px;border-radius:50%;background-color:#646cff;animation:typing 1.4s infinite}.typing-indicator span:nth-child(2){animation-delay:.2s}.typing-indicator span:nth-child(3){animation-delay:.4s}@keyframes typing{0%,60%,to{transform:translateY(0);opacity:.7}30%{transform:translateY(-10px);opacity:1}}.chat-input-form{display:flex;padding:1rem 1.5rem;border-top:1px solid #e0e0e0;gap:1rem}.chat-input{flex:1;padding:.75rem 1rem;border:2px solid #e0e0e0;border-radius:8px;font-size:1rem;transition:border-color .3s}.chat-input:focus{outline:none;border-color:#646cff}.chat-input:disabled{background-color:#f5f5f5;cursor:not-allowed}.send-btn{padding:.75rem 2rem;background-color:#646cff;color:#fff;border:none;border-radius:8px;font-size:1rem;font-weight:500;cursor:pointer;transition:background-color .3s}.send-btn:hover:not(:disabled){background-color:#535bf2}.send-btn:disabled{background-color:#ccc;cursor:not-allowed}.message-timelines{margin-top:1rem;padding-top:1rem;border-top:1px solid rgba(0,0,0,.1)}.message.user .message-timelines{border-top-color:#ffffff4d}.timelines-header{margin-bottom:.75rem;font-size:.9rem;color:#555;display:flex;align-items:center;gap:.5rem}.message.user .timelines-header{color:#ffffffe6}.timeline-icon{font-size:1rem}.timelines-list{display:flex;flex-direction:column;gap:.5rem}.timeline-item{padding:.875rem 1rem;background-color:#f8f9fa;border:2px solid #e0e0e0;border-radius:8px;transition:all .2s ease;display:flex;flex-direction:column;gap:.375rem;-webkit-user-select:none;user-select:none;position:relative;z-index:10;pointer-events:auto}.message.user .timeline-item{background-color:#ffffff26;border-color:#ffffff4d;color:#fff}.timeline-item:hover{background-color:#e3f2fd;border-color:#646cff;transform:translate(4px) scale(1.02);box-shadow:0 4px 8px #646cff40;z-index:2}.message.user .timeline-item:hover{background-color:#ffffff40;border-color:#ffffff80}.timeline-item:active{transform:translate(2px) scale(.98);box-shadow:0 2px 4px #646cff4d}.timeline-item:focus{outline:2px solid #646cff;outline-offset:2px}.timeline-time{font-weight:700;color:#646cff;font-size:.95rem;display:flex;align-items:center;gap:.25rem}.message.user .timeline-time{color:#fff;text-shadow:0 1px 2px rgba(0,0,0,.1)}.timeline-preview{font-size:.875rem;color:#666;line-height:1.5;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;opacity:.85}.message.user .timeline-preview{color:#ffffffe6}.transcript-viewer{width:100%;height:100%;min-height:600px;max-height:calc(100vh - 200px);display:flex;flex-direction:column;padding:1.5rem;background:#fff;border-radius:12px;box-shadow:0 2px 8px #0000001a;overflow:hidden;box-sizing:border-box}.transcript-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:1.25rem;padding-bottom:1rem;border-bottom:2px solid #e0e0e0;flex-shrink:0}.transcript-header h3{margin:0;color:#333;font-size:1.5rem}.transcript-source{font-size:.9rem;color:#666;background:#f0f0f0;padding:5px 12px;border-radius:12px}.video-container{margin-bottom:1.25rem;border-radius:8px;overflow:hidden;box-shadow:0 4px 12px #00000026;flex-shrink:0}.video-container iframe{width:100%;height:300px;border:none}.self-hosted-video{width:100%;height:300px;border-radius:8px;background:#000}.no-video-message{padding:40px;text-align:center;color:#666;background:#f5f5f5;border-radius:8px;font-size:.9rem}.no-video-message p{margin:8px 0}.no-video-message .hint{font-size:.85rem;color:#999;font-style:italic}.transcript-segments{flex:1;overflow-y:auto;overflow-x:hidden;padding:1rem;background:#f9f9f9;border-radius:8px;min-height:0;width:100%;box-sizing:border-box}.transcript-segment{padding:1rem 1.25rem;margin-bottom:.75rem;background:#fff;border-left:4px solid #4CAF50;border-radius:6px;cursor:pointer;transition:all .2s ease}.transcript-segment:hover{background:#f0f7ff;border-left-color:#2196f3;transform:translate(4px);box-shadow:0 2px 8px #0000001a}.transcript-segment.highlighted{background:#e3f2fd;border-left-color:#2196f3;box-shadow:0 4px 12px #2196f34d;font-weight:500}.segment-timestamp{font-size:.85rem;color:#666;margin-bottom:8px;font-weight:600;display:flex;align-items:center}.segment-timestamp:before{content:"⏱️";margin-right:6px}.segment-text{font-size:1rem;line-height:1.6;color:#333}.loading-container{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:60px 40px;min-height:400px}.loading-spinner{width:60px;height:60px;border:5px solid #f3f3f3;border-top:5px solid #646cff;border-radius:50%;animation:spin 1s linear infinite;margin-bottom:20px}.loading-text{font-size:1.2rem;font-weight:600;color:#333;margin-bottom:8px}.loading-subtext{font-size:.9rem;color:#666;opacity:.8}.loading,.error-message,.placeholder,.no-segments{text-align:center;padding:40px;color:#666;font-size:1.1rem}.error-message{color:#d32f2f;background:#ffebee;border-radius:4px}.transcript-segments::-webkit-scrollbar{width:8px}.transcript-segments::-webkit-scrollbar-track{background:#f1f1f1;border-radius:4px}.transcript-segments::-webkit-scrollbar-thumb{background:#888;border-radius:4px}.transcript-segments::-webkit-scrollbar-thumb:hover{background:#555}.app{min-height:100vh;background:linear-gradient(135deg,#667eea,#764ba2);padding:1.5rem 2rem}.app-header{text-align:center;color:#fff;margin-bottom:2rem}.app-header h1{margin:0 0 .5rem;font-size:2.5rem;font-weight:700}.app-header p{margin:0;font-size:1.1rem;opacity:.9}.app-main{max-width:1400px;margin:0 auto;display:flex;flex-direction:column;gap:1.5rem}.view-tabs{display:flex;gap:10px;margin-bottom:1.5rem;border-bottom:2px solid rgba(255,255,255,.2);padding-bottom:10px}.tab-btn{padding:10px 20px;background:#ffffff1a;color:#fff;border:none;border-radius:8px 8px 0 0;cursor:pointer;font-size:1rem;transition:all .2s;font-weight:500}.tab-btn:hover{background:#fff3}.tab-btn.active{background:#ffffff4d;border-bottom:3px solid white;font-weight:600}.content-grid{display:grid;grid-template-columns:1.2fr .8fr;gap:1.5rem;align-items:start;max-width:100%}.transcript-section{min-width:0;display:flex;flex-direction:column;height:100%;width:100%;max-width:100%;overflow:visible;box-sizing:border-box}.chat-section{min-width:0;display:flex;flex-direction:column;height:100%;max-width:100%;overflow:hidden}.loading-overlay{position:fixed;inset:0;background:#000000b3;display:flex;align-items:center;justify-content:center;z-index:9999;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px)}.loading-overlay .loading-container{background:#fff;padding:40px 60px;border-radius:16px;box-shadow:0 8px 32px #0000004d;text-align:center}.loading-overlay .loading-spinner{width:60px;height:60px;border:5px solid #f3f3f3;border-top:5px solid #646cff;border-radius:50%;animation:spin 1s linear infinite;margin:0 auto 20px}.loading-overlay .loading-text{font-size:1.3rem;font-weight:600;color:#333;margin-bottom:8px}.loading-overlay .loading-subtext{font-size:1rem;color:#666;opacity:.8}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@media(max-width:1024px){.content-grid{grid-template-columns:1fr}}
