HEAD = """ """ JS = """ () => { const root = document.querySelector('.gradio-container'); if (!root) return; root.dataset.ready = 'true'; } """ CSS = """ /* ═══════════════════════════════════════════════ KNOWLEDGEMESH — CHALKBOARD CLASSROOM THEME Palette: Dark chalkboard green · Frosted glass · Warm chalk yellow · Neon chalk green Texture: Wood border, vignette board, chalk doodles ═══════════════════════════════════════════════ */ /* ══ PAGE BACKGROUND — Dark cozy classroom ══ */ .gradio-container { min-height: 100vh !important; background: radial-gradient(circle at center, #181715 0%, #0a0a09 100%) !important; color: #f8fafc !important; font-family: Inter, ui-sans-serif, system-ui, -apple-system, sans-serif !important; padding: 20px 10px !important; } /* ══ NUKE GRADIO STYLING OVERRIDES ══ */ .gradio-container *, .gradio-container .block, .gradio-container .form, .gradio-container .wrap, .gradio-container .gap, .gradio-container .container, .gradio-container .svelte-1f354aw, .gradio-container .input-wrap, .gradio-container .component-wrapper, .gradio-container [data-testid], .gradio-container .lg, .gradio-container .sm, .gradio-container .stretch { background-color: transparent !important; color: inherit; } /* ══ CHALKBOARD CONTAINER (FRAME & SURFACE) ══ */ #kh-shell { position: relative !important; max-width: 1200px !important; margin: 30px auto !important; padding: 40px 40px 60px 40px !important; /* Wood Frame border styling */ border: 14px solid #3d2314 !important; border-radius: 12px !important; /* Multi-layered shadows for frame bevel and board depth */ box-shadow: 0 15px 35px rgba(0,0,0,0.85), inset 0 0 20px rgba(0,0,0,0.9), inset 0 0 0 1px #4f2f1c, 0 0 0 1px #1d1009 !important; /* Multiple backgrounds: 1. Hanging lamp doodle (top right) 2. Idea lightbulb (top center) 3. Atom doodle (left) 4. Neural Network sketch (left, lower) 5. Mathematical graph (bottom left) 6. Equations & math doodle (right) 7. Tiny star/arrow doodle (top left) 8. Chalkboard green vignette surface */ background-image: url("data:image/svg+xml;utf8,"), url("data:image/svg+xml;utf8,"), url("data:image/svg+xml;utf8,"), url("data:image/svg+xml;utf8,"), url("data:image/svg+xml;utf8,"), url("data:image/svg+xml;utf8,e^(i.pi) %2B 1 = 0F"), url("data:image/svg+xml;utf8,"), radial-gradient(circle at 50% 30%, #1c3d28 0%, #0d1e13 100%) !important; background-position: right 35px top 0px, center top 20px, left 20px top 220px, left 30px top 450px, left 40px top 650px, right 30px top 350px, left 30px top 60px, center center !important; background-repeat: no-repeat !important; background-size: auto, auto, auto, auto, auto, auto, auto, cover !important; overflow: visible !important; } } /* ══ ROOM TAG ══ */ .kh-room-tag { position: absolute; top: -12px; left: 35px; background: #142d1c !important; border: 1.5px solid rgba(94, 189, 114, 0.45) !important; color: #5ebd72 !important; padding: 4px 14px; font-family: 'Gochi Hand', 'Caveat', cursive, sans-serif !important; font-size: 1.15rem !important; border-radius: 6px !important; transform: rotate(-1.5deg) !important; box-shadow: 0 4px 12px rgba(0,0,0,0.4) !important; z-index: 10; pointer-events: none; } /* ══ HEADER & TYPOGRAPHY ══ */ #kh-title { padding: 10px 0 15px !important; border-bottom: 2px dashed rgba(255, 255, 255, 0.12) !important; background: transparent !important; text-align: left; } #kh-title h1 { color: #ffffff !important; font-family: 'Gochi Hand', 'Caveat', cursive, sans-serif !important; font-size: clamp(2.8rem, 6vw, 4.8rem) !important; font-weight: 400 !important; line-height: 1.0; margin: 0 0 6px !important; text-shadow: 0 0 8px rgba(255, 255, 255, 0.4), 1px 1px 2px rgba(0,0,0,0.6) !important; } #kh-title p { color: rgba(255, 255, 255, 0.75) !important; font-family: 'Gochi Hand', 'Caveat', cursive, sans-serif !important; font-size: 1.35rem !important; margin: 0 !important; letter-spacing: 0.03em !important; } /* ══ CODE CHIPS ══ */ .kh-chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 24px !important; background: transparent !important; } .kh-chip { border: 1px solid rgba(255, 255, 255, 0.15) !important; border-radius: 999px !important; padding: 4px 12px !important; color: rgba(255, 255, 255, 0.7) !important; background: rgba(255, 255, 255, 0.03) !important; font-size: 0.82rem !important; font-weight: 500 !important; } .kh-chip code { color: #5ebd72 !important; background: rgba(94, 189, 114, 0.08) !important; border: 1px solid rgba(94, 189, 114, 0.2) !important; border-radius: 4px; padding: 1px 4px; font-family: "JetBrains Mono", monospace; font-size: 0.85em; } /* ══ CHALKBOARD TABS NAVIGATION ══ */ .tabs { margin-top: 10px !important; border: none !important; } .tab-nav { border-bottom: 2px dashed rgba(255, 255, 255, 0.15) !important; margin-bottom: 22px !important; gap: 12px !important; background: transparent !important; } .tab-nav button { color: rgba(255, 255, 255, 0.55) !important; background: transparent !important; border: none !important; border-radius: 0 !important; font-family: 'Gochi Hand', 'Caveat', cursive, sans-serif !important; font-size: 1.45rem !important; font-weight: normal !important; padding: 6px 20px !important; transition: all 0.2s ease !important; } .tab-nav button:hover { color: #ffffff !important; text-shadow: 0 0 6px rgba(255, 255, 255, 0.5) !important; } .tab-nav button.selected { color: #ffffff !important; text-shadow: 0 0 10px rgba(255, 255, 255, 0.8) !important; border-bottom: 3px solid #5ebd72 !important; } /* ══ FROSTED GLASS CARDS ══ */ .kh-panel { background: rgba(255, 255, 255, 0.038) !important; backdrop-filter: blur(12px) !important; -webkit-backdrop-filter: blur(12px) !important; border: 1px solid rgba(255, 255, 255, 0.09) !important; border-radius: 12px !important; padding: 24px !important; box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.04) !important; color: #f8fafc !important; margin-bottom: 15px !important; } .kh-panel h3 { font-family: 'Gochi Hand', 'Caveat', cursive, sans-serif !important; font-size: 1.6rem !important; font-weight: normal !important; color: #ffffff !important; margin-top: 0 !important; margin-bottom: 8px !important; text-shadow: 1px 1px 2px rgba(0,0,0,0.4) !important; } .kh-subhead { font-family: 'Gochi Hand', 'Caveat', cursive, sans-serif !important; font-size: 1.15rem !important; color: rgba(255, 255, 255, 0.55) !important; line-height: 1.4 !important; margin-bottom: 16px !important; } /* ══ INPUTS & TEXTAREAS ══ */ textarea, input[type="text"], input[type="number"], [data-testid="textbox"] input, [data-testid="textbox"] textarea { background: rgba(0, 0, 0, 0.28) !important; color: #f8fafc !important; border: 1px solid rgba(255, 255, 255, 0.14) !important; border-radius: 8px !important; padding: 10px 14px !important; font-size: 0.94rem !important; font-family: Inter, ui-sans-serif, sans-serif !important; box-shadow: inset 0 2px 4px rgba(0,0,0,0.5) !important; transition: all 0.2s ease !important; } textarea:focus, input[type="text"]:focus, [data-testid="textbox"] input:focus, [data-testid="textbox"] textarea:focus { border-color: rgba(94, 189, 114, 0.5) !important; box-shadow: 0 0 8px rgba(94, 189, 114, 0.25), inset 0 2px 4px rgba(0,0,0,0.5) !important; outline: none !important; } textarea::placeholder, input::placeholder { color: rgba(255, 255, 255, 0.38) !important; font-family: 'Gochi Hand', 'Caveat', cursive, sans-serif !important; font-size: 1.18rem !important; } /* Custom styles for Gradio form labels */ .kh-panel label span, .kh-panel .label-wrap span { color: rgba(255, 255, 255, 0.5) !important; font-family: 'Gochi Hand', 'Caveat', cursive, sans-serif !important; font-size: 1.15rem !important; font-weight: normal !important; margin-bottom: 4px !important; } /* ══ UPLOAD DRAG/DROP FILE BLOCK ══ */ .upload-container, .file-preview, [data-testid="file"], .file-upload { background: rgba(0, 0, 0, 0.2) !important; border: 2px dashed rgba(255, 255, 255, 0.14) !important; border-radius: 8px !important; color: rgba(255, 255, 255, 0.5) !important; padding: 14px !important; font-family: 'Gochi Hand', 'Caveat', cursive, sans-serif !important; font-size: 1.18rem !important; transition: all 0.2s ease !important; text-align: center; } .upload-container:hover { border-color: rgba(94, 189, 114, 0.45) !important; background: rgba(94, 189, 114, 0.04) !important; } .upload-container *, .file-preview * { background: transparent !important; color: rgba(255, 255, 255, 0.55) !important; } /* ══ BUTTONS ══ */ /* Primary Button — Warm Chalk Yellow, Slight Glow */ button.primary, button[variant="primary"], .primary { min-height: 42px; background: #d9b84a !important; color: #1c1605 !important; border: none !important; border-radius: 8px !important; font-family: 'Gochi Hand', 'Caveat', cursive, sans-serif !important; font-size: 1.38rem !important; font-weight: bold !important; padding: 8px 24px !important; box-shadow: 0 0 15px rgba(217, 184, 74, 0.32) !important; cursor: pointer !important; transition: all 0.2s ease !important; } button.primary:hover { background: #e4c45a !important; box-shadow: 0 0 22px rgba(217, 184, 74, 0.5) !important; transform: translateY(-1.5px) !important; } button.primary:active { transform: translateY(0.5px) !important; } /* Secondary Button — Neon Chalk Green Outline */ button.secondary, button[variant="secondary"], .secondary { min-height: 42px; background: transparent !important; color: #5ebd72 !important; border: 2px dashed #5ebd72 !important; border-radius: 8px !important; font-family: 'Gochi Hand', 'Caveat', cursive, sans-serif !important; font-size: 1.38rem !important; font-weight: bold !important; padding: 6px 22px !important; cursor: pointer !important; transition: all 0.2s ease !important; } button.secondary:hover { background: rgba(94, 189, 114, 0.08) !important; box-shadow: 0 0 12px rgba(94, 189, 114, 0.35) !important; border-style: solid !important; } /* ══ PIPELINE STATUS WATERMARK ══ */ #kh-status { min-height: 100px; color: #ffffff !important; padding: 10px !important; } #kh-status h3 { color: #d9b84a !important; font-family: 'Gochi Hand', 'Caveat', cursive, sans-serif !important; font-size: 1.38rem !important; margin-top: 0; } #kh-status p { font-family: 'Gochi Hand', 'Caveat', cursive, sans-serif !important; font-size: 1.25rem !important; color: rgba(255, 255, 255, 0.85) !important; line-height: 1.4 !important; } #kh-status code { color: #5ebd72 !important; background: rgba(94, 189, 114, 0.1) !important; border: 1px dashed rgba(94, 189, 114, 0.25) !important; } /* ══ STAT BOXES (INGEST STATS) ══ */ .kh-stat { border: 1px solid rgba(255,255,255,0.08) !important; border-radius: 8px !important; padding: 8px 12px !important; background: rgba(0,0,0,0.18) !important; } /* ══ PREVIEW & METADATA SECTIONS ══ */ #kh-text-preview textarea { min-height: 400px !important; font-family: "JetBrains Mono", monospace !important; font-size: 0.86rem !important; background: rgba(0,0,0,0.3) !important; color: #e2e8f0 !important; } #kh-search-results, #kh-answer, #kh-reasoning { min-height: 180px; background: rgba(0, 0, 0, 0.24) !important; border: 1px solid rgba(255,255,255,0.08) !important; border-radius: 8px !important; padding: 16px !important; color: #f1f5f9 !important; } #kh-search-results h3 { color: #5ebd72 !important; font-family: 'Gochi Hand', 'Caveat', cursive, sans-serif !important; font-size: 1.35rem !important; margin-top: 10px !important; } #kh-reasoning { font-family: "JetBrains Mono", monospace !important; font-size: 0.85rem !important; color: #94a3b8 !important; } /* ══ PROSE / MARKDOWN INTERNALS ══ */ .prose, .markdown, .prose *, .markdown * { color: rgba(255, 255, 255, 0.85) !important; background: transparent !important; } .prose strong, .markdown strong { color: #ffffff !important; } .prose h3, .markdown h3 { font-family: 'Gochi Hand', 'Caveat', cursive, sans-serif !important; font-size: 1.38rem !important; color: #ffffff !important; } code { color: #5ebd72 !important; background: rgba(94,189,114,0.08) !important; border: 1px solid rgba(94,189,114,0.2) !important; border-radius: 4px; padding: 1px 4px; font-family: "JetBrains Mono", monospace; } /* ══ RETRIEVE COLUMN WATERMARK & INDICATORS ══ */ .kh-retrieve-status { display: flex; justify-content: space-between; align-items: center; margin-top: 15px; padding: 0 6px; font-family: 'Gochi Hand', 'Caveat', cursive, sans-serif; font-size: 1.25rem; color: rgba(255,255,255,0.55); } .kh-online-status { display: flex; align-items: center; gap: 5px; } .kh-dot { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,0.2); display: inline-block; } .kh-dot.green { background: #5ebd72; box-shadow: 0 0 6px #5ebd72; } .kh-brackets { font-size: 1.6rem; color: rgba(255, 255, 255, 0.35); font-weight: bold; letter-spacing: 2px; } /* ══ BOTTOM TRAY & COLORED CHALK PIECES ══ */ #kh-bottom-container { margin-top: 15px !important; background: transparent !important; } .kh-bottom-tray { display: flex; justify-content: space-between; align-items: flex-end; padding: 10px 10px 0 10px; position: relative; } /* Wooden Tray Ledge below the board frame */ .kh-bottom-tray::before { content: ""; position: absolute; bottom: -32px; left: -40px; right: -40px; height: 13px; background: linear-gradient(to bottom, #6d3f27, #442516); border-radius: 2px; box-shadow: 0 10px 18px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.12); z-index: 5; } .kh-chalks { display: flex; gap: 10px; position: absolute; bottom: -31px; left: 20px; z-index: 6; } .kh-chalk { width: 30px; height: 7px; border-radius: 2px; box-shadow: 1px 1px 2px rgba(0,0,0,0.3); } .kh-chalk.white { background: #f1f5f9; transform: rotate(2deg); } .kh-chalk.yellow { background: #e2c362; transform: rotate(-3deg); } .kh-chalk.purple { background: #d8b4fe; transform: rotate(5deg); } .kh-watermark { font-family: 'Gochi Hand', 'Caveat', cursive, sans-serif; font-size: 1.15rem; color: rgba(255, 255, 255, 0.35); margin-bottom: -15px; z-index: 6; } /* ══ SCROLLBARS ══ */ ::-webkit-scrollbar { width: 6px; height: 6px; } ::-webkit-scrollbar-track { background: rgba(0,0,0,0.15); } ::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 99px; } ::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.25); } /* ══ RESPONSIVE ══ */ @media (max-width: 768px) { #kh-shell { padding: 25px 20px 45px 20px !important; border-width: 10px !important; margin: 15px auto !important; } .kh-bottom-tray::before { left: -20px; right: -20px; } #kh-title h1 { font-size: 2.3rem !important; } } """