Spaces:
Running on Zero
Running on Zero
Venkatesh Rajagopal
REFRAME: live CBT studio — fine-tuned Gemma 12B on Modal + Cohere voice (ZeroGPU)
4ae4ae8 | /* REFRAME — Master Theme */ | |
| /* Dark, calm, ambient therapy environment */ | |
| :root { | |
| --bg-primary: #0f1419; | |
| --bg-secondary: #1a2332; | |
| --bg-card: #1e2a3a; | |
| --text-primary: #e8edf3; | |
| --text-secondary: #8899aa; | |
| --text-muted: #5a6a7a; | |
| --accent: #8b5cf6; | |
| --accent-glow: rgba(139, 92, 246, 0.2); | |
| --success: #22c55e; | |
| --success-glow: rgba(34, 197, 94, 0.15); | |
| --border: rgba(255, 255, 255, 0.08); | |
| --shadow: rgba(0, 0, 0, 0.3); | |
| } | |
| /* Main app container */ | |
| .gradio-container { | |
| background: var(--bg-primary) ; | |
| min-height: 100vh; | |
| font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif ; | |
| } | |
| /* Atmosphere background — animated gradient */ | |
| .atmosphere-wrapper { | |
| position: fixed; | |
| top: 0; left: 0; right: 0; bottom: 0; | |
| z-index: -1; | |
| transition: background 5s ease; | |
| } | |
| .atmosphere-neutral { | |
| background: linear-gradient(135deg, #0f1419 0%, #1a2332 50%, #0f1419 100%); | |
| background-size: 400% 400%; | |
| animation: drift 20s ease infinite; | |
| } | |
| .atmosphere-anxious { | |
| background: linear-gradient(135deg, #0f1a2e 0%, #1a2540 30%, #162030 70%, #0f1419 100%); | |
| background-size: 400% 400%; | |
| animation: drift 12s ease infinite; | |
| } | |
| .atmosphere-sad { | |
| background: linear-gradient(135deg, #12101f 0%, #1a1535 50%, #0f0f1f 100%); | |
| background-size: 400% 400%; | |
| animation: drift 25s ease infinite; | |
| } | |
| .atmosphere-angry { | |
| background: linear-gradient(135deg, #1f1410 0%, #2a1a15 50%, #1a1210 100%); | |
| background-size: 400% 400%; | |
| animation: drift 15s ease infinite; | |
| } | |
| .atmosphere-calm { | |
| background: linear-gradient(135deg, #0f1f1a 0%, #152a25 50%, #0f1f1a 100%); | |
| background-size: 400% 400%; | |
| animation: drift 30s ease infinite; | |
| } | |
| .atmosphere-breakthrough { | |
| background: linear-gradient(135deg, #1a1a0f 0%, #2a2510 30%, #1f1a0f 70%, #0f1419 100%); | |
| background-size: 400% 400%; | |
| animation: expand 8s ease infinite; | |
| } | |
| @keyframes drift { | |
| 0% { background-position: 0% 50%; } | |
| 50% { background-position: 100% 50%; } | |
| 100% { background-position: 0% 50%; } | |
| } | |
| @keyframes expand { | |
| 0% { background-position: 50% 50%; } | |
| 50% { background-position: 100% 100%; } | |
| 100% { background-position: 50% 50%; } | |
| } | |
| /* Chatbot styling */ | |
| .chatbot-container .message { | |
| border-radius: 12px ; | |
| padding: 12px 16px ; | |
| } | |
| /* Chatbot placeholder — big comic style */ | |
| #reframe-chat .placeholder, | |
| #reframe-chat .placeholder *, | |
| .placeholder, [data-testid="chatbot"] .placeholder, .chatbot .placeholder { | |
| font-size: 2.2rem ; | |
| font-family: 'Comic Sans MS', 'Chalkboard SE', 'Comic Neue', cursive ; | |
| color: #a78bfa ; | |
| opacity: 1 ; | |
| font-weight: 700 ; | |
| text-align: center ; | |
| padding: 40px ; | |
| background: transparent ; | |
| border: none ; | |
| } | |
| [data-testid="chatbot"] .placeholder span, | |
| [data-testid="chatbot"] .placeholder *, | |
| #reframe-chat .placeholder span { | |
| font-size: inherit ; | |
| font-family: inherit ; | |
| color: inherit ; | |
| background: transparent ; | |
| } | |
| /* Card panel */ | |
| .card-panel { | |
| background: var(--bg-secondary); | |
| border-radius: 16px; | |
| border: 1px solid var(--border); | |
| padding: 20px; | |
| min-height: 400px; | |
| } | |
| /* Thought card */ | |
| .thought-card { | |
| background: var(--bg-card); | |
| border: 1px solid var(--border); | |
| border-radius: 12px; | |
| padding: 16px; | |
| transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1); | |
| } | |
| .thought-card.card-complete { | |
| border-color: rgba(34, 197, 94, 0.5); | |
| box-shadow: 0 0 20px var(--success-glow); | |
| } | |
| .card-header { | |
| font-size: 0.85rem; | |
| color: var(--text-secondary); | |
| margin-bottom: 12px; | |
| font-weight: 600; | |
| letter-spacing: 0.5px; | |
| } | |
| .card-section { | |
| margin-bottom: 12px; | |
| opacity: 0; | |
| transform: translateY(-8px); | |
| transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1); | |
| } | |
| .card-section.active { | |
| opacity: 1; | |
| transform: translateY(0); | |
| } | |
| .card-section-label { | |
| font-size: 0.7rem; | |
| font-weight: 700; | |
| color: var(--text-muted); | |
| letter-spacing: 1px; | |
| text-transform: uppercase; | |
| margin-bottom: 4px; | |
| } | |
| .card-section-content { | |
| font-size: 0.9rem; | |
| color: var(--text-primary); | |
| line-height: 1.4; | |
| } | |
| .card-section-content.reframe { | |
| color: var(--success); | |
| font-style: italic; | |
| } | |
| .card-evidence { | |
| list-style: none; | |
| padding: 0; | |
| margin: 0; | |
| } | |
| .card-evidence li { | |
| font-size: 0.85rem; | |
| color: var(--text-primary); | |
| padding: 4px 0; | |
| padding-left: 12px; | |
| border-left: 2px solid var(--border); | |
| margin-bottom: 4px; | |
| } | |
| /* Distortion tags */ | |
| .card-tags { | |
| display: flex; | |
| flex-wrap: wrap; | |
| gap: 6px; | |
| } | |
| .distortion-tag { | |
| display: inline-block; | |
| background: var(--accent-glow); | |
| border: 1px solid rgba(139, 92, 246, 0.4); | |
| border-radius: 20px; | |
| padding: 4px 12px; | |
| font-size: 0.75rem; | |
| color: #a78bfa; | |
| font-weight: 500; | |
| animation: pop-in 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55); | |
| } | |
| @keyframes pop-in { | |
| 0% { transform: scale(0); opacity: 0; } | |
| 100% { transform: scale(1); opacity: 1; } | |
| } | |
| /* Placeholder */ | |
| .thought-card-placeholder { | |
| display: flex; | |
| flex-direction: column; | |
| align-items: center; | |
| justify-content: center; | |
| min-height: 200px; | |
| color: var(--text-muted); | |
| text-align: center; | |
| padding: 40px 20px; | |
| } | |
| .placeholder-icon { | |
| font-size: 2.5rem; | |
| margin-bottom: 12px; | |
| opacity: 0.5; | |
| } | |
| .placeholder-text { | |
| font-size: 0.85rem; | |
| line-height: 1.5; | |
| max-width: 280px; | |
| } | |
| /* Card deck */ | |
| .deck-container { | |
| margin-top: 16px; | |
| } | |
| .deck-header { | |
| font-size: 0.85rem; | |
| color: var(--text-secondary); | |
| font-weight: 600; | |
| margin-bottom: 10px; | |
| } | |
| .deck-scroll { | |
| display: flex; | |
| gap: 10px; | |
| overflow-x: auto; | |
| padding-bottom: 8px; | |
| } | |
| .deck-card { | |
| flex-shrink: 0; | |
| width: 140px; | |
| background: var(--bg-card); | |
| border: 1px solid var(--border); | |
| border-radius: 10px; | |
| padding: 10px; | |
| font-size: 0.75rem; | |
| transition: transform 0.2s; | |
| } | |
| .deck-card:hover { | |
| transform: translateY(-2px); | |
| } | |
| .deck-card-tag { | |
| color: #a78bfa; | |
| font-weight: 600; | |
| font-size: 0.7rem; | |
| margin-bottom: 4px; | |
| } | |
| .deck-card-date { | |
| color: var(--text-muted); | |
| font-size: 0.65rem; | |
| margin-bottom: 6px; | |
| } | |
| .deck-card-thought { | |
| color: var(--text-secondary); | |
| font-size: 0.7rem; | |
| margin-bottom: 4px; | |
| } | |
| .deck-card-reframe { | |
| color: var(--success); | |
| font-size: 0.7rem; | |
| font-style: italic; | |
| } | |
| /* Crisis banner */ | |
| .crisis-banner { | |
| background: rgba(139, 92, 246, 0.1); | |
| border: 1px solid rgba(139, 92, 246, 0.3); | |
| border-radius: 12px; | |
| padding: 16px; | |
| margin-top: 12px; | |
| } | |
| .crisis-header { | |
| font-weight: 600; | |
| color: #a78bfa; | |
| margin-bottom: 8px; | |
| } | |
| .helpline { | |
| font-size: 0.85rem; | |
| color: var(--text-primary); | |
| margin: 4px 0; | |
| } | |
| .crisis-footer { | |
| font-size: 0.8rem; | |
| color: var(--text-secondary); | |
| margin-top: 10px; | |
| font-style: italic; | |
| } | |
| /* Patterns panel */ | |
| .patterns-panel { | |
| background: var(--bg-card); | |
| border-radius: 12px; | |
| padding: 16px; | |
| border: 1px solid var(--border); | |
| } | |
| .patterns-panel h3 { | |
| font-size: 0.9rem; | |
| color: var(--text-primary); | |
| margin-bottom: 12px; | |
| } | |
| .pattern-row { | |
| display: flex; | |
| align-items: center; | |
| gap: 8px; | |
| margin-bottom: 8px; | |
| } | |
| .pattern-name { | |
| font-size: 0.75rem; | |
| color: var(--text-secondary); | |
| width: 120px; | |
| flex-shrink: 0; | |
| } | |
| .pattern-bar-bg { | |
| flex: 1; | |
| height: 6px; | |
| background: var(--border); | |
| border-radius: 3px; | |
| overflow: hidden; | |
| } | |
| .pattern-bar { | |
| height: 100%; | |
| background: linear-gradient(90deg, #8b5cf6, #a78bfa); | |
| border-radius: 3px; | |
| transition: width 0.5s ease; | |
| } | |
| .pattern-count { | |
| font-size: 0.7rem; | |
| color: var(--text-muted); | |
| width: 30px; | |
| text-align: right; | |
| } | |
| .patterns-insight { | |
| margin-top: 12px; | |
| font-size: 0.8rem; | |
| color: var(--text-primary); | |
| line-height: 1.4; | |
| padding: 10px; | |
| background: rgba(139, 92, 246, 0.05); | |
| border-radius: 8px; | |
| } | |
| .patterns-meta { | |
| margin-top: 8px; | |
| font-size: 0.7rem; | |
| color: var(--text-muted); | |
| } | |
| .deck-empty, .patterns-empty { | |
| color: var(--text-muted); | |
| font-size: 0.85rem; | |
| text-align: center; | |
| padding: 20px; | |
| } | |
| /* Title */ | |
| .app-title { | |
| font-size: 1.4rem; | |
| font-weight: 700; | |
| color: var(--text-primary); | |
| letter-spacing: -0.5px; | |
| } | |
| .app-subtitle { | |
| font-size: 1rem; | |
| color: #a78bfa; | |
| margin-top: 2px; | |
| font-family: 'Comic Sans MS', 'Chalkboard SE', 'Comic Neue', cursive; | |
| font-weight: 600; | |
| } | |
| /* === Force dark on all Gradio internals === */ | |
| /* Override Gradio body/root */ | |
| body, .dark { | |
| background: var(--bg-primary) ; | |
| } | |
| /* Chatbot wrapper and messages */ | |
| .chatbot, [data-testid="chatbot"] { | |
| background: var(--bg-secondary) ; | |
| border: 1px solid var(--border) ; | |
| border-radius: 12px ; | |
| } | |
| /* Force all text inside chatbot to be light */ | |
| [data-testid="chatbot"] * { | |
| color: var(--text-primary) ; | |
| } | |
| [data-testid="chatbot"] .message-bubble-border { | |
| background: var(--bg-card) ; | |
| border-color: var(--border) ; | |
| } | |
| [data-testid="chatbot"] .user .message-bubble-border { | |
| background: rgba(139, 92, 246, 0.12) ; | |
| border-color: rgba(139, 92, 246, 0.25) ; | |
| } | |
| .message-row .message { | |
| background: var(--bg-card) ; | |
| color: var(--text-primary) ; | |
| border: 1px solid var(--border) ; | |
| } | |
| .message-row.user-row .message { | |
| background: rgba(139, 92, 246, 0.12) ; | |
| border-color: rgba(139, 92, 246, 0.25) ; | |
| } | |
| /* Bot/assistant bubble */ | |
| .bot .message-content, .assistant .message-content, | |
| .bot p, .assistant p, .message p, .message span { | |
| color: var(--text-primary) ; | |
| } | |
| .user .message-content, .user p, .user span { | |
| color: var(--text-primary) ; | |
| } | |
| /* Textbox / input */ | |
| textarea, input[type="text"], .textbox { | |
| background: var(--bg-secondary) ; | |
| color: var(--text-primary) ; | |
| border: 1px solid var(--border) ; | |
| border-radius: 8px ; | |
| } | |
| textarea::placeholder, input::placeholder { | |
| color: var(--text-muted) ; | |
| } | |
| /* All panels, columns, blocks */ | |
| .block, .panel, .form, .wrap { | |
| background: transparent ; | |
| border-color: var(--border) ; | |
| } | |
| /* Buttons */ | |
| button.primary { | |
| background: var(--accent) ; | |
| color: white ; | |
| border: none ; | |
| } | |
| button.secondary, button[variant="secondary"] { | |
| background: var(--bg-card) ; | |
| color: var(--text-primary) ; | |
| border: 1px solid var(--border) ; | |
| } | |
| button.secondary:hover { | |
| background: var(--bg-secondary) ; | |
| } | |
| /* Tabs */ | |
| .tabs, .tabitem { | |
| background: transparent ; | |
| } | |
| .tab-nav button, | |
| .tabs button[role="tab"], | |
| button[role="tab"] { | |
| color: var(--text-primary) ; | |
| opacity: 0.7 ; /* visible but muted when not selected */ | |
| background: transparent ; | |
| border: none ; | |
| font-weight: 600 ; | |
| } | |
| .tab-nav button:hover, | |
| button[role="tab"]:hover { | |
| opacity: 1 ; | |
| } | |
| .tab-nav button.selected, | |
| .tabs button[role="tab"].selected, | |
| button[role="tab"][aria-selected="true"] { | |
| color: var(--accent) ; | |
| opacity: 1 ; | |
| border-bottom: 2px solid var(--accent) ; | |
| } | |
| /* HTML component containers — force light text everywhere */ | |
| .html-container { | |
| background: transparent ; | |
| color: var(--text-primary) ; | |
| } | |
| .html-container * { | |
| color: inherit ; | |
| } | |
| .html-container .thought-card-placeholder, | |
| .html-container .placeholder-text, | |
| .html-container .deck-empty, | |
| .html-container .deck-empty p, | |
| .html-container .patterns-empty { | |
| color: var(--text-muted) ; | |
| } | |
| .html-container .thought-card, | |
| .html-container .card-section-content, | |
| .html-container .card-evidence li, | |
| .html-container .deck-card-thought, | |
| .html-container .patterns-panel h3 { | |
| color: var(--text-primary) ; | |
| } | |
| .html-container .card-section-label, | |
| .html-container .card-header, | |
| .html-container .deck-header { | |
| color: var(--text-secondary) ; | |
| } | |
| .html-container .card-section-content.reframe, | |
| .html-container .deck-card-reframe { | |
| color: var(--success) ; | |
| } | |
| .html-container .distortion-tag { | |
| color: #a78bfa ; | |
| } | |
| /* Row/column backgrounds */ | |
| .row, .column { | |
| background: transparent ; | |
| } | |
| /* Scrollbar styling */ | |
| ::-webkit-scrollbar { | |
| width: 6px; | |
| height: 6px; | |
| } | |
| ::-webkit-scrollbar-track { | |
| background: var(--bg-primary); | |
| } | |
| ::-webkit-scrollbar-thumb { | |
| background: var(--text-muted); | |
| border-radius: 3px; | |
| } | |
| ::-webkit-scrollbar-thumb:hover { | |
| background: var(--text-secondary); | |
| } | |
| /* Submit button inside textbox */ | |
| .submit-btn, button[title="Submit"] { | |
| color: var(--accent) ; | |
| background: transparent ; | |
| } | |
| /* === Header + model status badges === */ | |
| .app-header { | |
| padding: 12px 0; | |
| } | |
| .app-subtitle-row { | |
| display: flex; | |
| justify-content: space-between; | |
| align-items: center; | |
| gap: 16px; | |
| flex-wrap: wrap; | |
| } | |
| .model-badges { | |
| display: flex; | |
| flex-direction: row; | |
| flex-wrap: wrap; | |
| gap: 8px; | |
| align-items: center; | |
| margin-left: auto; /* right-align the pills on the subtitle line */ | |
| } | |
| .model-badge { | |
| display: inline-flex; | |
| align-items: center; | |
| gap: 6px; | |
| font-size: 0.72rem; | |
| font-weight: 600; | |
| padding: 4px 11px; | |
| border-radius: 20px; | |
| background: var(--bg-card); | |
| border: 1px solid var(--border); | |
| color: var(--text-secondary); | |
| white-space: nowrap; | |
| } | |
| .model-badge .badge-dot { | |
| width: 7px; | |
| height: 7px; | |
| border-radius: 50%; | |
| background: var(--success); | |
| box-shadow: 0 0 6px rgba(34, 197, 94, 0.6); | |
| } | |
| /* Cohere badge — emphasized with accent color + glow */ | |
| .model-badge.badge-cohere { | |
| color: #c4b5fd; | |
| background: var(--accent-glow); | |
| border-color: rgba(139, 92, 246, 0.5); | |
| box-shadow: 0 0 10px rgba(139, 92, 246, 0.15); | |
| } | |
| /* Modal training-platform badge — green tint */ | |
| .model-badge.badge-modal { | |
| color: #86efac; | |
| background: rgba(34, 197, 94, 0.08); | |
| border-color: rgba(34, 197, 94, 0.4); | |
| } | |
| /* === Tighter chat spacing (reduce whitespace between bubbles) === */ | |
| #reframe-chat .message-wrap, | |
| #reframe-chat .message-wrap > div { | |
| gap: 6px ; | |
| } | |
| #reframe-chat .message-row { | |
| margin: 2px 0 ; | |
| padding: 0 ; | |
| position: relative ; /* anchor for copy button */ | |
| } | |
| #reframe-chat .message { | |
| padding: 0 ; | |
| margin: 0 ; | |
| border: none ; /* drop inner border -> no double-box */ | |
| } | |
| /* Real Gradio 6.18 classes — collapse the tall bubble height */ | |
| #reframe-chat .message-content { | |
| min-height: 0 ; /* removes var(--size-8) tall box */ | |
| padding: 7px 13px ; | |
| align-items: flex-start ; | |
| } | |
| #reframe-chat .bubble { | |
| margin: 4px 8px ; /* was calc(spacing-xl * 2) */ | |
| } | |
| #reframe-chat .bubble-wrap { | |
| padding-top: 8px ; | |
| } | |
| #reframe-chat .message-row:first-child { | |
| padding-top: 8px ; | |
| } | |
| #reframe-chat .message p { | |
| margin: 0 ; | |
| line-height: 1.4 ; | |
| } | |
| /* User messages in the playful comic font */ | |
| #reframe-chat .user .message, | |
| #reframe-chat .message-row.user-row .message, | |
| #reframe-chat .user .message p, | |
| #reframe-chat .message-row.user-row .message p { | |
| font-family: 'Comic Sans MS', 'Chalkboard SE', 'Comic Neue', cursive ; | |
| } | |
| /* === Move copy icon to top-right of each message === */ | |
| #reframe-chat .message-buttons, | |
| #reframe-chat .message-row .icon-buttons, | |
| #reframe-chat [class*="message-buttons"], | |
| #reframe-chat button[aria-label="Copy"], | |
| #reframe-chat button[title="Copy"] { | |
| position: absolute ; | |
| top: 4px ; | |
| right: 6px ; | |
| bottom: auto ; | |
| left: auto ; | |
| margin: 0 ; | |
| z-index: 5 ; | |
| } | |
| /* Cap chat height to the viewport on short screens (keeps input + mic visible) */ | |
| #reframe-chat { | |
| max-height: 46vh ; | |
| } | |
| /* Compact the microphone recorder so Record/Stop stays on-screen (no scroll) */ | |
| [data-testid="audio"] { | |
| min-height: unset ; | |
| } | |
| [data-testid="audio"] .wrap, | |
| [data-testid="audio"] .empty, | |
| [data-testid="audio"] .controls, | |
| [data-testid="audio"] .waveform-container { | |
| min-height: unset ; | |
| } | |
| [data-testid="audio"] .waveform-container { | |
| max-height: 72px ; | |
| } | |
| /* Slim the audio label row */ | |
| [data-testid="audio"] .label-wrap, | |
| [data-testid="audio"] label { | |
| padding: 2px 0 ; | |
| } | |
| /* === Stack / models showcase card === */ | |
| .stack-card { font-size: 0.78rem; line-height: 1.4; } | |
| .stack-summary { | |
| background: var(--accent-glow); | |
| border: 1px solid rgba(139, 92, 246, 0.3); | |
| border-radius: 10px; | |
| padding: 10px 12px; | |
| margin-bottom: 14px; | |
| line-height: 1.5; | |
| font-size: 0.8rem; | |
| } | |
| .stack-section { margin-bottom: 12px; } | |
| .stack-label { | |
| font-size: 0.7rem; | |
| font-weight: 700; | |
| letter-spacing: 0.5px; | |
| text-transform: uppercase; | |
| margin-bottom: 5px; | |
| } | |
| .stack-item { padding: 2px 0; } | |
| .stack-note { | |
| font-size: 0.7rem; | |
| font-style: italic; | |
| margin-top: 6px; | |
| padding-top: 8px; | |
| border-top: 1px solid var(--border); | |
| } | |
| /* Colors — override `.html-container * { color: inherit !important }` above */ | |
| .stack-line { padding: 3px 0; font-size: 0.76rem; line-height: 1.4; } | |
| .stack-sub { font-size: 0.7rem; margin-top: 2px; line-height: 1.45; } | |
| .stack-list { margin: 4px 0 0; padding-left: 18px; } | |
| .stack-list li { font-size: 0.72rem; padding: 1px 0; } | |
| .html-container .stack-line { color: var(--text-secondary) ; } | |
| .html-container .stack-line b { color: var(--text-primary) ; } | |
| .html-container .stack-sub { color: var(--text-muted) ; } | |
| .html-container .stack-list li { color: var(--text-muted) ; } | |
| .html-container .stack-list a { color: #a78bfa ; text-decoration: none; } | |
| .html-container .stack-list a:hover { text-decoration: underline; } | |
| .html-container .stack-summary { color: var(--text-primary) ; } | |
| .html-container .stack-summary b { color: #c4b5fd ; } | |
| .html-container .stack-label { color: var(--text-muted) ; } | |
| .html-container .stack-item { color: var(--text-primary) ; } | |
| .html-container .stack-item b { color: var(--text-secondary) ; } | |
| .html-container .stack-muted { color: var(--text-muted) ; } | |
| .html-container .stack-note { color: var(--text-muted) ; } | |
| /* App credit (top center) */ | |
| .app-credit { | |
| text-align: center; | |
| color: var(--text-muted) ; | |
| font-size: 0.75rem; | |
| padding: 4px 0 8px; | |
| opacity: 0.85; | |
| } | |
| /* Hide Gradio footer and settings */ | |
| footer { | |
| display: none ; | |
| } | |
| .settings-modal, .settings-button, [aria-label="Settings"] { | |
| display: none ; | |
| } | |