.profile-initials {
    width: 28px;
    height: 28px;
    min-width: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #d95f95, #6b8cff);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 11px;
    user-select: none;
    -webkit-user-select: none;
    /* Safari, Chrome, Opera, iOS Safari */
    -moz-user-select: none;
    /* Firefox */
    -ms-user-select: none;
    /* Internet Explorer/Edge */
    overflow: hidden;
    position: relative;
}

.profile-initials.profile-initials--has-picture {
    background: transparent;
}

.profile-initials-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.profile-initials-fallback {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #d95f95, #6b8cff);
}

.nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 36px;
    padding: 0 16px;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    white-space: nowrap;
    color: var(--admin-text, var(--text-color, inherit));
    border: 1px solid var(--admin-border, var(--border-color, #ccc));
    border-radius: var(--admin-radius-sm, 8px);
    cursor: pointer;
}

.nav-btn svg {
    width: 16px;
    height: 16px;
}

.nav-btn svg[hidden] {
    display: none;
}

.nav-btn.is-loading svg.refresh-icon {
    animation: spin 1s linear infinite;
}

.nav-btn.loading {
    pointer-events: none;
}

.nav-btn.loading::before {
    content: "";
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid color-mix(in srgb, currentColor 35%, transparent);
    border-top-color: currentColor;
    display: inline-block;
    animation: spin 0.7s linear infinite;
    flex-shrink: 0;
}

.nav-btn.is-success {
    border-color: var(--admin-success, #22c55e);
    color: var(--admin-success, #22c55e);
}

.nav-btn.is-success svg.check-icon {
    color: var(--admin-success, #22c55e);
}

.nav-btn.danger-nofill {
    background: transparent;
    color: var(--admin-error, var(--error-color, #ef4444));
    border-color: var(--admin-error-border, var(--error-color, #ef4444));
}

@media (hover: hover) and (pointer: fine) {
    .nav-btn.danger-nofill:hover:not(:disabled) {
        background: var(--admin-error-bg, rgba(239, 68, 68, 0.08));
        border-color: var(--admin-error, var(--error-color, #ef4444));
        color: var(--admin-error, var(--error-color, #ef4444));
    }
}

.nav-btn.filter {
    height: auto;
    padding: 9px 14px;
    min-width: 140px;
    justify-content: flex-start;
}

.nav-btn.filter .filter-icon {
    width: 15px;
    height: 15px;
    color: var(--admin-text-secondary);
    flex-shrink: 0;
}

.nav-btn.filter .filter-label {
    flex: 1;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-btn.filter .chevron-icon {
    width: 14px;
    height: 14px;
    color: var(--admin-text-secondary);
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.nav-btn.filter[aria-expanded="true"] {
    border-color: var(--admin-accent, #3b82f6);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.nav-btn.filter[aria-expanded="true"] .chevron-icon {
    transform: rotate(180deg);
}

.nav-btn.filter.has-filter {
    border-color: var(--admin-accent, #3b82f6);
}

.nav-btn.filter.has-filter .filter-icon {
    color: var(--admin-accent, #3b82f6);
}

@media (hover: hover) and (pointer: fine) {
    .nav-btn:hover:not(:disabled) {
        background: var(--admin-hover);
        border-color: var(--admin-text, var(--text-color, inherit));
    }
}

.nav-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Danger button for delete */
.nav-btn.danger {
    color: white;
    background: var(--error-color, #dc3545);
    border-color: var(--error-color, #dc3545);
}

@media (hover: hover) and (pointer: fine) {
    .nav-btn.danger:hover {
        background: var(--error-hover-bg, #c82333);
        border-color: var(--error-hover-bg, #bd2130);
    }
}

/* Navigation Buttons */
.nav-btn.cancel {
    background: transparent;
    color: var(--text-color-secondary);
    border: 1px solid var(--border-color);
    text-decoration: none;
}
.nav-btn.cancel svg {
    width: 16px;
    height: 16px;
}

.nav-btn.submit {
    background: var(--primary-color);
    color: white;
}

.nav-btn:disabled,
.nav-btn.is-disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.nav-btn.hidden {
    visibility: hidden;
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
}
.nav-btn:not(.hidden) {
    visibility: visible;
}

@media (hover: hover) and (pointer: fine) {
    .nav-btn.submit:hover:not(:disabled) {background: var(--secondary-color);}
    .nav-btn.cancel:hover:not(:disabled) {border-color: var(--primary-color);
        color: var(--primary-color);}
    .nav-btn.danger:hover:not(:disabled) {background: var(--error-hover-bg);
        color: white;}
}

/* Password Requirements */
/* Change Password specific styles */
.password-requirements {
    margin-top: 8px;
}
.password-requirements .pw-item.ok .pw-icon {
    color: var(--success-color);
}
.password-requirements .pw-item.bad .pw-icon {
    color: var(--error-color);
}
.password-requirements .pw-item.muted .pw-icon {
    color: #6b7280;
}
.pw-text {
    margin-left: 8px;
}
.password-requirements .pw-text {
    font-size: 14px;
    color: var(--pw-text);
}

/* Toggle */
.toggle-switch {
    position: relative;
    display: inline-block;
    min-width: 44px;
    max-width: 44px;
    height: 24px;
    cursor: pointer;
}

.toggle-input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.toggle-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #e4e4e4;
    border-radius: 24px;
    transition: background-color 0.3s ease;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.toggle-slider::before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: #ffffff;
    border-radius: 50%;
    transform: translateX(0);
    transition: transform 0.3s cubic-bezier(0.76, 0, 0.24, 1), background-color 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.toggle-input:checked + .toggle-slider {
    background: #34C759;
}

.toggle-input:checked + .toggle-slider::before {
    transform: translateX(20px);
    background-color: #ffffff;
}

.form-checkbox {
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 6px;
    border: 1.5px solid var(--border-color);
    background-color: var(--input-bg, var(--background));
    display: inline-grid;
    place-content: center;
    flex-shrink: 0;
    margin: 0;
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
    background-position: center;
    background-repeat: no-repeat;
    background-size: 12px 12px;
}
.form-checkbox:not(:checked) {
    border-color: var(--text-color-secondary);
}
.form-checkbox:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--primary-light, rgba(58, 149, 233, 0.2));
    border-color: var(--primary-color);
}
.form-checkbox:checked {
    border-color: var(--primary-color);
    background-color: var(--primary-color);
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3.5 8.5L6.5 11.5L12.5 5.5' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.form-checkbox:disabled {
    cursor: not-allowed;
    opacity: 0.6;
    background-color: var(--background);
}

/* Input */
.input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-size: 16px;
    background: var(--background);
    color: var(--text-color);
    caret-color: var(--text-color);
    outline: none;
}

/* Input placeholder should adapt in dark mode */
.input::placeholder {
    color: var(--text-color-secondary);
    opacity: 1;
    /* ensure consistent contrast across browsers */;
}

/* Ensure consistent control heights across inputs and custom selects (exclude textarea) */
.input:not(.textarea) {
    height: 48px;
}

/* Normalize date input rendering so it matches custom select height */
.input[type="date"] {
    -webkit-appearance: none;
    appearance: none;
    padding-right: 40px;
    /* space for calendar icon */
    line-height: normal;
}
.input:focus {
    border-color: var(--primary-color);
}

/* Input for User Settings */
.input.us {
    font-size: 14px;
    width: 200px;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--background);
    color: var(--text-color);
    outline: none;
    transition: border-color 0.2s ease;
}

@media (hover: hover) and (pointer: fine) {
    .input.us:hover {
        border-color: var(--primary-color);
    }
}

.input.us:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0, 132, 255, 0.15);
}

/* Custom Select with custom dropdown */
.custom-select {
    position: relative;
    line-height: normal;
}

.select-trigger {
    width: 100%;
    padding: 14px 16px;
    padding-right: 40px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-size: 16px;
    background: var(--background);
    color: var(--text-color);
    cursor: pointer;
    text-align: left;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 48px;
    transition: border-color 0.2s ease;
}

.select-trigger.placeholder {
    color: var(--text-color-secondary);
    transition: none;
}

@media (hover: hover) and (pointer: fine) {
    .select-trigger:hover {
        border-color: var(--primary-color);
    }
}

.select-trigger:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--primary-color) 55%, transparent);
    outline-offset: 3px;
    border-color: var(--primary-color);
}

.select-trigger.active {
    border-color: var(--primary-color);
}

.select-trigger::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 16px;
    width: 16px;
    height: 16px;
    background-color: var(--text-color);
    mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http://www.w3.org/2000/svg%22%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%20aria-hidden%3D%22true%22%3E%3Cpath%20fill%3D%22%23000%22%20d%3D%22M12.1338%205.94433C12.3919%205.77382%2012.7434%205.80202%2012.9707%206.02929C13.1979%206.25656%2013.2261%206.60807%2013.0556%206.8662L12.9707%206.9707L8.47067%2011.4707C8.21097%2011.7304%207.78896%2011.7304%207.52926%2011.4707L3.02926%206.9707L2.9443%206.8662C2.77379%206.60807%202.80199%206.25656%203.02926%206.02929C3.25653%205.80202%203.60804%205.77382%203.86617%205.94433L3.97067%206.02929L7.99996%2010.0586L12.0293%206.02929L12.1338%205.94433Z%22/%3E%3C/svg%3E");
    mask-repeat: no-repeat;
    mask-position: center;
    mask-size: contain;
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http://www.w3.org/2000/svg%22%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%20aria-hidden%3D%22true%22%3E%3Cpath%20fill%3D%22%23000%22%20d%3D%22M12.1338%205.94433C12.3919%205.77382%2012.7434%205.80202%2012.9707%206.02929C13.1979%206.25656%2013.2261%206.60807%2013.0556%206.8662L12.9707%206.9707L8.47067%2011.4707C8.21097%2011.7304%207.78896%2011.7304%207.52926%2011.4707L3.02926%206.9707L2.9443%206.8662C2.77379%206.60807%202.80199%206.25656%203.02926%206.02929C3.25653%205.80202%203.60804%205.77382%203.86617%205.94433L3.97067%206.02929L7.99996%2010.0586L12.0293%206.02929L12.1338%205.94433Z%22/%3E%3C/svg%3E");
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;
    -webkit-mask-size: contain;
    transition: transform 0.3s ease;
    transform: translateY(-50%);
}

.select-trigger.active::after {
    transform: translateY(-50%) rotate(180deg);
}

.select-options {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--background);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow-color);
    max-height: 200px;
    overflow-y: scroll;
    z-index: 1000;
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
    transition: all 0.2s ease;
}

.select-options.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

/* Keyboard focus highlight for type-ahead match */
.select-option.keyboard-focus {
    background: var(--primary-light);
    outline: 2px solid var(--primary-color);
}

.select-option {
    padding: 12px 16px;
    color: var(--text-color);
    cursor: pointer;
    transition: background 0.2s ease;
}

@media (hover: hover) and (pointer: fine) {
    .select-option:hover {
        background: var(--primary-light);
    }
}

.select-option.selected {
    background: var(--primary-light);
    color: var(--primary-color);
    font-weight: 500;
}

/* Select for User Settings */
.custom-select.us {
    min-width: 200px;
    max-width: 200px;
    font-size: 14px;
}
.custom-select.us .select-trigger {
    font-size: 14px;
}

/* Color Theme Selector */
.color-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.color-option {
    aspect-ratio: 1;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--color-swatch, var(--primary-color));
    cursor: pointer;
    position: relative;
    border: 3px solid transparent;
    justify-self: start;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

@media (hover: hover) and (pointer: fine) {
    .color-option:hover {
        transform: scale(1.1);
    }
}

.color-option:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.color-option.selected {
    border-color: var(--text-color);
}

.color-option.selected::after {
    content: "✓";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 18px;
    font-weight: bold;
    text-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
}

/* Range Field */
.range-field {
    width: 200px;
    accent-color: var(--accent);
}

@media (hover: hover) and (pointer: fine) {
    ::-webkit-scrollbar-thumb:hover {
        background: var(--primary-color);
    }
}
/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-thumb {
    background: var(--inactive-color);
    border-radius: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 8px;
}
/* Firefox */
* {
    scrollbar-width: thin; 
    scrollbar-color: var(--inactive-color) transparent;
}

/* Select Dropdown */
.select-dropdown {
    --select-dropdown-closed-transform: translateY(-8px) scale(0.96);
    --select-dropdown-open-transform: translateY(0) scale(1);
    --select-dropdown-transform-origin: top right;
    position: absolute;
    top: 40px;
    right: 0;
    background-color: var(--background);
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 4px var(--shadow-color);
    border-radius: 16px;
    padding: 6px;
    flex-direction: column;
    width: max-content;
    height: auto;
    z-index: 10;
    display: flex;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: var(--select-dropdown-closed-transform);
    transform-origin: var(--select-dropdown-transform-origin);
    -webkit-user-select: none;
    /* Safari, Chrome, Opera, iOS Safari */
    -moz-user-select: none;
    /* Firefox */
    -ms-user-select: none;
    /* Internet Explorer/Edge */
    user-select: none;
    cursor: default;
    transition:
        opacity 0.16s ease,
        transform 0.18s cubic-bezier(0.2, 0.8, 0.2, 1),
        visibility 0s linear 0.18s;
    will-change: opacity, transform;
}
.select-dropdown.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: var(--select-dropdown-open-transform);
    transition:
        opacity 0.16s ease,
        transform 0.18s cubic-bezier(0.2, 0.8, 0.2, 1),
        visibility 0s linear 0s;
}

.select-dropdown.upward {
    --select-dropdown-closed-transform: translateY(8px) scale(0.96);
    --select-dropdown-transform-origin: bottom right;
}

#headerDotsButtonDropdown {
    --select-dropdown-closed-transform: translateY(-8px) scale(0.96);
    --select-dropdown-open-transform: translateY(0) scale(1);
    --select-dropdown-transform-origin: top right;
}

@media (prefers-reduced-motion: reduce) {
    .select-dropdown,
    .select-dropdown.open,
    #headerDotsButtonDropdown,
    #headerDotsButtonDropdown.open {
        transition: none;
        transform: none;
    }
}

.select-dropdown-item {
    position: relative;
}
.select-dropdown-item.has-submenu {
    position: relative;
}
.select-dropdown-button {
    display: flex;
    align-items: center;
    height: 36px;
    width: 100%;
    border-radius: 10px;
    gap: 8px;
    padding: 6px 10px;
    color: var(--text-color);
    white-space: nowrap;
    overflow: hidden;
}
.select-dropdown-button-red {
    color: var(--error-color);
}

.select-dropdown-button svg {
    height: var(--svg-size);
    width: var(--svg-size);
    color: var(--text-color);
}
.select-dropdown-button.select-dropdown-button-red svg {
    height: var(--svg-size);
    width: var(--svg-size);
    color: var(--error-color);
}
.select-dropdown-button p,
.select-dropdown-button span {
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.select-submenu {
    --select-submenu-placement-transform: translate(0, 0);
    --select-submenu-closed-transform: translateX(6px) scale(0.98);
    --select-submenu-open-transform: translateX(0) scale(1);
    --select-submenu-transform-origin: top right;
    position: absolute;
    top: 0;
    right: calc(100% + 8px);
    /* place to the left of parent */
    background-color: var(--background);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 6px;
    display: flex;
    flex-direction: column;
    min-width: 160px;
    z-index: 11;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform:
        var(--select-submenu-placement-transform)
        var(--select-submenu-closed-transform);
    transform-origin: var(--select-submenu-transform-origin);
    transition:
        opacity 0.16s ease,
        transform 0.18s cubic-bezier(0.2, 0.8, 0.2, 1),
        visibility 0s linear 0.18s;
    will-change: opacity, transform;
}

.has-submenu.open > .select-submenu,
.has-submenu:focus-within > .select-submenu,
.select-submenu.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform:
        var(--select-submenu-placement-transform)
        var(--select-submenu-open-transform);
    transition:
        opacity 0.16s ease,
        transform 0.18s cubic-bezier(0.2, 0.8, 0.2, 1),
        visibility 0s linear 0s;
}

@media (hover: hover) and (pointer: fine) {
    .has-submenu:hover > .select-submenu {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform:
            var(--select-submenu-placement-transform)
            var(--select-submenu-open-transform);
        transition:
            opacity 0.16s ease,
            transform 0.18s cubic-bezier(0.2, 0.8, 0.2, 1),
            visibility 0s linear 0s;
    }
}

@media (max-width: 600px) {
    #headerDotsButtonDropdown {
        width: min(260px, calc(100vw - 12px));
        max-width: calc(100vw - 12px);
        max-height: calc(100dvh - 56px);
        overflow-y: auto;
    }

    #headerDotsButtonDropdown .select-dropdown-button {
        min-width: 0;
    }

    #headerDotsButtonDropdown .has-submenu::after {
        display: none;
    }

    #headerDotsButtonDropdown .select-dropdown-item.has-submenu {
        display: flex;
        flex-direction: column;
    }

    #headerDotsButtonDropdown .select-submenu {
        position: static;
        top: auto;
        right: auto;
        left: auto;
        width: 100%;
        min-width: 0;
        margin-top: 4px;
        display: none;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: none;
        transition: none;
    }

    #headerDotsButtonDropdown .has-submenu.open > .select-submenu,
    #headerDotsButtonDropdown .has-submenu:focus-within > .select-submenu,
    #headerDotsButtonDropdown .select-submenu.open {
        display: flex;
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .select-submenu,
    .has-submenu.open > .select-submenu,
    .has-submenu:focus-within > .select-submenu,
    .select-submenu.open {
        transition: none;
        transform: var(--select-submenu-placement-transform);
    }
}

@media (prefers-reduced-motion: reduce) and (hover: hover) and (pointer: fine) {
    .has-submenu:hover > .select-submenu {
        transition: none;
        transform: var(--select-submenu-placement-transform);
    }
}

/* Shared workspace/chat primitives */
.workspace-loading-spinner,
.workspace-notifications-spinner,
.skills-loading-spinner,
.bookmarks-loading-spinner,
.archived-chats-spinner,
.files-loading-spinner,
.files-list-status-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spinTo360 0.8s linear infinite;
}

