jshph_obsidian-enzyme/styles.css
2026-05-13 17:55:01 -04:00

790 lines
18 KiB
CSS

/* ── Digest chat styles ───────────────────────────────────────────
*
* Uses Obsidian CSS variables for theme-aware light/dark mode.
* Layout: flex column with fixed header, scrollable messages, fixed input.
* ────────────────────────────────────────────────────────────────── */
/* ── Container ──────────────────────────────────────────────────── */
.digest-container {
display: flex;
flex-direction: column;
height: 100%;
overflow: hidden;
font-family: var(--font-text);
}
/* ── Header ─────────────────────────────────────────────────────── */
.digest-header {
flex-shrink: 0;
padding: 8px 12px;
border-bottom: 1px solid var(--background-modifier-border);
}
.digest-title-row {
display: flex;
align-items: center;
justify-content: space-between;
}
.digest-title {
font-weight: 600;
font-size: 14px;
color: var(--text-normal);
}
.digest-actions {
display: flex;
gap: 4px;
}
.digest-action-btn {
color: var(--text-muted);
cursor: pointer;
border-radius: var(--radius-s);
padding: 4px;
}
.digest-action-btn:hover {
color: var(--text-normal);
background: var(--background-modifier-hover);
}
.digest-voice-active {
color: var(--text-on-accent);
background: var(--interactive-accent);
}
.digest-voice-active:hover {
color: var(--text-on-accent);
background: var(--interactive-accent-hover);
}
/* ── Messages Area ──────────────────────────────────────────────── */
.digest-messages {
flex: 1;
overflow-y: auto;
padding: 12px;
display: flex;
flex-direction: column;
gap: 8px;
user-select: text;
-webkit-user-select: text;
}
/* ── Message Bubbles ────────────────────────────────────────────── */
.digest-message {
display: flex;
max-width: 100%;
}
.digest-message-content {
padding: 8px 12px;
border-radius: var(--radius-m);
font-size: 13px;
line-height: 1.5;
word-wrap: break-word;
overflow-wrap: break-word;
user-select: text;
-webkit-user-select: text;
}
.digest-message-content *,
.digest-tool-body * {
user-select: text;
-webkit-user-select: text;
}
/* User messages: right-aligned with accent tint */
.digest-user {
justify-content: flex-end;
}
.digest-user .digest-message-content {
background: var(--interactive-accent);
color: var(--text-on-accent);
max-width: 85%;
border-bottom-right-radius: 4px;
}
/* Assistant messages: left-aligned, full width */
.digest-assistant {
justify-content: flex-start;
}
.digest-assistant .digest-message-content {
background: var(--background-secondary);
color: var(--text-normal);
max-width: 100%;
width: 100%;
border-bottom-left-radius: 4px;
}
/* Markdown content inside assistant messages */
.digest-assistant .digest-message-content p {
margin: 0 0 8px;
}
.digest-assistant .digest-message-content p:last-child {
margin-bottom: 0;
}
.digest-assistant .digest-message-content ul,
.digest-assistant .digest-message-content ol {
margin: 4px 0;
padding-left: 20px;
}
.digest-assistant .digest-message-content code {
background: var(--background-primary);
padding: 1px 4px;
border-radius: 3px;
font-size: 12px;
font-family: var(--font-monospace);
}
.digest-assistant .digest-message-content pre {
background: var(--background-primary);
padding: 8px 10px;
border-radius: var(--radius-s);
overflow-x: auto;
margin: 8px 0;
}
.digest-assistant .digest-message-content pre code {
background: none;
padding: 0;
}
.digest-assistant .digest-message-content blockquote {
border-left: 3px solid var(--interactive-accent);
margin: 8px 0;
padding: 4px 12px;
color: var(--text-muted);
}
.digest-assistant .digest-message-content h1,
.digest-assistant .digest-message-content h2,
.digest-assistant .digest-message-content h3 {
margin: 12px 0 4px;
font-size: 14px;
font-weight: 600;
}
.digest-voice-sources .digest-message-content {
font-size: 12px;
color: var(--text-muted);
background: var(--background-primary);
border: 1px solid var(--background-modifier-border);
}
.digest-voice-sources .digest-message-content p {
margin: 0 0 4px;
font-weight: 600;
color: var(--text-normal);
}
.digest-voice-sources .digest-message-content ul {
margin: 0;
}
/* Streaming state: monospace for consistent character flow */
.digest-streaming {
white-space: pre-wrap;
font-family: var(--font-text);
}
/* System messages: centered, muted */
.digest-system {
justify-content: center;
}
.digest-system .digest-message-content {
background: none;
color: var(--text-faint);
font-size: 12px;
font-style: italic;
text-align: center;
max-width: 90%;
}
/* Error messages */
.digest-error {
justify-content: center;
}
.digest-error .digest-message-content {
background: rgba(var(--color-red-rgb, 220, 38, 38), 0.1);
color: var(--text-error, #dc2626);
font-size: 12px;
max-width: 90%;
border: 1px solid rgba(var(--color-red-rgb, 220, 38, 38), 0.2);
}
/* ── Tool Call Sections ─────────────────────────────────────────── */
.digest-tool-call {
margin: 4px 0;
border: 1px solid var(--background-modifier-border);
border-radius: var(--radius-s);
overflow: hidden;
}
.digest-tool-header {
display: flex;
align-items: center;
gap: 6px;
padding: 6px 10px;
font-size: 12px;
cursor: pointer;
background: var(--background-secondary);
transition: background 0.15s ease;
}
.digest-tool-header:hover {
background: var(--background-modifier-hover);
}
.digest-tool-status {
flex-shrink: 0;
display: flex;
align-items: center;
width: 14px;
height: 14px;
}
.digest-tool-status svg {
width: 14px;
height: 14px;
}
.digest-tool-success {
color: var(--color-green, #22c55e);
}
.digest-tool-error {
color: var(--text-error, #dc2626);
}
.digest-tool-name {
font-weight: 600;
color: var(--text-normal);
flex-shrink: 0;
}
.digest-tool-query {
color: var(--text-muted);
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
flex: 1;
min-width: 0;
}
.digest-tool-tokens {
color: var(--text-faint);
flex-shrink: 0;
font-size: 11px;
}
.digest-tool-body {
padding: 8px 10px;
font-size: 11px;
font-family: var(--font-monospace);
color: var(--text-muted);
background: var(--background-primary);
border-top: 1px solid var(--background-modifier-border);
white-space: pre-wrap;
word-break: break-word;
max-height: 200px;
overflow-y: auto;
user-select: text;
-webkit-user-select: text;
}
.digest-collapsed {
display: none;
}
/* Spinning loader for in-progress tool calls */
.digest-spinning {
color: var(--text-muted);
}
.digest-spinning svg {
animation: digest-spin 1s linear infinite;
}
@keyframes digest-spin {
from { transform: rotate(0deg); }
to { transform: rotate(360deg); }
}
/* ── Thinking Indicator ─────────────────────────────────────────── */
.digest-thinking {
display: flex;
align-items: center;
gap: 4px;
padding: 8px 12px;
}
.digest-dot {
width: 6px;
height: 6px;
border-radius: 50%;
background: var(--text-faint);
animation: digest-pulse 1.4s ease-in-out infinite;
}
.digest-dot:nth-child(2) {
animation-delay: 0.2s;
}
.digest-dot:nth-child(3) {
animation-delay: 0.4s;
}
@keyframes digest-pulse {
0%, 80%, 100% {
opacity: 0.3;
transform: scale(0.8);
}
40% {
opacity: 1;
transform: scale(1);
}
}
/* ── Input Area ─────────────────────────────────────────────────── */
.digest-input-area {
flex-shrink: 0;
padding: 8px 12px 12px;
border-top: 1px solid var(--background-modifier-border);
background: var(--background-primary);
position: relative;
}
.digest-status {
font-size: 11px;
color: var(--text-faint);
margin-bottom: 6px;
padding: 0 2px;
}
.digest-voice-bar {
display: flex;
align-items: center;
gap: 8px;
margin-bottom: 8px;
}
.digest-voice-mode {
flex: 1;
min-width: 0;
height: 32px;
display: flex;
align-items: center;
gap: 10px;
padding: 0 10px;
border: 1px solid var(--background-modifier-border);
border-radius: var(--radius-s);
background: var(--background-secondary);
color: var(--text-muted);
}
.digest-voice-waveform {
height: 18px;
display: flex;
align-items: center;
gap: 3px;
flex-shrink: 0;
}
.digest-voice-wave {
width: 3px;
height: 7px;
border-radius: 2px;
background: var(--color-blue, #3b82f6);
opacity: 0.7;
animation: digest-voice-wave 1.05s ease-in-out infinite;
}
.digest-voice-wave:nth-child(2) { animation-delay: 0.08s; }
.digest-voice-wave:nth-child(3) { animation-delay: 0.16s; }
.digest-voice-wave:nth-child(4) { animation-delay: 0.24s; }
.digest-voice-wave:nth-child(5) { animation-delay: 0.32s; }
.digest-voice-wave:nth-child(6) { animation-delay: 0.40s; }
.digest-voice-wave:nth-child(7) { animation-delay: 0.48s; }
.digest-voice-wave:nth-child(8) { animation-delay: 0.56s; }
.digest-voice-wave:nth-child(9) { animation-delay: 0.64s; }
.digest-voice-speaking .digest-voice-wave {
background: var(--color-orange, #f97316);
animation-duration: 0.72s;
}
.digest-voice-thinking .digest-voice-wave {
background: var(--color-yellow, #eab308);
animation-duration: 1.35s;
}
.digest-voice-muted .digest-voice-wave,
.digest-voice-connecting .digest-voice-wave {
background: var(--text-faint);
animation-play-state: paused;
transform: scaleY(0.65);
}
.digest-voice-label {
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
font-size: 12px;
font-weight: 500;
}
.digest-voice-speaking .digest-voice-label {
color: var(--color-orange, #f97316);
}
.digest-voice-listening .digest-voice-label {
color: var(--color-blue, #3b82f6);
}
.digest-voice-thinking .digest-voice-label {
color: var(--color-yellow, #eab308);
}
.digest-voice-mute-btn {
width: 32px;
height: 32px;
border-radius: var(--radius-s);
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
flex-shrink: 0;
color: var(--text-muted);
background: var(--background-secondary);
border: 1px solid var(--background-modifier-border);
transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.digest-voice-mute-btn:hover {
color: var(--text-normal);
background: var(--background-modifier-hover);
}
.digest-voice-mute-btn.digest-voice-muted {
color: var(--text-on-accent);
background: var(--color-orange, #f97316);
border-color: transparent;
}
.digest-settings-entities {
width: 100%;
font-family: var(--font-monospace);
font-size: 12px;
}
@keyframes digest-voice-wave {
0%, 100% { transform: scaleY(0.45); opacity: 0.55; }
50% { transform: scaleY(1.9); opacity: 1; }
}
.digest-input-row {
display: flex;
align-items: flex-end;
gap: 6px;
}
.digest-input {
flex: 1;
border: 1px solid var(--background-modifier-border);
border-radius: var(--radius-m);
padding: 8px 10px;
font-size: 13px;
font-family: var(--font-text);
background: var(--background-primary);
color: var(--text-normal);
min-height: 36px;
max-height: 150px;
line-height: 1.4;
outline: none;
overflow-y: auto;
white-space: pre-wrap;
word-wrap: break-word;
transition: border-color 0.15s ease;
}
.digest-input:focus {
border-color: var(--interactive-accent);
}
.digest-input-disabled {
opacity: 0.5;
pointer-events: none;
}
.digest-input:empty::before {
content: attr(data-placeholder);
color: var(--text-faint);
pointer-events: none;
}
.digest-btn-group {
display: flex;
flex-direction: column;
gap: 4px;
}
.digest-send-btn,
.digest-stop-btn {
width: 32px;
height: 32px;
border-radius: var(--radius-s);
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
transition: background 0.15s ease, color 0.15s ease;
flex-shrink: 0;
}
.digest-send-btn {
background: var(--interactive-accent);
color: var(--text-on-accent);
}
.digest-send-btn:hover {
background: var(--interactive-accent-hover);
}
.digest-stop-btn {
background: var(--background-modifier-hover);
color: var(--text-error, #dc2626);
}
.digest-stop-btn:hover {
background: rgba(var(--color-red-rgb, 220, 38, 38), 0.15);
}
/* ── Context Chips ─────────────────────────────────────────────── */
.digest-context-chips {
display: flex;
flex-wrap: wrap;
gap: 4px;
padding: 0 2px 6px;
}
.digest-context-chip {
display: inline-flex;
align-items: center;
gap: 4px;
padding: 2px 8px;
background: var(--background-secondary);
border: 1px solid var(--background-modifier-border);
border-radius: var(--radius-s);
font-size: 11px;
color: var(--text-muted);
}
.digest-context-chip-label {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
max-width: 200px;
}
.digest-context-chip-dismiss {
appearance: none;
border: 0;
background: transparent;
cursor: pointer;
color: var(--text-faint);
font-size: 14px;
line-height: 1;
padding: 0 2px;
}
.digest-context-chip-dismiss:hover {
color: var(--text-normal);
}
/* ── @ Mention Suggest Items ───────────────────────────────────── */
.digest-mention-folder {
color: var(--text-faint);
font-size: var(--font-smallest);
margin-right: 2px;
}
.digest-mention-name {
color: var(--text-normal);
}
.digest-mention-badge {
margin-left: auto;
padding: 1px 6px;
font-size: 10px;
color: var(--text-faint);
background: var(--background-modifier-hover);
border-radius: var(--radius-s);
}
/* ── Enzyme Settings Header ────────────────────────────────────── */
.digest-enzyme-header {
display: flex;
align-items: center;
gap: 6px;
}
.digest-enzyme-header h2 {
margin: 0;
}
.digest-enzyme-info {
display: inline-flex;
align-items: center;
justify-content: center;
width: 16px;
height: 16px;
border-radius: 50%;
background: var(--background-modifier-hover);
color: var(--text-muted);
font-size: 11px;
font-weight: 600;
cursor: help;
flex-shrink: 0;
}
.digest-enzyme-info:hover {
background: var(--interactive-accent);
color: var(--text-on-accent);
}
/* ── Settings Tab ──────────────────────────────────────────────── */
.digest-settings .setting-item {
padding-top: 14px;
padding-bottom: 14px;
}
.digest-settings .setting-item-heading {
padding-top: 24px;
padding-bottom: 8px;
border-top: 0;
}
.digest-settings .setting-item-heading .setting-item-name {
font-size: 1.15em;
font-weight: var(--font-semibold);
}
.digest-settings .setting-item-info {
max-width: 640px;
}
.digest-settings input[type='text'],
.digest-settings input[type='password'],
.digest-settings textarea,
.digest-settings select {
min-width: min(100%, 280px);
}
.digest-settings-subtle .setting-item-name,
.digest-settings-note .setting-item-name {
font-size: var(--font-ui-medium);
}
.digest-settings-note {
border-bottom-color: transparent;
}
.digest-settings-note .setting-item-name {
color: var(--text-muted);
}
/* ── Enzyme Init Banner ────────────────────────────────────────── */
.digest-enzyme-banner {
display: flex;
align-items: center;
justify-content: space-between;
gap: 8px;
padding: 8px 12px;
margin: 4px 0;
background: var(--background-secondary);
border: 1px solid var(--background-modifier-border);
border-radius: var(--radius-s);
font-size: 12px;
color: var(--text-muted);
}
.digest-enzyme-init-btn {
flex-shrink: 0;
padding: 4px 12px;
font-size: 12px;
border-radius: var(--radius-s);
background: var(--interactive-accent);
color: var(--text-on-accent);
border: none;
cursor: pointer;
}
.digest-enzyme-init-btn:hover {
background: var(--interactive-accent-hover);
}
.digest-enzyme-init-btn:disabled {
opacity: 0.6;
cursor: default;
}
/* ── Utility ────────────────────────────────────────────────────── */
.digest-hidden {
display: none;
}
/* ── Scrollbar Styling ──────────────────────────────────────────── */
.digest-messages::-webkit-scrollbar {
width: 6px;
}
.digest-messages::-webkit-scrollbar-track {
background: transparent;
}
.digest-messages::-webkit-scrollbar-thumb {
background: var(--background-modifier-border);
border-radius: 3px;
}
.digest-messages::-webkit-scrollbar-thumb:hover {
background: var(--text-faint);
}
/* ── Accessibility ──────────────────────────────────────────────── */
.digest-action-btn:focus-visible,
.digest-send-btn:focus-visible,
.digest-stop-btn:focus-visible {
outline: 2px solid var(--interactive-accent);
outline-offset: 2px;
}
.digest-input:focus-visible {
outline: none;
border-color: var(--interactive-accent);
box-shadow: 0 0 0 2px rgba(var(--interactive-accent-rgb, 124, 77, 255), 0.2);
}