:root{--bg-primary:#fff;--bg-secondary:#f8fafc;--bg-tertiary:#f1f5f9;--text-primary:#1e293b;--text-secondary:#64748b;--text-muted:#94a3b8;--border-color:#e2e8f0;--border-focus:#6366f1;--accent-primary:#6366f1;--accent-hover:#5b21b6;--shadow-sm:0 1px 2px 0 rgba(0,0,0,.05);--shadow-md:0 4px 6px -1px rgba(0,0,0,.1);--shadow-lg:0 10px 15px -3px rgba(0,0,0,.1);--shadow-xl:0 20px 25px -5px rgba(0,0,0,.1)}[data-theme=dark]{--bg-primary:#0f172a;--bg-secondary:#1e293b;--bg-tertiary:#334155;--text-primary:#f1f5f9;--text-secondary:#cbd5e1;--text-muted:#94a3b8;--border-color:#334155;--border-focus:#8b5cf6;--accent-primary:#8b5cf6;--accent-hover:#7c3aed;--shadow-sm:0 1px 2px 0 rgba(0,0,0,.3);--shadow-md:0 4px 6px -1px rgba(0,0,0,.4);--shadow-lg:0 10px 15px -3px rgba(0,0,0,.4);--shadow-xl:0 20px 25px -5px rgba(0,0,0,.4)}*{margin:0;padding:0;box-sizing:border-box}body{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif;line-height:1.6;color:var(--text-primary);transition:background-color .3s ease,color .3s ease}.app-container,body{background:var(--bg-primary)}.app-container{max-width:1400px;margin:0 auto;padding:2rem;min-height:100vh}.header{text-align:center;margin-bottom:3rem;padding:2rem;background:linear-gradient(135deg,var(--accent-primary),var(--accent-hover));border-radius:16px;color:#fff;box-shadow:var(--shadow-xl)}.header h1{font-size:3rem;margin-bottom:.5rem;text-shadow:2px 2px 4px rgba(0,0,0,.3)}.header p{font-size:1.2rem;opacity:.9}.editor-wrapper{border-radius:16px;box-shadow:var(--shadow-xl);margin-bottom:3rem}.editor-wrapper,.scrivly-editor{background:var(--bg-primary);border:1px solid var(--border-color)}.scrivly-editor{border-radius:16px;font-family:inherit;transition:all .3s ease}.scrivly-editor.fullscreen{position:fixed;top:0;left:0;right:0;bottom:0;z-index:9999;border-radius:0;margin:0}.scrivly-toolbar{display:flex;flex-wrap:wrap;gap:4px;padding:16px 20px;background:var(--bg-secondary);border-bottom:1px solid var(--border-color);position:sticky;top:0;z-index:100;backdrop-filter:blur(10px)}.toolbar-group{display:flex;gap:2px;padding-right:12px;margin-right:8px;border-right:1px solid var(--border-color);align-items:center}.toolbar-group:last-child{border-right:none;margin-right:0;padding-right:0}.toolbar-button{display:flex;align-items:center;justify-content:center;width:40px;height:40px;border:none;background:transparent;border-radius:8px;cursor:pointer;color:var(--text-secondary);transition:all .2s cubic-bezier(.4,0,.2,1);position:relative}.toolbar-button:hover:not(.disabled){background:var(--bg-tertiary);color:var(--accent-primary);transform:translateY(-1px);box-shadow:var(--shadow-md)}.toolbar-button:active:not(.disabled){transform:translateY(0)}.toolbar-button.active{background:var(--accent-primary);color:#fff;box-shadow:var(--shadow-lg)}.toolbar-button.disabled{opacity:.4;cursor:not-allowed}.dropdown-trigger{display:flex;align-items:center;gap:4px;min-width:60px;justify-content:center}.dropdown-menu{border-radius:8px;box-shadow:var(--shadow-lg);min-width:150px;margin-top:4px}.dropdown-item{padding:8px 12px;transition:background-color .2s ease}.color-button{position:relative}.color-indicator{position:absolute;bottom:2px;left:50%;transform:translateX(-50%);width:16px;height:3px;border-radius:2px}.text-color{background:red}.bg-color{background:#ff0}.scrivly-editor-container{overflow-y:auto;position:relative;background:var(--bg-primary)}.scrivly-editor-content{padding:32px;min-height:300px;outline:none;line-height:1.8;font-size:16px;color:var(--text-primary);background:var(--bg-primary)}.scrivly-editor-content:empty:before{content:attr(data-placeholder);color:var(--text-muted);pointer-events:none;font-style:italic}.scrivly-editor-footer{padding:12px 20px}.scrivly-editor-stats{display:flex;gap:20px;font-size:13px;color:var(--text-muted)}.table-controls{display:flex;gap:8px}.table-controls button{padding:4px 8px;font-size:12px;border:1px solid var(--border-color);background:var(--bg-primary);color:var(--text-secondary);border-radius:4px;cursor:pointer;transition:all .2s ease}.table-controls button:hover{background:var(--bg-tertiary);color:var(--accent-primary)}.scrivly-editor-content h1{font-size:2.5rem;font-weight:700;margin:2rem 0 1.5rem;color:var(--text-primary);line-height:1.2}.scrivly-editor-content h2{font-size:2rem;font-weight:600;margin:1.75rem 0 1rem;color:var(--text-primary);line-height:1.3}.scrivly-editor-content h3{font-size:1.5rem;font-weight:600;margin:1.5rem 0 .75rem;color:var(--text-primary);line-height:1.4}.scrivly-editor-content h4{font-size:1.25rem;font-weight:600;margin:1.25rem 0 .5rem;color:var(--text-primary)}.scrivly-editor-content h5{font-size:1.125rem}.scrivly-editor-content h5,.scrivly-editor-content h6{font-weight:600;margin:1rem 0 .5rem;color:var(--text-primary)}.scrivly-editor-content h6{font-size:1rem}.scrivly-editor-content p{margin-bottom:1.25rem}.scrivly-editor-content ol,.scrivly-editor-content ul{margin:1.25rem 0;padding-left:2rem}.scrivly-editor-content li{margin-bottom:.5rem}.scrivly-editor-content blockquote{border-left:4px solid var(--accent-primary);margin:2rem 0;font-style:italic;color:var(--text-secondary);background:var(--bg-secondary);padding:1.5rem;border-radius:0 12px 12px 0;position:relative}.scrivly-editor-content blockquote:before{content:'"';font-size:4rem;color:var(--accent-primary);position:absolute;top:-10px;left:20px;opacity:.3}.scrivly-editor-content code{background:var(--bg-tertiary);padding:.25rem .5rem;border-radius:6px;font-size:.875em;color:var(--accent-primary);border:1px solid var(--border-color)}.scrivly-editor-content code,.scrivly-editor-content pre{font-family:SF Mono,Monaco,Cascadia Code,Roboto Mono,Consolas,Courier New,monospace}.scrivly-editor-content pre{background:var(--bg-secondary);color:var(--text-primary);padding:2rem;border-radius:12px;overflow-x:auto;margin:2rem 0;font-size:.875rem;line-height:1.6;border:1px solid var(--border-color);position:relative}.scrivly-editor-content pre:before{content:"Code";position:absolute;top:8px;right:12px;font-size:.75rem;color:var(--text-muted);text-transform:uppercase;letter-spacing:.5px}.scrivly-editor-content pre code{background:none;padding:0;color:inherit;font-size:inherit;border:none}.scrivly-editor-content a{color:var(--accent-primary);text-decoration:none;border-bottom:1px solid transparent;transition:all .2s ease}.scrivly-editor-content a:hover{border-bottom-color:var(--accent-primary);background:rgba(99,102,241,.1);padding:2px 4px;border-radius:4px}.scrivly-editor-content img{max-width:100%;height:auto;border-radius:12px;margin:1.5rem 0;box-shadow:var(--shadow-lg);transition:transform .3s ease}.scrivly-editor-content img:hover{transform:scale(1.02)}.table-context-menu{position:fixed;z-index:10000;animation:fadeIn .2s ease-out}.context-menu-content{background:var(--bg-primary);border:1px solid var(--border-color);border-radius:12px;box-shadow:var(--shadow-xl);padding:8px;min-width:200px;backdrop-filter:blur(10px)}.context-menu-item{display:flex;align-items:center;gap:12px;width:100%;padding:10px 12px;border:none;background:transparent;color:var(--text-primary);text-align:left;cursor:pointer;border-radius:8px;font-size:14px;transition:all .2s ease}.context-menu-item:hover{background:var(--bg-tertiary);transform:translateX(4px)}.context-menu-item.success:hover{background:rgba(34,197,94,.1);color:#22c55e}.context-menu-item.danger:hover{background:rgba(239,68,68,.1);color:#ef4444}.context-menu-divider{height:1px;background:var(--border-color);margin:8px 0}.image-container{position:relative;display:inline-block;margin:1rem 0;border:2px dashed transparent;border-radius:12px;transition:all .3s ease;resize:both;overflow:hidden;min-width:100px;min-height:100px}.image-container:hover{border-color:var(--accent-primary);box-shadow:var(--shadow-lg)}.image-container:hover .resize-handle{opacity:1}.image-container .resize-handle{position:absolute;bottom:0;right:0;width:20px;height:20px;background:var(--accent-primary);cursor:se-resize;opacity:0;transition:opacity .2s ease;border-radius:8px 0 0 0}.image-container .resize-handle:before{content:"⋰";position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);color:#fff;font-size:12px}.scrivly-editor-content table{border-radius:12px;transition:all .3s ease}.scrivly-editor-content table:hover{box-shadow:var(--shadow-lg);transform:translateY(-2px)}.scrivly-editor-content td,.scrivly-editor-content th{transition:all .2s ease;position:relative}.scrivly-editor-content td:hover{box-shadow:inset 0 0 0 2px var(--accent-primary)}.scrivly-editor-content th{position:relative}.scrivly-editor-content th:after{content:"";position:absolute;bottom:0;left:0;right:0;height:2px;background:var(--accent-primary)}.dropdown-container{position:relative}.dropdown-trigger.active{background:var(--accent-primary);color:#fff}.dropdown-menu{position:absolute;top:100%;left:0;background:var(--bg-primary);border:1px solid var(--border-color);border-radius:12px;box-shadow:var(--shadow-xl);z-index:1000;min-width:180px;max-height:300px;overflow-y:auto;margin-top:8px;backdrop-filter:blur(10px);animation:slideDown .2s ease-out}@keyframes slideDown{0%{opacity:0;transform:translateY(-10px)}to{opacity:1;transform:translateY(0)}}.dropdown-item{display:block;width:100%;padding:12px 16px;border:none;background:transparent;color:var(--text-primary);text-align:left;cursor:pointer;transition:all .2s ease;font-size:14px;border-radius:8px;margin:2px}.dropdown-item:hover{background:var(--bg-tertiary);transform:translateX(4px)}.dropdown-item.active{background:var(--accent-primary);color:#fff}.scrivly-editor-footer{padding:16px 24px;background:var(--bg-secondary);border-top:1px solid var(--border-color);display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:16px}.table-info{display:flex;align-items:center;gap:8px;font-size:13px;color:var(--accent-primary);background:rgba(99,102,241,.1);padding:6px 12px;border-radius:20px;border:1px solid var(--accent-primary)}.video-container{border:2px dashed transparent;transition:all .3s ease}.video-container:hover{border-color:var(--accent-primary);box-shadow:var(--shadow-xl);transform:translateY(-2px)}.video-container .resize-handle{opacity:0;transition:opacity .2s ease;background:var(--accent-primary)!important;border-radius:8px 0 0 0}.video-container .resize-handle:before{content:"⋰";position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);color:#fff;font-size:12px}.loading-overlay{position:absolute;top:0;left:0;right:0;bottom:0;background:rgba(0,0,0,.5);display:flex;align-items:center;justify-content:center;border-radius:12px;backdrop-filter:blur(4px)}.loading-spinner{width:32px;height:32px;border-top:3px solid var(--border-color);border:3px solid var(--border-color);border-top-color:var(--accent-primary);border-radius:50%;animation:spin 1s linear infinite}@keyframes spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}.scrivly-editor-content table{border-collapse:collapse;width:100%;margin:2rem 0;background:var(--bg-primary);border-radius:8px;overflow:hidden;box-shadow:var(--shadow-md)}.scrivly-editor-content td,.scrivly-editor-content th{border:1px solid var(--border-color);padding:12px;text-align:left;transition:background-color .2s ease}.scrivly-editor-content td:hover{background:var(--bg-secondary)}.scrivly-editor-content th{background:var(--bg-tertiary);font-weight:600}.video-container{margin:2rem 0;border-radius:12px;overflow:hidden;box-shadow:var(--shadow-lg);position:relative}.video-container:hover .resize-handle{opacity:1}.resize-handle{opacity:0;transition:opacity .2s ease;background:var(--accent-primary)!important;border-radius:4px 0 0 0}.modal-overlay{position:fixed;top:0;left:0;right:0;bottom:0;background:rgba(0,0,0,.7);display:flex;align-items:center;justify-content:center;z-index:10000;backdrop-filter:blur(4px)}.modal-content{background:var(--bg-primary);border-radius:16px;box-shadow:var(--shadow-xl);max-width:500px;width:90%;max-height:80vh;overflow-y:auto;border:1px solid var(--border-color)}.color-picker-modal{max-width:300px}.color-picker-modal,.emoji-picker-modal{background:var(--bg-primary);border-radius:12px;box-shadow:var(--shadow-xl);width:90%;border:1px solid var(--border-color)}.emoji-picker-modal{max-width:400px;max-height:500px;overflow-y:auto}.modal-header{display:flex;justify-content:space-between;align-items:center;padding:20px;border-bottom:1px solid var(--border-color)}.modal-header h3{margin:0;color:var(--text-primary);font-size:1.25rem;font-weight:600}.close-button{background:none;border:none;cursor:pointer;color:var(--text-secondary);padding:4px;border-radius:4px;transition:all .2s ease}.close-button:hover{background:var(--bg-tertiary);color:var(--text-primary)}.modal-body{padding:20px}.modal-footer{display:flex;justify-content:flex-end;gap:12px;padding:20px;border-top:1px solid var(--border-color)}.form-group{margin-bottom:16px}.form-row{display:grid;grid-template-columns:1fr 1fr;gap:16px}.form-group label{display:block;margin-bottom:6px;font-weight:500}.form-group input,.form-group label{color:var(--text-primary);font-size:14px}.form-group input{width:100%;padding:10px 12px;border:1px solid var(--border-color);border-radius:8px;background:var(--bg-primary);transition:all .2s ease}.form-group input:focus{outline:none;border-color:var(--accent-primary);box-shadow:0 0 0 3px rgba(99,102,241,.1)}.form-group input.error{border-color:#ef4444}.form-group small{display:block;margin-top:4px;color:var(--text-muted);font-size:12px}.button{padding:10px 20px;border:none;border-radius:8px;cursor:pointer;font-size:14px;font-weight:500;transition:all .2s ease;display:inline-flex;align-items:center;gap:8px}.button.primary{background:var(--accent-primary);color:#fff}.button.primary:hover:not(:disabled){background:var(--accent-hover);transform:translateY(-1px);box-shadow:var(--shadow-md)}.button.secondary{background:var(--bg-secondary);color:var(--text-primary);border:1px solid var(--border-color)}.button.secondary:hover{background:var(--bg-tertiary)}.button:disabled{opacity:.5;cursor:not-allowed}.color-grid{display:grid;grid-template-columns:repeat(6,1fr);gap:8px;padding:16px}.color-swatch{width:32px;height:32px;border:2px solid var(--border-color);border-radius:6px;cursor:pointer;transition:all .2s ease}.color-swatch:hover{transform:scale(1.1);box-shadow:var(--shadow-md)}.custom-color{padding:16px;border-top:1px solid var(--border-color);display:flex;align-items:center;gap:12px}.color-input{width:50px;height:32px;border:none;border-radius:6px;cursor:pointer}.emoji-categories{padding:16px}.emoji-category{margin-bottom:20px}.emoji-category h4{margin-bottom:8px;color:var(--text-primary);font-size:14px;font-weight:600}.emoji-grid{display:grid;grid-template-columns:repeat(8,1fr);gap:4px}.emoji-button{width:32px;height:32px;border:none;background:transparent;border-radius:6px;cursor:pointer;font-size:18px;transition:all .2s ease;display:flex;align-items:center;justify-content:center}.emoji-button:hover{background:var(--bg-tertiary);transform:scale(1.2)}.features-showcase{margin-top:4rem;padding:3rem;background:var(--bg-secondary);border-radius:16px;border:1px solid var(--border-color)}.features-showcase h2{text-align:center;font-size:2.5rem;margin-bottom:3rem;color:var(--text-primary);background:linear-gradient(135deg,var(--accent-primary),var(--accent-hover));-webkit-background-clip:text;-webkit-text-fill-color:transparent;background-clip:text}.feature-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(300px,1fr));gap:2rem}.feature-card{background:var(--bg-primary);border:1px solid var(--border-color);border-radius:12px;padding:2rem;transition:all .3s ease;position:relative;overflow:hidden}.feature-card:before{content:"";position:absolute;top:0;left:0;right:0;height:4px;background:linear-gradient(135deg,var(--accent-primary),var(--accent-hover))}.feature-card:hover{transform:translateY(-8px);box-shadow:var(--shadow-xl);border-color:var(--accent-primary)}.feature-card h3{font-size:1.25rem;margin-bottom:1rem;color:var(--text-primary);display:flex;align-items:center;gap:8px}.feature-card p{color:var(--text-secondary);line-height:1.6}@media (max-width:768px){.app-container{padding:1rem}.header h1{font-size:2rem}.scrivly-toolbar{padding:12px 16px;gap:2px}.toolbar-button{width:36px;height:36px}.toolbar-group{padding-right:8px;margin-right:6px}.scrivly-editor-content{padding:20px;font-size:14px}.feature-grid,.form-row{grid-template-columns:1fr}.modal-content{margin:20px;width:calc(100% - 40px)}.color-grid{grid-template-columns:repeat(4,1fr)}.emoji-grid{grid-template-columns:repeat(6,1fr)}}@media (max-width:480px){.scrivly-toolbar{padding:8px 12px}.toolbar-button{width:32px;height:32px}.scrivly-editor-content{padding:16px}.header{padding:1.5rem}.header h1{font-size:1.75rem}.features-showcase{padding:2rem}}@keyframes fadeIn{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}@keyframes slideIn{0%{opacity:0;transform:translateX(-20px)}to{opacity:1;transform:translateX(0)}}.feature-card,.scrivly-editor{animation:fadeIn .6s ease-out}.feature-card:first-child{animation-delay:.1s}.feature-card:nth-child(2){animation-delay:.2s}.feature-card:nth-child(3){animation-delay:.3s}.feature-card:nth-child(4){animation-delay:.4s}.feature-card:nth-child(5){animation-delay:.5s}.feature-card:nth-child(6){animation-delay:.6s}.feature-card:nth-child(7){animation-delay:.7s}.feature-card:nth-child(8){animation-delay:.8s}.feature-card:nth-child(9){animation-delay:.9s}.feature-card:nth-child(10){animation-delay:1s}.feature-card:nth-child(11){animation-delay:1.1s}.feature-card:nth-child(12){animation-delay:1.2s}.dropdown-menu{animation:slideIn .2s ease-out}.color-picker-modal,.emoji-picker-modal,.modal-content,.modal-overlay{animation:fadeIn .3s ease-out}::selection{background:rgba(99,102,241,.2)}.toolbar-button:focus-visible{outline:2px solid var(--accent-primary);outline-offset:2px}.scrivly-editor-content:focus{box-shadow:inset 0 0 0 2px rgba(99,102,241,.2)}::-webkit-scrollbar{width:8px;height:8px}::-webkit-scrollbar-track{background:var(--bg-secondary)}::-webkit-scrollbar-thumb{background:var(--border-color);border-radius:4px}::-webkit-scrollbar-thumb:hover{background:var(--text-muted)}@media print{.features-showcase,.scrivly-editor-footer,.scrivly-toolbar{display:none!important}.scrivly-editor{border:none;box-shadow:none}.scrivly-editor-content{padding:0}}.toolbar-button[title]:hover:after{content:attr(title);background:var(--text-primary);color:var(--bg-primary);padding:6px 10px;border-radius:6px;font-size:12px;white-space:nowrap;margin-bottom:8px;animation:fadeIn .2s ease-out}.toolbar-button[title]:hover:after,.toolbar-button[title]:hover:before{position:absolute;bottom:100%;left:50%;transform:translateX(-50%);z-index:99999;pointer-events:none}.toolbar-button[title]:hover:before{content:"";border:4px solid transparent;border-top:4px solid var(--text-primary);margin-bottom:4px}*{transition:background-color .2s ease,color .2s ease,border-color .2s ease}.scrivly-editor-content:focus{box-shadow:inset 0 0 0 2px rgba(99,102,241,.3);outline:none}.scrivly-editor-content ::selection{background:rgba(99,102,241,.2);color:var(--text-primary)}.tab-container{margin-bottom:20px}.tab-buttons{display:flex;border-bottom:1px solid var(--border-color)}.tab-button{display:flex;align-items:center;gap:8px;padding:12px 20px;background:transparent;color:var(--text-secondary);cursor:pointer;border:none;border-bottom:2px solid transparent;transition:all .2s ease;font-size:14px;font-weight:500}.tab-button:hover{color:var(--text-primary);background:var(--bg-tertiary)}.tab-button.active{color:var(--accent-primary);border-bottom-color:var(--accent-primary);background:var(--bg-secondary)}.upload-section{padding:20px 0}.upload-area{border:2px dashed var(--border-color);border-radius:12px;padding:40px 20px;text-align:center;transition:all .3s ease;background:var(--bg-secondary)}.upload-area:hover{border-color:var(--accent-primary);background:var(--bg-tertiary)}.file-input{display:none}.upload-label{display:flex;flex-direction:column;align-items:center;gap:12px;cursor:pointer;color:var(--text-secondary)}.upload-label h4{margin:0;font-size:18px;font-weight:600;color:var(--text-primary)}.upload-label p{margin:0;font-size:14px}.upload-label small{font-size:12px;color:var(--text-muted)}.error-message{background:rgba(239,68,68,.1);color:#ef4444;padding:12px;border-radius:8px;margin-top:16px;font-size:14px;border:1px solid rgba(239,68,68,.2)}.upload-progress{margin-top:16px;text-align:center}.progress-bar{width:100%;height:8px;background:var(--bg-tertiary);border-radius:4px;overflow:hidden;margin-bottom:8px}.progress-fill{height:100%;background:var(--accent-primary);border-radius:4px;animation:progressAnimation 2s ease-in-out infinite}@keyframes progressAnimation{0%{width:0}50%{width:70%}to{width:100%}}.image-preview{margin-top:20px;padding:16px;background:var(--bg-secondary);border-radius:8px;border:1px solid var(--border-color)}.image-preview p{margin:0 0 12px;font-weight:500;color:var(--text-primary)}