.workspace-loading-spinner--sm,
.files-loading-spinner,
.files-list-status-spinner {
    width: 16px;
    height: 16px;
    border-width: 2px;
}

:where(
    .workspace-notifications-empty,
    .files-empty-state,
    .todos-empty-state,
    .notes-empty-state
) {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 64px 24px;
    text-align: center;
}

:where(
    .workspace-notifications-empty-icon,
    .files-empty-icon,
    .todos-empty-state-icon,
    .notes-empty-state-icon
) {
    width: 72px;
    height: 72px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--hover);
    color: var(--text-color-secondary);
}

:where(
    .workspace-notifications-empty-icon svg,
    .files-empty-icon svg,
    .todos-empty-state-icon svg,
    .notes-empty-state-icon svg
) {
    /* Keep all shared workspace empty-state SVGs visually consistent. */
    width: 32px;
    height: 32px;
}

:where(
    .workspace-notifications-empty-title,
    .files-empty-title,
    .todos-empty-state-title,
    .notes-empty-state-title
) {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
}

:where(
    .workspace-notifications-empty-text,
    .files-empty-description,
    .todos-empty-state-text,
    .notes-empty-state-text
) {
    margin: 0;
    font-size: 14px;
    color: var(--text-color-secondary);
    line-height: 1.5;
    max-width: 320px;
}

