Files
openclaw/ui/src/styles/config.css
Val Alexander f76a3c5225 feat(ui): dashboard-v2 views refactor (slice 3/3 of dashboard-v2) (#41503)
* feat(ui): add chat infrastructure modules (slice 1 of dashboard-v2)

New self-contained chat modules extracted from dashboard-v2-structure:

- chat/slash-commands.ts: slash command definitions and completions
- chat/slash-command-executor.ts: execute slash commands via gateway RPC
- chat/slash-command-executor.node.test.ts: test coverage
- chat/speech.ts: speech-to-text (STT) support
- chat/input-history.ts: per-session input history navigation
- chat/pinned-messages.ts: pinned message management
- chat/deleted-messages.ts: deleted message tracking
- chat/export.ts: shared exportChatMarkdown helper
- chat-export.ts: re-export shim for backwards compat

Gateway fix:
- Restore usage/cost stripping in chat.history sanitization
- Add test coverage for sanitization behavior

These modules are additive and tree-shaken — no existing code
imports them yet. They will be wired in subsequent slices.

* feat(ui): add utilities, theming, and i18n updates (slice 2 of dashboard-v2)

UI utilities and theming improvements extracted from dashboard-v2-structure:

Icons & formatting:
- icons.ts: expanded icon set for new dashboard views
- format.ts: date/number formatting helpers
- tool-labels.ts: human-readable tool name mappings

Theming:
- theme.ts: enhanced theme resolution and system theme support
- theme-transition.ts: simplified transition logic
- storage.ts: theme parsing improvements for settings persistence

Navigation & types:
- navigation.ts: extended tab definitions for dashboard-v2
- app-view-state.ts: expanded view state management
- types.ts: new type definitions (HealthSummary, ModelCatalogEntry, etc.)

Components:
- components/dashboard-header.ts: reusable header component

i18n:
- Updated en, pt-BR, zh-CN, zh-TW locales with new dashboard strings

All changes are additive or backwards-compatible. Build passes.
Part of #36853.

* feat(ui): dashboard-v2 views refactor (slice 3 of dashboard-v2)

Complete views refactor from dashboard-v2-structure, building on
slice 1 (chat infra, #41497) and slice 2 (utilities/theming, #41500).

Core app wiring:
- app.ts: updated host component with new state properties
- app-render.ts: refactored render pipeline for new dashboard layout
- app-render.helpers.ts: extracted render helpers
- app-settings.ts: theme listener lifecycle fix, cron runs on tab load
- app-gateway.ts: refactored chat event handling
- app-chat.ts: slash command integration

New views:
- views/command-palette.ts: command palette (Cmd+K)
- views/login-gate.ts: authentication gate
- views/bottom-tabs.ts: mobile tab navigation
- views/overview-*.ts: modular overview dashboard (cards, attention,
  event log, hints, log tail, quick actions)
- views/agents-panels-overview.ts: agent overview panel

Refactored views:
- views/chat.ts: major refactor with STT, slash commands, search,
  export, pinned messages, input history
- views/config.ts: restructured config management
- views/agents.ts: streamlined agent management
- views/overview.ts: modular composition from sub-views
- views/sessions.ts: enhanced session management

Controllers:
- controllers/health.ts: new health check controller
- controllers/models.ts: new model catalog controller
- controllers/agents.ts: tools catalog improvements
- controllers/config.ts: config form enhancements

Tests & infrastructure:
- Updated test helpers, browser tests, node tests
- vite.config.ts: build configuration updates
- markdown.ts: rendering improvements

Build passes  | 44 files | +6,626/-1,499
Part of #36853. Depends on #41497 and #41500.

* UI: fix chat review follow-ups

* fix(ui): repair chat clear and attachment regressions

* fix(ui): address remaining chat review comments

* fix(ui): address review follow-ups

* fix(ui): replay queued local slash commands

* fix(ui): repair control-ui type drift

* fix(ui): restore control UI styling

* feat(ui): enhance layout and styling for config and topbar components

- Updated grid layout for the config layout to allow full-width usage.
- Introduced new styles for top tabs and search components to improve usability.
- Added theme mode toggle styling for better visual integration.
- Implemented tests for layout and theme mode components to ensure proper rendering and functionality.

* feat(ui): add config file opening functionality and enhance styles

- Implemented a new handler to open the configuration file using the default application based on the operating system.
- Updated various CSS styles across components for improved visual consistency and usability, including adjustments to padding, margins, and font sizes.
- Introduced new styles for the data table and sidebar components to enhance layout and interaction.
- Added tests for the collapsed navigation rail to ensure proper functionality in different states.

* refactor(ui): update CSS styles for improved layout and consistency

- Simplified font-body declaration in base.css for cleaner code.
- Adjusted transition properties in components.css for better readability.
- Added new .workspace-link class in components.css for enhanced link styling.
- Changed config layout from grid to flex in config.css for better responsiveness.
- Updated related tests to reflect layout changes in config-layout.browser.test.ts.

* feat(ui): enhance theme handling and loading states in chat interface

- Updated CSS to support new theme mode attributes for better styling consistency across light and dark themes.
- Introduced loading skeletons in the chat view to improve user experience during data fetching.
- Refactored command palette to manage focus more effectively, enhancing accessibility.
- Added tests for the appearance theme picker and loading states to ensure proper rendering and functionality.

* refactor(ui): streamline ephemeral state management in chat and config views

- Introduced interfaces for ephemeral state in chat and config views to encapsulate related variables.
- Refactored state management to utilize a single object for better organization and maintainability.
- Removed legacy state variables and updated related functions to reference the new state structure.
- Enhanced readability and consistency across the codebase by standardizing state handling.

* chore: remove test files to reduce PR scope

* fix(ui): resolve type errors in debug props and chat search

* refactor(ui): remove stream mode functionality across various components

- Eliminated stream mode related translations and CSS styles to streamline the user interface.
- Updated multiple components to remove references to stream mode, enhancing code clarity and maintainability.
- Adjusted rendering logic in views to ensure consistent behavior without stream mode.
- Improved overall readability by cleaning up unused variables and props.

* fix(ui): add msg-meta CSS and fix rebase type errors

* fix(ui): add CSS for chat footer action buttons (TTS, delete) and msg-meta

* feat(ui): add delete confirmation with remember-decision checkbox

* fix(ui): delete confirmation with remember, attention icon sizing

* fix(ui): open delete confirm popover to the left (not clipped)

* fix(ui): show all nav items in collapsed sidebar, remove gap

* fix(ui): address P1/P2 review feedback — session queue clear, kill scope, palette guard, stop button

* fix(ui): address Greptile re-review — kill scope, queue flush, idle handling, parallel fetch

- SECURITY: /kill <target> now enforces session tree scope (not just /kill all)
- /kill reports idle sessions gracefully instead of throwing
- Queue continues draining after local slash commands
- /model fetches sessions.list + models.list in parallel (perf fix)

* fix(ui): style update banner close button — SVG stroke + sizing

* fix(ui): update layout styles for sidebar and content spacing

* UI: restore colon slash command parsing

* UI: restore slash command session queries

* Refactor thinking resolution: Introduce resolveThinkingDefaultForModel function and update model-selection to utilize it. Add tests for new functionality in thinking.test.ts.

* fix(ui): constrain welcome state logo size, add missing CSS for new session view

---------

Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
2026-03-12 12:46:19 -05:00

1708 lines
32 KiB
CSS

/* ===========================================
Config Page
=========================================== */
/* Layout Container */
.config-layout {
display: grid;
grid-template-columns: minmax(0, 1fr);
gap: 0;
height: calc(100vh - 160px);
margin: 0 -16px -32px;
border-radius: var(--radius-xl);
border: 1px solid var(--border);
background: var(--panel);
overflow: hidden;
overflow: clip;
animation: config-enter 0.3s var(--ease-out);
}
@keyframes config-enter {
from {
opacity: 0;
transform: translateY(6px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
/* Mobile: adjust margins to match mobile .content padding (4px 4px 16px) */
@media (max-width: 600px) {
.config-layout {
margin: 0;
/* safest: no negative margin cancellation on mobile */
}
}
/* Small mobile: even smaller padding */
@media (max-width: 400px) {
.config-layout {
margin: 0;
}
}
/* Search */
.config-search {
display: grid;
gap: 5px;
padding: 10px 12px 8px;
border-bottom: 1px solid var(--border);
}
.config-search__input-row {
position: relative;
}
.config-search__icon {
position: absolute;
left: 14px;
top: 50%;
transform: translateY(-50%);
width: 16px;
height: 16px;
color: var(--muted);
pointer-events: none;
}
.config-search__input {
width: 100%;
padding: 8px 34px 8px 38px;
border: 1px solid var(--border);
border-radius: var(--radius-md);
background: var(--bg-elevated);
font-size: 12.5px;
outline: none;
transition:
border-color var(--duration-fast) ease,
box-shadow var(--duration-fast) ease,
background var(--duration-fast) ease;
}
.config-search__input::placeholder {
color: var(--muted);
}
.config-search__input:focus {
border-color: var(--accent);
box-shadow: var(--focus-ring);
background: var(--bg-hover);
}
:root[data-theme-mode="light"] .config-search__input {
background: white;
}
:root[data-theme-mode="light"] .config-search__input:focus {
background: white;
}
.config-search__clear {
position: absolute;
right: 8px;
top: 50%;
transform: translateY(-50%);
width: 22px;
height: 22px;
border: none;
border-radius: var(--radius-full);
background: var(--bg-hover);
color: var(--muted);
font-size: 14px;
line-height: 1;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
transition:
background var(--duration-fast) ease,
color var(--duration-fast) ease;
}
.config-search__clear:hover {
background: var(--border-strong);
color: var(--text);
}
/* Mode Toggle */
.config-mode-toggle {
display: flex;
padding: 3px;
background: var(--bg-elevated);
border-radius: var(--radius-md);
border: 1px solid var(--border);
gap: 1px;
}
:root[data-theme-mode="light"] .config-mode-toggle {
background: white;
}
.config-mode-toggle__btn {
flex: 1;
padding: 6px 12px;
border: none;
border-radius: calc(var(--radius-md) - 3px);
background: transparent;
color: var(--muted);
font-size: 11px;
font-weight: 600;
cursor: pointer;
transition:
background var(--duration-fast) ease,
color var(--duration-fast) ease,
box-shadow var(--duration-fast) ease;
}
.config-mode-toggle__btn:hover:not(.active) {
color: var(--text);
background: var(--bg-hover);
}
.config-mode-toggle__btn.active {
background: var(--accent);
color: white;
box-shadow: 0 1px 3px rgba(255, 92, 92, 0.2);
}
/* ===========================================
Main Content
=========================================== */
.config-main {
display: flex;
flex-direction: column;
min-height: 0;
min-width: 0;
background: var(--panel);
overflow: hidden;
/* fallback for older browsers */
overflow: clip;
}
/* Actions Bar */
.config-actions {
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
padding: 10px 20px;
background: var(--bg-accent);
border-bottom: 1px solid var(--border);
flex-shrink: 0;
position: relative;
z-index: 2;
}
:root[data-theme-mode="light"] .config-actions {
background: var(--bg-hover);
}
.config-actions__left,
.config-actions__right {
display: flex;
align-items: center;
gap: 8px;
}
.config-changes-badge {
padding: 4px 10px;
border-radius: var(--radius-full);
background: var(--accent-subtle);
border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
color: var(--accent);
font-size: 11px;
font-weight: 600;
animation: badge-enter 0.2s var(--ease-out);
}
@keyframes badge-enter {
from {
opacity: 0;
transform: scale(0.9);
}
to {
opacity: 1;
transform: scale(1);
}
}
.config-status {
font-size: 12.5px;
color: var(--muted);
}
.config-top-tabs {
display: flex;
align-items: center;
gap: 10px;
padding: 10px 20px;
background: var(--bg-accent);
border-bottom: 1px solid var(--border);
flex-shrink: 0;
}
:root[data-theme-mode="light"] .config-top-tabs {
background: var(--bg-hover);
}
.config-search--top {
padding: 0;
border-bottom: none;
min-width: 200px;
max-width: 320px;
flex: 0 1 320px;
}
.config-top-tabs__scroller {
display: flex;
align-items: center;
gap: 6px;
min-width: 0;
flex: 1 1 auto;
flex-wrap: wrap;
}
.config-top-tabs__tab {
flex: 0 0 auto;
border: 1px solid var(--border);
border-radius: var(--radius-full);
padding: 5px 12px;
background: var(--bg-elevated);
color: var(--muted);
font-size: 11.5px;
font-weight: 600;
white-space: nowrap;
cursor: pointer;
transition:
border-color var(--duration-fast) ease,
background var(--duration-fast) ease,
color var(--duration-fast) ease,
box-shadow var(--duration-fast) ease;
}
:root[data-theme-mode="light"] .config-top-tabs__tab {
background: white;
}
.config-top-tabs__tab:hover {
color: var(--text);
border-color: var(--border-strong);
background: var(--bg-hover);
}
.config-top-tabs__tab.active {
color: var(--accent);
border-color: color-mix(in srgb, var(--accent) 30%, transparent);
background: var(--accent-subtle);
}
.config-top-tabs__right {
display: flex;
justify-content: flex-end;
flex-shrink: 0;
min-width: 0;
}
/* Diff Panel */
.config-diff {
margin: 12px 20px 0;
border: 1px solid color-mix(in srgb, var(--accent) 20%, transparent);
border-radius: var(--radius-lg);
background: var(--accent-subtle);
overflow: hidden;
animation: badge-enter 0.2s var(--ease-out);
}
.config-diff__summary {
display: flex;
align-items: center;
justify-content: space-between;
padding: 10px 16px;
cursor: pointer;
font-size: 12px;
font-weight: 600;
color: var(--accent);
list-style: none;
}
.config-diff__summary::-webkit-details-marker {
display: none;
}
.config-diff__chevron {
width: 16px;
height: 16px;
transition: transform var(--duration-normal) var(--ease-out);
}
.config-diff__chevron svg {
width: 100%;
height: 100%;
}
.config-diff[open] .config-diff__chevron {
transform: rotate(180deg);
}
.config-diff__content {
padding: 0 16px 16px;
display: grid;
gap: 8px;
}
.config-diff__item {
display: flex;
align-items: baseline;
gap: 12px;
padding: 8px 12px;
border-radius: var(--radius-md);
background: var(--bg-elevated);
font-size: 11.5px;
font-family: var(--mono);
}
:root[data-theme-mode="light"] .config-diff__item {
background: white;
}
.config-diff__path {
font-weight: 600;
color: var(--text);
flex-shrink: 0;
}
.config-diff__values {
display: flex;
align-items: baseline;
gap: 10px;
min-width: 0;
flex-wrap: wrap;
}
.config-diff__from {
color: var(--danger);
opacity: 0.85;
}
.config-diff__arrow {
color: var(--muted);
}
.config-diff__to {
color: var(--ok);
}
/* Section Hero */
.config-section-hero {
display: flex;
align-items: center;
gap: 14px;
padding: 16px 22px;
border-bottom: 1px solid var(--border);
background: var(--bg-accent);
}
:root[data-theme-mode="light"] .config-section-hero {
background: var(--bg-hover);
}
.config-section-hero__icon {
width: 28px;
height: 28px;
color: var(--accent);
display: flex;
align-items: center;
justify-content: center;
border-radius: var(--radius-md);
background: var(--accent-subtle);
padding: 5px;
flex-shrink: 0;
}
.config-section-hero__icon svg {
width: 100%;
height: 100%;
stroke: currentColor;
fill: none;
}
.config-section-hero__text {
display: grid;
gap: 2px;
min-width: 0;
}
.config-section-hero__title {
font-size: 15px;
font-weight: 650;
letter-spacing: -0.02em;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.config-section-hero__desc {
font-size: 12px;
color: var(--muted);
line-height: 1.4;
}
/* Content Area */
.config-content {
flex: 1;
overflow-y: auto;
padding: 20px 22px;
min-width: 0;
scroll-behavior: smooth;
}
/* ===========================================
Appearance Section
=========================================== */
.settings-appearance {
display: grid;
gap: 18px;
}
.settings-appearance__section {
border: 1px solid var(--border);
border-radius: var(--radius-lg);
background: var(--bg-elevated);
padding: 18px;
display: grid;
gap: 14px;
}
.settings-appearance__heading {
margin: 0;
font-size: 15px;
font-weight: 650;
letter-spacing: -0.02em;
color: var(--text-strong);
}
.settings-appearance__hint {
margin: -8px 0 0;
font-size: 12.5px;
color: var(--muted);
line-height: 1.45;
}
.settings-theme-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
gap: 12px;
}
.settings-theme-card {
position: relative;
display: grid;
grid-template-columns: auto 1fr auto;
align-items: center;
gap: 10px;
min-height: 64px;
padding: 14px 16px;
border: 1px solid var(--border);
border-radius: var(--radius-lg);
background: var(--bg);
color: var(--text);
text-align: left;
cursor: pointer;
transition:
border-color var(--duration-fast) ease,
background var(--duration-fast) ease,
box-shadow var(--duration-fast) ease,
transform var(--duration-fast) ease;
}
.settings-theme-card:hover {
border-color: var(--border-strong);
background: var(--bg-hover);
transform: translateY(-1px);
}
.settings-theme-card--active {
border-color: color-mix(in srgb, var(--accent) 35%, transparent);
background: color-mix(in srgb, var(--accent) 10%, var(--bg-elevated));
box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 14%, transparent);
}
.settings-theme-card__icon,
.settings-theme-card__check {
display: inline-flex;
align-items: center;
justify-content: center;
width: 18px;
height: 18px;
color: var(--accent);
}
.settings-theme-card__icon svg,
.settings-theme-card__check svg {
width: 18px;
height: 18px;
stroke: currentColor;
fill: none;
}
.settings-theme-card__label {
font-size: 13px;
font-weight: 600;
color: var(--text-strong);
}
.settings-info-grid {
display: grid;
gap: 10px;
}
.settings-info-row {
display: flex;
align-items: center;
justify-content: space-between;
gap: 16px;
padding: 12px 14px;
border: 1px solid var(--border);
border-radius: var(--radius-md);
background: var(--bg);
}
.settings-info-row__label {
font-size: 12px;
font-weight: 600;
color: var(--muted);
text-transform: uppercase;
letter-spacing: 0.04em;
}
.settings-info-row__value {
display: inline-flex;
align-items: center;
gap: 8px;
min-width: 0;
font-size: 13px;
font-weight: 500;
color: var(--text);
text-align: right;
}
.settings-status-dot {
width: 8px;
height: 8px;
border-radius: var(--radius-full);
background: var(--muted);
box-shadow: 0 0 0 4px color-mix(in srgb, var(--muted) 14%, transparent);
}
.settings-status-dot--ok {
background: var(--ok);
box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 14%, transparent);
}
.config-raw-field textarea {
min-height: 500px;
font-family: var(--mono);
font-size: 13px;
line-height: 1.55;
}
/* Loading State */
.config-loading {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 14px;
padding: 80px 24px;
color: var(--muted);
animation: fade-in 0.2s var(--ease-out);
}
.config-loading__spinner {
width: 32px;
height: 32px;
border: 2.5px solid var(--border);
border-top-color: var(--accent);
border-radius: var(--radius-full);
animation: spin 0.7s linear infinite;
}
@keyframes spin {
to {
transform: rotate(360deg);
}
}
/* Empty State */
.config-empty {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 16px;
padding: 80px 24px;
text-align: center;
animation: fade-in 0.3s var(--ease-out);
}
.config-empty__icon {
font-size: 48px;
opacity: 0.25;
}
.config-empty__text {
color: var(--muted);
font-size: 14px;
max-width: 320px;
line-height: 1.5;
}
/* ===========================================
Section Cards
=========================================== */
.config-form--modern {
display: grid;
gap: 14px;
width: 100%;
min-width: 0;
}
.config-section-card {
width: 100%;
border: 1px solid var(--border);
border-radius: var(--radius-lg);
background: var(--bg-elevated);
overflow: hidden;
transition:
border-color var(--duration-normal) ease,
box-shadow var(--duration-normal) ease;
animation: section-card-enter 0.25s var(--ease-out) backwards;
}
@keyframes section-card-enter {
from {
opacity: 0;
transform: translateY(4px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
.config-section-card:hover {
border-color: var(--border-strong);
box-shadow: var(--shadow-sm);
}
:root[data-theme-mode="light"] .config-section-card {
background: white;
}
:root[data-theme-mode="light"] .config-section-card:hover {
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}
.config-section-card__header {
display: flex;
align-items: center;
gap: 14px;
padding: 18px 20px;
background: var(--bg-accent);
border-bottom: 1px solid var(--border);
}
:root[data-theme-mode="light"] .config-section-card__header {
background: var(--bg-hover);
}
.config-section-card__icon {
width: 30px;
height: 30px;
color: var(--accent);
flex-shrink: 0;
display: flex;
align-items: center;
justify-content: center;
border-radius: var(--radius-md);
background: var(--accent-subtle);
padding: 6px;
}
.config-section-card__icon svg {
width: 100%;
height: 100%;
}
.config-section-card__titles {
flex: 1;
min-width: 0;
}
.config-section-card__title {
margin: 0;
font-size: 14px;
font-weight: 650;
letter-spacing: -0.015em;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.config-section-card__desc {
margin: 3px 0 0;
font-size: 12px;
color: var(--muted);
line-height: 1.45;
}
.config-section-card__content {
padding: 16px 18px;
min-width: 0;
}
/* Staggered entrance for sequential cards */
.config-form--modern .config-section-card:nth-child(1) {
animation-delay: 0ms;
}
.config-form--modern .config-section-card:nth-child(2) {
animation-delay: 40ms;
}
.config-form--modern .config-section-card:nth-child(3) {
animation-delay: 80ms;
}
.config-form--modern .config-section-card:nth-child(4) {
animation-delay: 120ms;
}
.config-form--modern .config-section-card:nth-child(5) {
animation-delay: 160ms;
}
.config-form--modern .config-section-card:nth-child(n + 6) {
animation-delay: 200ms;
}
/* ===========================================
Form Fields
=========================================== */
.cfg-fields {
display: grid;
gap: 14px;
}
.cfg-fields--inline {
gap: 10px;
}
.cfg-field {
display: grid;
gap: 6px;
}
.cfg-field--error {
padding: 14px;
border-radius: var(--radius-md);
background: var(--danger-subtle);
border: 1px solid rgba(239, 68, 68, 0.3);
}
.cfg-field__label {
font-size: 12.5px;
font-weight: 600;
color: var(--text);
letter-spacing: -0.005em;
}
.cfg-field__help {
font-size: 11.5px;
color: var(--muted);
line-height: 1.45;
}
.cfg-tags {
display: flex;
flex-wrap: wrap;
gap: 6px;
}
.cfg-tag {
display: inline-flex;
align-items: center;
border: 1px solid var(--border);
border-radius: var(--radius-full);
padding: 2px 8px;
font-size: 11px;
color: var(--muted);
background: var(--bg-elevated);
white-space: nowrap;
}
:root[data-theme-mode="light"] .cfg-tag {
background: white;
}
.cfg-field__error {
font-size: 12px;
color: var(--danger);
}
/* Text Input */
.cfg-input-wrap {
display: flex;
gap: 10px;
}
.cfg-input {
flex: 1;
padding: 8px 12px;
border: 1px solid var(--border);
border-radius: var(--radius-md);
background: var(--bg-accent);
font-size: 13px;
outline: none;
transition:
border-color var(--duration-fast) ease,
box-shadow var(--duration-fast) ease,
background var(--duration-fast) ease;
}
.cfg-input::placeholder {
color: var(--muted);
opacity: 0.6;
}
.cfg-input:hover:not(:focus) {
border-color: var(--border-strong);
}
.cfg-input:focus {
border-color: var(--accent);
box-shadow: var(--focus-ring);
background: var(--bg-hover);
}
:root[data-theme-mode="light"] .cfg-input {
background: white;
border-color: var(--border);
}
:root[data-theme-mode="light"] .cfg-input:hover:not(:focus) {
border-color: var(--border-strong);
}
:root[data-theme-mode="light"] .cfg-input:focus {
background: white;
}
.cfg-input--sm {
padding: 6px 10px;
font-size: 12px;
}
.cfg-input__reset {
padding: 9px 12px;
border: 1px solid var(--border);
border-radius: var(--radius-md);
background: var(--bg-elevated);
color: var(--muted);
font-size: 13px;
cursor: pointer;
transition:
background var(--duration-fast) ease,
color var(--duration-fast) ease;
}
.cfg-input__reset:hover:not(:disabled) {
background: var(--bg-hover);
color: var(--text);
}
.cfg-input__reset:disabled {
opacity: 0.5;
cursor: not-allowed;
}
/* Textarea */
.cfg-textarea {
width: 100%;
padding: 10px 14px;
border: 1px solid var(--border);
border-radius: var(--radius-md);
background: var(--bg-accent);
font-family: var(--mono);
font-size: 13px;
line-height: 1.55;
resize: vertical;
outline: none;
transition:
border-color var(--duration-fast) ease,
box-shadow var(--duration-fast) ease;
}
.cfg-textarea:hover:not(:focus) {
border-color: var(--border-strong);
}
.cfg-textarea:focus {
border-color: var(--accent);
box-shadow: var(--focus-ring);
}
:root[data-theme-mode="light"] .cfg-textarea {
background: white;
border-color: var(--border);
}
.cfg-textarea--sm {
padding: 8px 12px;
font-size: 12px;
}
/* Number Input */
.cfg-number {
display: inline-flex;
border: 1px solid var(--border);
border-radius: var(--radius-md);
overflow: hidden;
background: var(--bg-accent);
transition: border-color var(--duration-fast) ease;
}
.cfg-number:hover {
border-color: var(--border-strong);
}
:root[data-theme-mode="light"] .cfg-number {
background: white;
}
.cfg-number__btn {
width: 38px;
border: none;
background: var(--bg-elevated);
color: var(--text);
font-size: 16px;
font-weight: 300;
cursor: pointer;
transition: background var(--duration-fast) ease;
}
.cfg-number__btn:hover:not(:disabled) {
background: var(--bg-hover);
}
.cfg-number__btn:disabled {
opacity: 0.4;
cursor: not-allowed;
}
:root[data-theme-mode="light"] .cfg-number__btn {
background: var(--bg-hover);
}
:root[data-theme-mode="light"] .cfg-number__btn:hover:not(:disabled) {
background: var(--border);
}
.cfg-number__input {
width: 72px;
padding: 9px;
border: none;
border-left: 1px solid var(--border);
border-right: 1px solid var(--border);
background: transparent;
font-size: 13px;
text-align: center;
outline: none;
appearance: textfield;
-moz-appearance: textfield;
}
.cfg-number__input::-webkit-outer-spin-button,
.cfg-number__input::-webkit-inner-spin-button {
-webkit-appearance: none;
margin: 0;
}
/* Select */
.cfg-select {
padding: 8px 36px 8px 12px;
border: 1px solid var(--border);
border-radius: var(--radius-md);
background-color: var(--bg-accent);
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
background-repeat: no-repeat;
background-position: right 10px center;
font-size: 13px;
cursor: pointer;
outline: none;
appearance: none;
transition:
border-color var(--duration-fast) ease,
box-shadow var(--duration-fast) ease;
}
.cfg-select:hover:not(:focus) {
border-color: var(--border-strong);
}
.cfg-select:focus {
border-color: var(--accent);
box-shadow: var(--focus-ring);
}
:root[data-theme-mode="light"] .cfg-select {
background-color: white;
border-color: var(--border);
}
/* Segmented Control */
.cfg-segmented {
display: inline-flex;
padding: 3px;
border: 1px solid var(--border);
border-radius: var(--radius-md);
background: var(--bg-accent);
gap: 1px;
}
:root[data-theme-mode="light"] .cfg-segmented {
background: var(--bg-hover);
}
.cfg-segmented__btn {
padding: 6px 14px;
border: none;
border-radius: calc(var(--radius-md) - 3px);
background: transparent;
color: var(--muted);
font-size: 12px;
font-weight: 500;
cursor: pointer;
transition:
background var(--duration-fast) ease,
color var(--duration-fast) ease,
box-shadow var(--duration-fast) ease;
}
.cfg-segmented__btn:hover:not(:disabled):not(.active) {
color: var(--text);
background: var(--bg-hover);
}
.cfg-segmented__btn.active {
background: var(--accent);
color: white;
box-shadow: 0 1px 3px rgba(255, 92, 92, 0.2);
}
.cfg-segmented__btn:disabled {
opacity: 0.5;
cursor: not-allowed;
}
/* Toggle Row */
.cfg-toggle-row {
display: flex;
align-items: center;
justify-content: space-between;
gap: 14px;
padding: 12px 14px;
border: 1px solid var(--border);
border-radius: var(--radius-md);
background: var(--bg-accent);
cursor: pointer;
transition:
background var(--duration-fast) ease,
border-color var(--duration-fast) ease;
}
.cfg-toggle-row:hover:not(.disabled) {
background: var(--bg-hover);
border-color: var(--border-strong);
}
.cfg-toggle-row.disabled {
opacity: 0.55;
cursor: not-allowed;
}
:root[data-theme-mode="light"] .cfg-toggle-row {
background: white;
}
:root[data-theme-mode="light"] .cfg-toggle-row:hover:not(.disabled) {
background: var(--bg-hover);
}
.cfg-toggle-row__content {
flex: 1;
min-width: 0;
}
.cfg-toggle-row__label {
display: block;
font-size: 12.5px;
font-weight: 500;
color: var(--text);
}
.cfg-toggle-row__help {
display: block;
margin-top: 2px;
font-size: 11px;
color: var(--muted);
line-height: 1.45;
}
/* Toggle Switch */
.cfg-toggle {
position: relative;
flex-shrink: 0;
}
.cfg-toggle input {
position: absolute;
opacity: 0;
width: 0;
height: 0;
}
.cfg-toggle__track {
display: block;
width: 40px;
height: 22px;
background: var(--bg-elevated);
border: 1px solid var(--border-strong);
border-radius: var(--radius-full);
position: relative;
transition:
background var(--duration-normal) var(--ease-out),
border-color var(--duration-normal) var(--ease-out);
}
:root[data-theme-mode="light"] .cfg-toggle__track {
background: var(--border);
}
.cfg-toggle__track::after {
content: "";
position: absolute;
top: 2px;
left: 2px;
width: 16px;
height: 16px;
background: var(--text);
border-radius: var(--radius-full);
box-shadow: var(--shadow-sm);
transition:
transform var(--duration-normal) var(--ease-spring),
background var(--duration-normal) ease;
}
.cfg-toggle input:checked + .cfg-toggle__track {
background: var(--ok-subtle);
border-color: rgba(34, 197, 94, 0.4);
}
.cfg-toggle input:checked + .cfg-toggle__track::after {
transform: translateX(18px);
background: var(--ok);
}
.cfg-toggle input:focus + .cfg-toggle__track {
box-shadow: var(--focus-ring);
}
/* Object (collapsible) */
.cfg-object {
border: 1px solid var(--border);
border-radius: var(--radius-md);
background: transparent;
overflow: hidden;
transition: border-color var(--duration-fast) ease;
}
.cfg-object:hover {
border-color: var(--border-strong);
}
:root[data-theme-mode="light"] .cfg-object {
background: transparent;
}
.cfg-object__header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 10px 12px;
cursor: pointer;
list-style: none;
transition: background var(--duration-fast) ease;
border-radius: calc(var(--radius-md) - 1px);
}
.cfg-object__header:hover {
background: var(--bg-hover);
}
.cfg-object__header::-webkit-details-marker {
display: none;
}
.cfg-object__title {
font-size: 13px;
font-weight: 600;
color: var(--text);
}
.cfg-object__title-wrap {
display: grid;
gap: 6px;
min-width: 0;
}
.cfg-object__chevron {
width: 18px;
height: 18px;
color: var(--muted);
transition: transform var(--duration-normal) var(--ease-out);
}
.cfg-object__chevron svg {
width: 100%;
height: 100%;
}
.cfg-object[open] .cfg-object__chevron {
transform: rotate(180deg);
}
.cfg-object__help {
padding: 0 12px 10px;
font-size: 12px;
color: var(--muted);
}
.cfg-object__content {
padding: 12px;
display: grid;
gap: 12px;
border-top: 1px solid var(--border);
}
/* Array */
.cfg-array {
border: 1px solid var(--border);
border-radius: var(--radius-lg);
overflow: hidden;
}
.cfg-array__header {
display: flex;
align-items: center;
gap: 14px;
padding: 10px 12px;
background: var(--bg-accent);
border-bottom: 1px solid var(--border);
}
:root[data-theme-mode="light"] .cfg-array__header {
background: var(--bg-hover);
}
.cfg-array__label {
font-size: 14px;
font-weight: 600;
color: var(--text);
}
.cfg-array__title {
flex: 1;
min-width: 0;
display: grid;
gap: 6px;
}
.cfg-array__count {
font-size: 12px;
color: var(--muted);
padding: 4px 10px;
background: var(--bg-elevated);
border-radius: var(--radius-full);
}
:root[data-theme-mode="light"] .cfg-array__count {
background: white;
}
.cfg-array__add {
display: inline-flex;
align-items: center;
gap: 6px;
padding: 7px 14px;
border: 1px solid var(--border);
border-radius: var(--radius-md);
background: var(--bg-elevated);
color: var(--text);
font-size: 12px;
font-weight: 500;
cursor: pointer;
transition: background var(--duration-fast) ease;
}
.cfg-array__add:hover:not(:disabled) {
background: var(--bg-hover);
}
.cfg-array__add:disabled {
opacity: 0.5;
cursor: not-allowed;
}
.cfg-array__add-icon {
width: 14px;
height: 14px;
}
.cfg-array__add-icon svg {
width: 100%;
height: 100%;
}
.cfg-array__help {
padding: 10px 12px;
font-size: 12px;
color: var(--muted);
border-bottom: 1px solid var(--border);
}
.cfg-array__empty {
padding: 36px 18px;
text-align: center;
color: var(--muted);
font-size: 13px;
}
.cfg-array__items {
display: grid;
gap: 1px;
background: var(--border);
}
.cfg-array__item {
background: var(--panel);
}
.cfg-array__item-header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 10px 12px;
background: var(--bg-accent);
border-bottom: 1px solid var(--border);
}
:root[data-theme-mode="light"] .cfg-array__item-header {
background: var(--bg-hover);
}
.cfg-array__item-index {
font-size: 11px;
font-weight: 600;
color: var(--muted);
text-transform: uppercase;
letter-spacing: 0.05em;
}
.cfg-array__item-remove {
width: 30px;
height: 30px;
display: flex;
align-items: center;
justify-content: center;
border: none;
border-radius: var(--radius-md);
background: transparent;
color: var(--muted);
cursor: pointer;
transition:
background var(--duration-fast) ease,
color var(--duration-fast) ease;
}
.cfg-array__item-remove svg {
width: 16px;
height: 16px;
}
.cfg-array__item-remove:hover:not(:disabled) {
background: var(--danger-subtle);
color: var(--danger);
}
.cfg-array__item-remove:disabled {
opacity: 0.4;
cursor: not-allowed;
}
.cfg-array__item-content {
padding: 12px;
}
/* Map (custom entries) */
.cfg-map {
border: 1px solid var(--border);
border-radius: var(--radius-lg);
overflow: hidden;
}
.cfg-map__header {
display: flex;
align-items: center;
justify-content: space-between;
gap: 14px;
padding: 10px 12px;
background: var(--bg-accent);
border-bottom: 1px solid var(--border);
}
:root[data-theme-mode="light"] .cfg-map__header {
background: var(--bg-hover);
}
.cfg-map__label {
font-size: 13px;
font-weight: 600;
color: var(--muted);
}
.cfg-map__add {
display: inline-flex;
align-items: center;
gap: 6px;
padding: 7px 14px;
border: 1px solid var(--border);
border-radius: var(--radius-md);
background: var(--bg-elevated);
color: var(--text);
font-size: 12px;
font-weight: 500;
cursor: pointer;
transition: background var(--duration-fast) ease;
}
.cfg-map__add:hover:not(:disabled) {
background: var(--bg-hover);
}
.cfg-map__add-icon {
width: 14px;
height: 14px;
}
.cfg-map__add-icon svg {
width: 100%;
height: 100%;
}
.cfg-map__empty {
padding: 28px 18px;
text-align: center;
color: var(--muted);
font-size: 13px;
}
.cfg-map__items {
display: grid;
gap: 8px;
padding: 10px 12px 12px;
}
.cfg-map__item {
display: grid;
gap: 8px;
padding: 10px;
border: 1px solid var(--border);
border-radius: var(--radius-md);
background: var(--bg-accent);
}
:root[data-theme-mode="light"] .cfg-map__item {
background: white;
}
.cfg-map__item-header {
display: grid;
grid-template-columns: minmax(0, 300px) auto;
gap: 8px;
align-items: center;
}
.cfg-map__item-key {
min-width: 0;
}
.cfg-map__item-value {
min-width: 0;
}
.cfg-map__item-value > .cfg-fields {
gap: 10px;
}
.cfg-map__item-remove {
width: 32px;
height: 32px;
display: flex;
align-items: center;
justify-content: center;
border: none;
border-radius: var(--radius-md);
background: transparent;
color: var(--muted);
cursor: pointer;
transition:
background var(--duration-fast) ease,
color var(--duration-fast) ease;
}
.cfg-map__item-remove svg {
width: 16px;
height: 16px;
}
.cfg-map__item-remove:hover:not(:disabled) {
background: var(--danger-subtle);
color: var(--danger);
}
/* Pill variants */
.pill--sm {
padding: 5px 12px;
font-size: 11px;
}
.pill--ok {
border-color: rgba(34, 197, 94, 0.35);
color: var(--ok);
}
.pill--danger {
border-color: rgba(239, 68, 68, 0.35);
color: var(--danger);
}
/* ===========================================
Mobile Responsiveness
=========================================== */
@media (max-width: 768px) {
.config-actions {
flex-wrap: wrap;
padding: 14px 16px;
}
.config-actions__left,
.config-actions__right {
width: 100%;
justify-content: center;
}
.config-top-tabs {
flex-wrap: wrap;
padding: 12px 16px;
}
.config-search--top {
flex: 1 1 100%;
max-width: none;
}
.config-top-tabs__scroller {
flex: 1 1 100%;
}
.config-top-tabs__right {
flex: 1 1 100%;
}
.config-top-tabs__right .config-mode-toggle {
width: 100%;
}
.config-top-tabs__right .config-mode-toggle__btn {
flex: 1 1 50%;
}
.config-section-hero {
padding: 14px 16px;
}
.config-content {
padding: 16px;
}
.settings-theme-grid {
grid-template-columns: 1fr;
}
.settings-info-row {
align-items: flex-start;
flex-direction: column;
}
.settings-info-row__value {
text-align: left;
}
.config-section-card__header {
padding: 14px 16px;
}
.config-section-card__content {
padding: 14px 16px;
}
.cfg-toggle-row {
padding: 12px 14px;
}
.cfg-map__item {
grid-template-columns: 1fr;
gap: 10px;
}
.cfg-map__item-header {
grid-template-columns: 1fr auto;
}
.cfg-map__item-remove {
justify-self: end;
}
}
@media (max-width: 480px) {
.config-section-card__icon {
width: 30px;
height: 30px;
}
.config-section-card__title {
font-size: 16px;
}
.cfg-segmented {
flex-wrap: wrap;
}
.cfg-segmented__btn {
flex: 1 0 auto;
min-width: 70px;
}
}