.files-empty-description {
    margin-bottom: 8px;
}

.workspace-empty-grid {
    grid-column: 1 / -1;
}

:where(.todos-empty-state-content, .notes-empty-state-content) {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

:where(.todos-empty-state-action, .files-empty-btn, .files-empty-upload-btn) {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    color: white;
    background: var(--primary-color);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

@media (hover: hover) and (pointer: fine) {
    :where(.todos-empty-state-action, .files-empty-btn, .files-empty-upload-btn):hover {
        background: var(--secondary-color, var(--primary-color));
        transform: translateY(-1px);
    }
}

:where(.todos-empty-state-action, .files-empty-btn, .files-empty-upload-btn):active {
    transform: translateY(0);
}

:where(.todos-empty-state-action, .files-empty-btn, .files-empty-upload-btn) svg {
    width: 18px;
    height: 18px;
}

:where(.todos-sidebar-empty, .notes-sidebar-empty) {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 20px;
    text-align: center;
    height: 100%;
}

:where(.todos-sidebar-empty-icon, .notes-sidebar-empty-icon) {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--hover) 0%, var(--border-color) 100%);
    color: var(--text-color-tertiary);
    margin-bottom: 16px;
}

:where(.todos-sidebar-empty-icon, .notes-sidebar-empty-icon) svg {
    width: 28px;
    height: 28px;
    opacity: 0.7;
}

:where(.todos-sidebar-empty-title, .notes-sidebar-empty-title) {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
    margin: 0 0 6px;
}

:where(.todos-sidebar-empty-text, .notes-sidebar-empty-text) {
    font-size: 12px;
    color: var(--text-color-tertiary);
    margin: 0 0 16px;
    line-height: 1.5;
}

:where(.todos-sidebar-empty-btn, .notes-sidebar-empty-btn) {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    color: var(--primary-color);
    background: var(--primary-light);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

@media (hover: hover) and (pointer: fine) {
    :where(.todos-sidebar-empty-btn, .notes-sidebar-empty-btn):hover {
        background: var(--primary-color);
        color: white;
    }
}

:where(.todos-sidebar-empty-btn, .notes-sidebar-empty-btn) svg {
    width: 14px;
    height: 14px;
}

:where(.todos-mobile-back-btn, .notes-mobile-back-btn) {
    display: none;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    margin-bottom: 12px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-color-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s ease;
}

@media (hover: hover) and (pointer: fine) {
    :where(.todos-mobile-back-btn, .notes-mobile-back-btn):hover {
        background: var(--hover);
    }
}

:where(.todos-mobile-back-btn, .notes-mobile-back-btn):active {
    background: var(--border-color);
}

:where(.todos-mobile-back-btn, .notes-mobile-back-btn) svg {
    width: 18px;
    height: 18px;
}

@media (max-width: 768px) {
    :is(.todos-workspace.todos-workspace, .notes-workspace.notes-workspace) {
        flex-direction: row;
        position: relative;
        overflow: hidden;
    }

    :is(.todos-sidebar.todos-sidebar, .notes-sidebar.notes-sidebar) {
        position: absolute;
        inset: 0;
        width: 100%;
        max-width: none;
        height: 100%;
        max-height: none;
        border-right: none;
        border-bottom: none;
        z-index: 2;
        transform: translateX(0);
        transition:
            transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
            opacity 0.3s ease,
            visibility 0.3s ease;
    }

    :is(.todos-sidebar-list.todos-sidebar-list, .notes-sidebar-list.notes-sidebar-list) {
        flex: 1;
        max-height: none;
        overflow-y: auto;
    }

    :is(.todos-workspace.show-content .todos-sidebar, .notes-workspace.show-content .notes-sidebar) {
        transform: translateX(-100%);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
    }

    :is(.todos-main.todos-main, .notes-main.notes-main) {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        min-height: auto;
        z-index: 1;
        transform: translateX(100%);
        transition:
            transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
            opacity 0.3s ease,
            visibility 0.3s ease;
        opacity: 0;
        visibility: hidden;
    }

    :is(.todos-workspace.show-content .todos-main, .notes-workspace.show-content .notes-main) {
        transform: translateX(0);
        opacity: 1;
        visibility: visible;
        z-index: 2;
    }

    :where(.todos-mobile-back-btn, .notes-mobile-back-btn) {
        display: flex;
    }
}

@media (max-width: 480px) {
    :where(.todos-mobile-back-btn, .notes-mobile-back-btn) {
        padding: 6px 10px;
        font-size: 13px;
    }

    :where(.todos-mobile-back-btn, .notes-mobile-back-btn) svg {
        width: 16px;
        height: 16px;
    }
}

:where(
    .files-folder-modal-header,
    .files-edit-modal-header,
    .todos-create-list-header,
    .archived-chats-header
) {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

:where(
    .files-folder-modal-header h3,
    .files-edit-modal-header h3,
    .todos-create-list-title,
    .projects-create-description-title,
    .automations-create-description-title
) {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
}

:where(
    .model-select-backdrop,
    .files-bs-backdrop,
    .files-preview-backdrop
) {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    pointer-events: none;
    opacity: 0;
    transition: background 0.3s ease, opacity 0.3s ease;
    -webkit-tap-highlight-color: transparent;
}

:where(
    .model-select-backdrop.active,
    .files-bs-backdrop.active,
    .files-preview-backdrop.active
) {
    background: rgba(0, 0, 0, 0.5);
    pointer-events: auto;
    opacity: 1;
}

:where(
    .model-select-drag-handle,
    .files-bs__drag-handle,
    .files-preview-drag-handle
) {
    display: flex;
    width: 100%;
    height: 28px;
    justify-content: center;
    align-items: center;
    cursor: grab;
    touch-action: none;
    flex-shrink: 0;
    background: var(--background);
    border-radius: 16px 16px 0 0;
}

:where(
    .model-select-drag-handle,
    .files-bs__drag-handle,
    .files-preview-drag-handle
):active {
    cursor: grabbing;
}

:where(
    .model-select-drag-handle-bar,
    .files-bs__drag-handle-bar,
    .files-preview-drag-handle-bar
) {
    width: 36px;
    height: 4px;
    background: var(--border-color);
    border-radius: 2px;
    transition: background 0.2s ease, width 0.2s ease;
}

:where(.model-select-drag-handle, .files-bs__drag-handle, .files-preview-drag-handle):active
:where(.model-select-drag-handle-bar, .files-bs__drag-handle-bar, .files-preview-drag-handle-bar) {
    background: var(--text-color-secondary);
    width: 48px;
}

@media (hover: hover) and (pointer: fine) {
    :where(.model-select-drag-handle, .files-bs__drag-handle, .files-preview-drag-handle):hover
    :where(.model-select-drag-handle-bar, .files-bs__drag-handle-bar, .files-preview-drag-handle-bar) {
        background: var(--text-color-secondary);
        width: 48px;
    }
}

:where(
    .projects-create-input-group,
    .automations-create-input-group,
    .files-folder-modal-icon-row,
    .files-folder-modal-field,
    .files-edit-modal-field,
    .skills-form-group,
    .cs-field
) {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

:where(
    .projects-create-input-group label,
    .automations-create-input-group label,
    .skills-form-label
) {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-color);
}

:where(
    .files-folder-modal-icon-row label,
    .files-folder-modal-field label,
    .files-edit-modal-field label
) {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-color-secondary);
}

.model-settings-multiselect.open .model-settings-multiselect-menu,
.presets-dropdown.open .presets-dropdown-menu,
.sidebar-profile-dropdown.open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

:where(
    .workspace-notifications-pagination-btn svg,
    .feedback-modal-btn svg,
    .message-nav-arrow svg,
    .files-folder-ctx-item svg,
    .connections-btn svg,
    .rl-exceeded-notice svg
) {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* Shared workspace feature primitives */
.projects-container,
.automations-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    width: 100%;
    padding-top: 38px;
    padding-left: 20px;
    padding-right: 20px;
    padding-bottom: 20px;
    box-sizing: border-box;
    overflow-y: auto;
    overflow-x: hidden;
}

.projects-content,
.automations-content {
    max-width: 784px;
    width: 100%;
}

.projects-header,
.automations-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-bottom: 20px;
}

.projects-header-title,
.automations-header-title {
    font-size: 24px;
    font-weight: 550;
    color: var(--text-color);
}

.projects-header-button,
.automations-header-button {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    width: auto;
    border-radius: 12px;
    gap: 8px;
    font-size: 14px;
    color: var(--text-color);
    padding: 6px 14px;
    border: 1px solid var(--border-color);
    background: transparent;
    transition: background-color 0.25s ease, transform 0.2s ease;
    cursor: pointer;
}

.projects-header-button svg,
.automations-header-button svg {
    width: 20px;
    height: 20px;
}

@media (hover: hover) and (pointer: fine) {
    .projects-header-button:hover,
    .automations-header-button:hover {
        background-color: var(--hover);
    }
}

.projects-create-form,
.automations-create-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.projects-create-description,
.automations-create-description {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 20px;
    background-color: var(--hover);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.projects-create-description-text,
.automations-create-description-text {
    font-size: 14px;
    color: var(--text-color-secondary);
    margin: 0;
    line-height: 1.5;
}

.projects-create-input,
.automations-create-input {
    height: 44px;
    padding: 0 16px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background-color: var(--background-color);
    color: var(--text-color);
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.projects-create-input:focus,
.automations-create-input:focus,
.projects-create-textarea:focus,
.automations-create-textarea:focus {
    outline: none;
    border-color: var(--text-color);
}

.projects-create-input::placeholder,
.automations-create-input::placeholder,
.projects-create-textarea::placeholder,
.automations-create-textarea::placeholder {
    color: var(--text-color-secondary);
}

.projects-create-textarea,
.automations-create-textarea {
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background-color: var(--background-color);
    color: var(--text-color);
    font-size: 14px;
    line-height: 1.5;
    transition: border-color 0.2s ease;
}

.projects-create-buttons,
.automations-create-buttons {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.todos-workspace,
.notes-workspace {
    display: flex;
    width: 100%;
    height: 100%;
    min-height: 500px;
}

.todos-sidebar-search,
.notes-sidebar-search {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-color);
}

.todos-search-input-wrapper,
.notes-search-input-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--hover);
    border-radius: 10px;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.todos-search-input-wrapper:focus-within,
.notes-search-input-wrapper:focus-within {
    background: var(--background-color);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb, 59, 130, 246), 0.1);
}

.todos-search-icon,
.notes-search-icon {
    width: 16px;
    height: 16px;
    color: var(--text-color-tertiary);
    flex-shrink: 0;
    transition: color 0.2s ease;
}

.todos-search-input-wrapper:focus-within .todos-search-icon,
.notes-search-input-wrapper:focus-within .notes-search-icon {
    color: var(--primary-color);
}

.todos-search-input,
.notes-search-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 13px;
    color: var(--text-color);
    outline: none;
    min-width: 0;
}

.todos-search-input::placeholder,
.notes-search-input::placeholder {
    color: var(--text-color-tertiary);
}

.todos-search-clear,
.notes-search-clear {
    display: none;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    padding: 0;
    border: none;
    background: var(--text-color-tertiary);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.todos-search-clear.visible,
.notes-search-clear.visible {
    display: flex;
}

@media (hover: hover) and (pointer: fine) {
    .todos-search-clear:hover,
    .notes-search-clear:hover {
        background: var(--text-color-secondary);
    }
}

.todos-search-clear svg,
.notes-search-clear svg {
    width: 10px;
    height: 10px;
    color: var(--background-color);
}

.todos-search-results-header,
.notes-search-results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: var(--primary-light);
    border-radius: 8px;
}

.todos-search-results-count,
.notes-search-results-count {
    font-size: 12px;
    font-weight: 500;
    color: var(--primary-color);
}

.todos-search-results-clear,
.notes-search-results-clear {
    font-size: 12px;
    color: var(--primary-color);
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: background 0.15s ease;
}

@media (hover: hover) and (pointer: fine) {
    .todos-search-results-clear:hover,
    .notes-search-results-clear:hover {
        background: rgba(var(--primary-rgb, 59, 130, 246), 0.15);
    }
}

.todos-search-empty,
.notes-search-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 20px;
    text-align: center;
}

.todos-search-empty-icon,
.notes-search-empty-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: var(--hover);
    color: var(--text-color-tertiary);
    margin-bottom: 12px;
}

.todos-search-empty-icon svg,
.notes-search-empty-icon svg {
    width: 24px;
    height: 24px;
}

.todos-search-empty-title,
.notes-search-empty-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
    margin: 0 0 4px;
}

.todos-search-empty-text,
.notes-search-empty-text {
    font-size: 12px;
    color: var(--text-color-tertiary);
    margin: 0;
}

.todos-search-highlight,
.notes-search-highlight {
    background: rgba(var(--primary-rgb, 59, 130, 246), 0.2);
    color: var(--primary-color);
    border-radius: 2px;
    padding: 0 2px;
}

.files-main,
.todos-main,
.notes-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}
