<Window x:Class="AxCopilot.Views.SettingsWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:vm="clr-namespace:AxCopilot.ViewModels"
        xmlns:converters="clr-namespace:AxCopilot.Themes"
        Title="AX Copilot 설정"
        Width="1100" Height="760"
        MinWidth="960" MinHeight="700"
        WindowStyle="SingleBorderWindow"
        ResizeMode="CanResize"
        ShowInTaskbar="True"
        WindowStartupLocation="CenterScreen"
        Background="#F5F5F7"
        FontFamily="Segoe UI, Malgun Gothic"
        Icon="pack://application:,,,/Assets/icon.ico"
        PreviewKeyDown="Window_PreviewKeyDown">

    <Window.Resources>
        <!-- ─── 컨버터 ─────────────────────────────────────────────────────── -->
        <converters:BoolToVisibilityConverter        x:Key="BoolToVisibilityConverter"/>
        <converters:InverseBoolToVisibilityConverter x:Key="InverseBoolToVisibilityConverter"/>
        <converters:CountToVisibilityConverter       x:Key="CountToVisibilityConverter"/>
        <converters:StringEqualConverter             x:Key="StringEqualConverter"/>

        <!-- ─── 사이드바 탭 항목 스타일 ──────────────────────────────────── -->
        <Style x:Key="SideNavItem" TargetType="TabItem">
            <Setter Property="Background"    Value="Transparent"/>
            <Setter Property="BorderThickness" Value="0"/>
            <Setter Property="Foreground"    Value="#8888AA"/>
            <Setter Property="FontSize"      Value="13"/>
            <Setter Property="FontWeight"    Value="Normal"/>
            <Setter Property="Width"         Value="188"/>
            <Setter Property="Height"        Value="46"/>
            <Setter Property="Cursor"        Value="Hand"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="TabItem">
                        <Grid Height="46">
                            <!-- 배경 -->
                            <Border x:Name="BgBd" Background="Transparent"
                                    CornerRadius="8" Margin="8,2"/>
                            <!-- 좌측 액센트 바 -->
                            <Border x:Name="Bar" Width="3" HorizontalAlignment="Left"
                                    CornerRadius="0,3,3,0" Background="Transparent"/>
                            <!-- 아이콘 + 텍스트 -->
                            <StackPanel Orientation="Horizontal"
                                        VerticalAlignment="Center" Margin="22,0,12,0">
                                <TextBlock x:Name="Icon"
                                           Text="{TemplateBinding Tag}"
                                           FontFamily="Segoe MDL2 Assets"
                                           FontSize="16" Width="22"
                                           HorizontalAlignment="Center"
                                           Foreground="#9999BB"
                                           VerticalAlignment="Center"
                                           Margin="0,0,10,0"/>
                                <ContentPresenter ContentSource="Header"
                                                  VerticalAlignment="Center"
                                                  RecognizesAccessKey="True"/>
                            </StackPanel>
                        </Grid>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsSelected" Value="True">
                                <Setter TargetName="BgBd" Property="Background" Value="#EEF0FF"/>
                                <Setter TargetName="Bar"  Property="Background" Value="#4B5EFC"/>
                                <Setter TargetName="Icon" Property="Foreground" Value="#4B5EFC"/>
                                <Setter Property="Foreground"  Value="#2B3280"/>
                                <Setter Property="FontWeight"  Value="SemiBold"/>
                            </Trigger>
                            <MultiTrigger>
                                <MultiTrigger.Conditions>
                                    <Condition Property="IsMouseOver" Value="True"/>
                                    <Condition Property="IsSelected"  Value="False"/>
                                </MultiTrigger.Conditions>
                                <Setter TargetName="BgBd" Property="Background" Value="#F4F4FF"/>
                                <Setter TargetName="Icon" Property="Foreground" Value="#6666BB"/>
                                <Setter Property="Foreground" Value="#5558AA"/>
                            </MultiTrigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <!-- ─── 설정 행 컨테이너 ─────────────────────────────────────────── -->
        <Style x:Key="SettingsRow" TargetType="Border">
            <Setter Property="Background"    Value="White"/>
            <Setter Property="CornerRadius"  Value="10"/>
            <Setter Property="Padding"       Value="14,12"/>
            <Setter Property="Margin"        Value="0,0,0,3"/>
        </Style>

        <!-- ─── 레이블 / 힌트 ────────────────────────────────────────────── -->
        <Style x:Key="RowLabel" TargetType="TextBlock">
            <Setter Property="FontSize"         Value="13"/>
            <Setter Property="Foreground"       Value="#1A1B2E"/>
            <Setter Property="VerticalAlignment" Value="Center"/>
        </Style>
        <Style x:Key="RowHint" TargetType="TextBlock">
            <Setter Property="FontSize"         Value="11"/>
            <Setter Property="Foreground"       Value="#9999BB"/>
            <Setter Property="VerticalAlignment" Value="Center"/>
            <Setter Property="Margin"           Value="0,2,0,0"/>
            <Setter Property="TextWrapping"     Value="Wrap"/>
        </Style>
        <Style x:Key="SectionHeader" TargetType="TextBlock">
            <Setter Property="FontSize"   Value="10.5"/>
            <Setter Property="FontWeight" Value="SemiBold"/>
            <Setter Property="Foreground" Value="#AAAACC"/>
            <Setter Property="Margin"     Value="2,18,0,8"/>
        </Style>


        <!-- ─── 도움말 아이콘 (? 버튼 + 커스텀 툴팁) ──────────────────────── -->
        <Style x:Key="HelpTooltipStyle" TargetType="ToolTip">
            <Setter Property="OverridesDefaultStyle" Value="True"/>
            <Setter Property="HasDropShadow" Value="False"/>
            <Setter Property="MaxWidth" Value="320"/>
            <Setter Property="Placement" Value="Bottom"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="ToolTip">
                        <Border Background="#1A1B2E" CornerRadius="10" Padding="14,10"
                                BorderBrush="#4B5EFC" BorderThickness="1">
                            <ContentPresenter/>
                        </Border>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <!-- ─── 에이전트 서브탭 (Segmented Control 스타일) ────────────────── -->
        <Style x:Key="AgentSubTabStyle" TargetType="RadioButton">
            <Setter Property="Background"    Value="Transparent"/>
            <Setter Property="Foreground"    Value="#8888AA"/>
            <Setter Property="FontSize"      Value="12.5"/>
            <Setter Property="FontWeight"    Value="Normal"/>
            <Setter Property="Padding"       Value="14,5"/>
            <Setter Property="Margin"        Value="1,0"/>
            <Setter Property="Cursor"        Value="Hand"/>
            <Setter Property="BorderThickness" Value="0"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="RadioButton">
                        <Border x:Name="Bd" Background="{TemplateBinding Background}"
                                CornerRadius="6" Padding="{TemplateBinding Padding}"
                                SnapsToDevicePixels="True">
                            <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
                        </Border>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsChecked" Value="True">
                                <Setter TargetName="Bd" Property="Background" Value="White"/>
                                <Setter Property="Foreground"  Value="#1A1B2E"/>
                                <Setter Property="FontWeight"  Value="SemiBold"/>
                            </Trigger>
                            <MultiTrigger>
                                <MultiTrigger.Conditions>
                                    <Condition Property="IsMouseOver" Value="True"/>
                                    <Condition Property="IsChecked"   Value="False"/>
                                </MultiTrigger.Conditions>
                                <Setter TargetName="Bd" Property="Background" Value="#E0E0E8"/>
                            </MultiTrigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <!-- ─── 토글 스위치 ──────────────────────────────────────────────── -->
        <Style x:Key="ToggleSwitch" TargetType="CheckBox">
            <Setter Property="Cursor" Value="Hand"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="CheckBox">
                        <Grid Width="46" Height="26" VerticalAlignment="Center">
                            <Border x:Name="Track" CornerRadius="13" Background="#D0D0E0"
                                    Width="46" Height="26"/>
                            <Ellipse x:Name="Thumb" Width="20" Height="20"
                                     Fill="White" HorizontalAlignment="Left"
                                     VerticalAlignment="Center" Margin="3,0,0,0">
                                <Ellipse.Effect>
                                    <DropShadowEffect BlurRadius="5" ShadowDepth="1" Opacity="0.25" Direction="270"/>
                                </Ellipse.Effect>
                            </Ellipse>
                        </Grid>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsChecked" Value="True">
                                <Setter TargetName="Track" Property="Background" Value="#4B5EFC"/>
                                <Setter TargetName="Thumb" Property="HorizontalAlignment" Value="Right"/>
                                <Setter TargetName="Thumb" Property="Margin" Value="0,0,3,0"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <!-- ─── 커스텀 ComboBox (ModernComboBox) ────────────────────────── -->
        <ControlTemplate x:Key="ModernComboBoxToggle" TargetType="ToggleButton">
            <Border x:Name="Bd" Background="#F0F0F8" BorderBrush="#E0E0EC" BorderThickness="1.5"
                    CornerRadius="7" Padding="10,6">
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition/>
                        <ColumnDefinition Width="Auto"/>
                    </Grid.ColumnDefinitions>
                    <ContentPresenter Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Left"
                                      Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}"/>
                    <TextBlock Grid.Column="1" Text="&#xE70D;" FontFamily="Segoe MDL2 Assets" FontSize="10"
                               Foreground="#8888AA" VerticalAlignment="Center" Margin="8,0,2,0"/>
                </Grid>
            </Border>
            <ControlTemplate.Triggers>
                <Trigger Property="IsMouseOver" Value="True">
                    <Setter TargetName="Bd" Property="BorderBrush" Value="#B0B0CC"/>
                    <Setter TargetName="Bd" Property="Background"  Value="#F4F4FF"/>
                </Trigger>
                <Trigger Property="IsChecked" Value="True">
                    <Setter TargetName="Bd" Property="BorderBrush" Value="#4B5EFC"/>
                    <Setter TargetName="Bd" Property="Background"  Value="#F8F8FF"/>
                </Trigger>
            </ControlTemplate.Triggers>
        </ControlTemplate>

        <Style TargetType="ComboBox">
            <Setter Property="Foreground"             Value="#1A1B2E"/>
            <Setter Property="FontSize"               Value="13"/>
            <Setter Property="Background"             Value="#F0F0F8"/>
            <Setter Property="BorderBrush"            Value="#E0E0EC"/>
            <Setter Property="VerticalContentAlignment" Value="Center"/>
            <Setter Property="Cursor"                 Value="Hand"/>
            <Setter Property="SnapsToDevicePixels"    Value="True"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="ComboBox">
                        <Grid>
                            <ToggleButton x:Name="ToggleButton"
                                          Template="{StaticResource ModernComboBoxToggle}"
                                          Focusable="False"
                                          IsChecked="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
                                          ClickMode="Press"/>
                            <ContentPresenter x:Name="ContentSite"
                                              IsHitTestVisible="False"
                                              Content="{TemplateBinding SelectionBoxItem}"
                                              ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}"
                                              ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}"
                                              Margin="12,6,28,6"
                                              VerticalAlignment="Center"
                                              HorizontalAlignment="Left"/>
                            <Popup x:Name="Popup" Placement="Bottom"
                                   IsOpen="{TemplateBinding IsDropDownOpen}"
                                   AllowsTransparency="True" Focusable="False"
                                   PopupAnimation="Slide">
                                <Grid x:Name="DropDown"
                                      MinWidth="{TemplateBinding ActualWidth}"
                                      MaxHeight="{TemplateBinding MaxDropDownHeight}"
                                      SnapsToDevicePixels="True">
                                    <Border x:Name="DropDownBorder"
                                            Background="White" CornerRadius="8"
                                            BorderBrush="#D8D8E8" BorderThickness="1"
                                            Margin="0,2,0,0" Padding="4">
                                        <Border.Effect>
                                            <DropShadowEffect BlurRadius="12" ShadowDepth="4" Opacity="0.12" Direction="270"/>
                                        </Border.Effect>
                                        <ScrollViewer SnapsToDevicePixels="True" VerticalScrollBarVisibility="Auto"
                                                      MaxHeight="300">
                                            <StackPanel IsItemsHost="True" KeyboardNavigation.DirectionalNavigation="Contained"/>
                                        </ScrollViewer>
                                    </Border>
                                </Grid>
                            </Popup>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <Style TargetType="ComboBoxItem">
            <Setter Property="Foreground"             Value="#1A1B2E"/>
            <Setter Property="FontSize"               Value="13"/>
            <Setter Property="Padding"                Value="10,7"/>
            <Setter Property="Cursor"                 Value="Hand"/>
            <Setter Property="SnapsToDevicePixels"    Value="True"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="ComboBoxItem">
                        <Border x:Name="Bd" Background="Transparent" CornerRadius="6"
                                Padding="{TemplateBinding Padding}" Margin="0,1">
                            <ContentPresenter VerticalAlignment="Center"/>
                        </Border>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsHighlighted" Value="True">
                                <Setter TargetName="Bd" Property="Background" Value="#EEF0FF"/>
                            </Trigger>
                            <Trigger Property="IsMouseOver" Value="True">
                                <Setter TargetName="Bd" Property="Background" Value="#EEF0FF"/>
                            </Trigger>
                            <Trigger Property="IsSelected" Value="True">
                                <Setter TargetName="Bd" Property="Background" Value="#E0E4FF"/>
                                <Setter Property="Foreground" Value="#4B5EFC"/>
                                <Setter Property="FontWeight" Value="SemiBold"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <!-- ─── ModernTextBox ────────────────────────────────────────────── -->
        <Style x:Key="ModernTextBox" TargetType="TextBox">
            <Setter Property="Background"             Value="#F0F0F8"/>
            <Setter Property="BorderBrush"            Value="#E0E0EC"/>
            <Setter Property="BorderThickness"        Value="1.5"/>
            <Setter Property="Padding"                Value="10,7"/>
            <Setter Property="FontSize"               Value="13"/>
            <Setter Property="Foreground"             Value="#1A1B2E"/>
            <Setter Property="VerticalContentAlignment" Value="Center"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="TextBox">
                        <Border Background="{TemplateBinding Background}"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                CornerRadius="7">
                            <Grid>
                                <ScrollViewer x:Name="PART_ContentHost" Margin="{TemplateBinding Padding}"/>
                                <TextBlock x:Name="PART_Placeholder"
                                           Text="{TemplateBinding Tag}"
                                           Foreground="#AAAACC"
                                           FontSize="{TemplateBinding FontSize}"
                                           Margin="{TemplateBinding Padding}"
                                           VerticalAlignment="Center"
                                           IsHitTestVisible="False"
                                           Visibility="Collapsed"/>
                            </Grid>
                        </Border>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsFocused" Value="True">
                                <Setter Property="BorderBrush" Value="#4B5EFC"/>
                                <Setter Property="Background"  Value="#F8F8FF"/>
                            </Trigger>
                            <MultiTrigger>
                                <MultiTrigger.Conditions>
                                    <Condition Property="Text" Value=""/>
                                    <Condition Property="IsFocused" Value="False"/>
                                </MultiTrigger.Conditions>
                                <Setter TargetName="PART_Placeholder" Property="Visibility" Value="Visible"/>
                            </MultiTrigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <!-- ─── 버튼 스타일들 ─────────────────────────────────────────────── -->
        <Style x:Key="PrimaryButton" TargetType="Button">
            <Setter Property="Background"   Value="#4B5EFC"/>
            <Setter Property="Foreground"   Value="White"/>
            <Setter Property="FontSize"     Value="13"/>
            <Setter Property="FontWeight"   Value="SemiBold"/>
            <Setter Property="Padding"      Value="18,8"/>
            <Setter Property="BorderThickness" Value="0"/>
            <Setter Property="Cursor"       Value="Hand"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Button">
                        <Border Background="{TemplateBinding Background}"
                                CornerRadius="8" Padding="{TemplateBinding Padding}">
                            <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
                        </Border>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsMouseOver" Value="True">
                                <Setter Property="Background" Value="#3B4EEC"/>
                            </Trigger>
                            <Trigger Property="IsPressed" Value="True">
                                <Setter Property="Background" Value="#2B3EDC"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <Style x:Key="SecondaryButton" TargetType="Button">
            <Setter Property="Background"   Value="#EBEBF0"/>
            <Setter Property="Foreground"   Value="#333350"/>
            <Setter Property="FontSize"     Value="13"/>
            <Setter Property="Padding"      Value="18,8"/>
            <Setter Property="BorderThickness" Value="0"/>
            <Setter Property="Cursor"       Value="Hand"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Button">
                        <Border Background="{TemplateBinding Background}"
                                CornerRadius="8" Padding="{TemplateBinding Padding}">
                            <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
                        </Border>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsMouseOver" Value="True">
                                <Setter Property="Background" Value="#DDDDE8"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <!-- 아이콘 버튼 (작은 정사각형) -->
        <Style x:Key="IconButton" TargetType="Button">
            <Setter Property="Background"      Value="#EBEBF0"/>
            <Setter Property="BorderThickness" Value="0"/>
            <Setter Property="Cursor"          Value="Hand"/>
            <Setter Property="Width"           Value="34"/>
            <Setter Property="Height"          Value="32"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Button">
                        <Border Background="{TemplateBinding Background}" CornerRadius="7">
                            <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
                        </Border>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsMouseOver" Value="True">
                                <Setter Property="Background" Value="#DDDDE8"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <!-- 삭제 버튼 -->
        <Style x:Key="DeleteButton" TargetType="Button">
            <Setter Property="Background"      Value="Transparent"/>
            <Setter Property="BorderThickness" Value="0"/>
            <Setter Property="Cursor"          Value="Hand"/>
            <Setter Property="Width"           Value="28"/>
            <Setter Property="Height"          Value="28"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Button">
                        <Border Background="{TemplateBinding Background}" CornerRadius="6">
                            <TextBlock Text="&#xE74D;" FontFamily="Segoe MDL2 Assets"
                                       FontSize="12" Foreground="#DD3333"
                                       HorizontalAlignment="Center" VerticalAlignment="Center"/>
                        </Border>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsMouseOver" Value="True">
                                <Setter Property="Background" Value="#FFF0F0"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <!-- 색상 스와치 버튼 -->
        <Style x:Key="ColorSwatchButton" TargetType="Button">
            <Setter Property="Width"           Value="36"/>
            <Setter Property="Height"          Value="36"/>
            <Setter Property="BorderBrush"     Value="#CCCCDD"/>
            <Setter Property="BorderThickness" Value="1.5"/>
            <Setter Property="Cursor"          Value="Hand"/>
            <Setter Property="Padding"         Value="0"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Button">
                        <Grid>
                            <Border x:Name="Swatch"
                                    Background="{TemplateBinding Background}"
                                    BorderBrush="{TemplateBinding BorderBrush}"
                                    BorderThickness="{TemplateBinding BorderThickness}"
                                    CornerRadius="9"/>
                            <TextBlock x:Name="EditIcon" Text="&#xE70F;"
                                       FontFamily="Segoe MDL2 Assets" FontSize="11"
                                       Foreground="White" HorizontalAlignment="Center"
                                       VerticalAlignment="Center" Opacity="0"/>
                        </Grid>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsMouseOver" Value="True">
                                <Setter TargetName="Swatch"    Property="BorderBrush"    Value="#4B5EFC"/>
                                <Setter TargetName="Swatch"    Property="BorderThickness" Value="2"/>
                                <Setter TargetName="EditIcon"  Property="Opacity"        Value="0.85"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <!-- ─── 핫키 배지 (키 이름 pill) ──────────────────────────────── -->
        <Style x:Key="KeyBadge" TargetType="Border">
            <Setter Property="Background"        Value="White"/>
            <Setter Property="BorderBrush"       Value="#C8C8E0"/>
            <Setter Property="BorderThickness"   Value="1"/>
            <Setter Property="CornerRadius"      Value="5"/>
            <Setter Property="Padding"           Value="8,3"/>
            <Setter Property="Margin"            Value="0,0,0,0"/>
            <Setter Property="VerticalAlignment" Value="Center"/>
            <Setter Property="Effect">
                <Setter.Value>
                    <DropShadowEffect BlurRadius="3" ShadowDepth="1" Opacity="0.12" Direction="270"/>
                </Setter.Value>
            </Setter>
        </Style>

        <!-- 테마 카드 스타일 -->
        <Style x:Key="ThemeCard" TargetType="Button">
            <Setter Property="Padding"         Value="0"/>
            <Setter Property="BorderThickness" Value="2"/>
            <Setter Property="Cursor"          Value="Hand"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Button">
                        <Border x:Name="CardBorder"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                CornerRadius="12" ClipToBounds="True">
                            <ContentPresenter/>
                        </Border>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsMouseOver" Value="True">
                                <Setter TargetName="CardBorder" Property="BorderBrush" Value="#4B5EFC"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

    </Window.Resources>

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="*"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>

        <!-- ══════════════════════════════════════════════════════════════════ -->
        <!-- 탭 컨트롤 (좌측 사이드바)                                          -->
        <!-- ══════════════════════════════════════════════════════════════════ -->
        <TabControl Grid.Row="0" TabStripPlacement="Left"
                    Background="Transparent" BorderThickness="0">
            <TabControl.Template>
                <ControlTemplate TargetType="TabControl">
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="188"/>
                            <ColumnDefinition Width="*"/>
                        </Grid.ColumnDefinitions>

                        <!-- ── 사이드바 ────────────────────────────────────── -->
                        <Border Grid.Column="0" Background="White"
                                BorderBrush="#EAEAF0" BorderThickness="0,0,1,0">
                            <DockPanel>
                                <!-- 앱 브랜딩 헤더 -->
                                <Border DockPanel.Dock="Top" Padding="16,20,16,14">
                                    <StackPanel Orientation="Horizontal">
                                        <Border Width="30" Height="30" CornerRadius="8"
                                                Background="#4B5EFC" Margin="0,0,10,0">
                                            <TextBlock Text="&#xE700;"
                                                       FontFamily="Segoe MDL2 Assets"
                                                       FontSize="15" Foreground="White"
                                                       HorizontalAlignment="Center"
                                                       VerticalAlignment="Center"/>
                                        </Border>
                                        <StackPanel VerticalAlignment="Center">
                                            <TextBlock Text="AX"
                                                       FontSize="14" FontWeight="Bold"
                                                       Foreground="#1A1B2E" LineHeight="16"/>
                                            <TextBlock Text="Commander"
                                                       FontSize="9.5" Foreground="#9999BB"/>
                                        </StackPanel>
                                    </StackPanel>
                                </Border>
                                <Rectangle DockPanel.Dock="Top" Height="1"
                                           Fill="#EAEAF0" Margin="12,0,12,8"/>
                                <!-- 탭 목록 — 창 높이가 충분히 크므로 스크롤 없음 -->
                                <ScrollViewer VerticalScrollBarVisibility="Disabled"
                                              HorizontalScrollBarVisibility="Disabled"
                                              Margin="0,4,0,4">
                                    <TabPanel IsItemsHost="True"
                                              Background="Transparent"/>
                                </ScrollViewer>
                            </DockPanel>
                        </Border>

                        <!-- ── 컨텐츠 영역 ─────────────────────────────────── -->
                        <Border Grid.Column="1" Background="#F5F5F7">
                            <ContentPresenter ContentSource="SelectedContent"
                                              Margin="26,20,26,8"/>
                        </Border>
                    </Grid>
                </ControlTemplate>
            </TabControl.Template>

            <!-- ════════════════════════════════════════════════════════════ -->
            <!-- 1. 일반 탭                                                    -->
            <!-- ════════════════════════════════════════════════════════════ -->
            <TabItem Header="일반" Tag="&#xE713;" Style="{StaticResource SideNavItem}">
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="*"/>
                    </Grid.RowDefinitions>
                    <TextBlock Grid.Row="0" Text="일반 설정" FontSize="16" FontWeight="SemiBold" Foreground="#1A1B2E" Margin="0,0,0,2"/>
                    <Border Grid.Row="1" Background="#EEEEF2" CornerRadius="8" Padding="3" Margin="0,4,0,8">
                        <StackPanel Orientation="Horizontal">
                            <RadioButton x:Name="GeneralSubTabMain" Content="일반" IsChecked="True"
                                         GroupName="GeneralSubTab" Style="{StaticResource AgentSubTabStyle}"
                                         Checked="GeneralSubTab_Checked"/>
                            <RadioButton x:Name="GeneralSubTabNotify" Content="알림"
                                         GroupName="GeneralSubTab" Style="{StaticResource AgentSubTabStyle}"
                                         Checked="GeneralSubTab_Checked"/>
                            <RadioButton x:Name="GeneralSubTabStorage" Content="저장 공간"
                                         GroupName="GeneralSubTab" Style="{StaticResource AgentSubTabStyle}"
                                         Checked="GeneralSubTab_Checked"/>
                        </StackPanel>
                    </Border>
                    <ScrollViewer x:Name="GeneralMainPanel" Grid.Row="2" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled">
                    <StackPanel>

                        <TextBlock Text="AI 기능" Style="{StaticResource SectionHeader}"/>
                        <Border Style="{StaticResource SettingsRow}">
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="*"/>
                                    <ColumnDefinition Width="Auto"/>
                                </Grid.ColumnDefinitions>
                                <Border Grid.Column="0" Width="36" Height="36" CornerRadius="9"
                                        Background="#8B2FC9" Margin="0,0,14,0" VerticalAlignment="Center">
                                    <TextBlock Text="&#xE8BD;" FontFamily="Segoe MDL2 Assets" FontSize="17"
                                               Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                </Border>
                                <StackPanel Grid.Column="1" VerticalAlignment="Center">
                                    <TextBlock Text="AX Agent (AI 기능) 활성화" Style="{StaticResource RowLabel}"/>
                                    <TextBlock Text="비활성화하면 ! 명령어가 차단되고 AX Agent 설정 메뉴가 숨겨집니다"
                                               Style="{StaticResource RowHint}"/>
                                </StackPanel>
                                <CheckBox x:Name="AiEnabledToggle"
                                          Grid.Column="2" Style="{StaticResource ToggleSwitch}"
                                          HorizontalAlignment="Right" VerticalAlignment="Center"
                                          Checked="AiEnabled_Changed" Unchecked="AiEnabled_Changed"/>
                            </Grid>
                        </Border>

                        <TextBlock Text="네트워크 모드" Style="{StaticResource SectionHeader}"/>
                        <Border Style="{StaticResource SettingsRow}">
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="*"/>
                                    <ColumnDefinition Width="Auto"/>
                                </Grid.ColumnDefinitions>
                                <Border Grid.Column="0" Width="36" Height="36" CornerRadius="9"
                                        Background="#0EA5E9" Margin="0,0,14,0" VerticalAlignment="Center">
                                    <TextBlock Text="&#xE774;" FontFamily="Segoe MDL2 Assets" FontSize="17"
                                               Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                </Border>
                                <StackPanel Grid.Column="1" VerticalAlignment="Center">
                                    <TextBlock Text="사내 모드 (외부 인터넷 차단)" Style="{StaticResource RowLabel}"/>
                                    <TextBlock Text="ON(기본): 인터넷 검색·외부 HTTP 차단 / OFF(사외 모드): 비밀번호 인증 후 허용"
                                               Style="{StaticResource RowHint}"/>
                                </StackPanel>
                                <CheckBox x:Name="InternalModeToggle"
                                          Grid.Column="2" Style="{StaticResource ToggleSwitch}"
                                          HorizontalAlignment="Right" VerticalAlignment="Center"
                                          Checked="NetworkMode_Changed" Unchecked="NetworkMode_Changed"/>
                            </Grid>
                        </Border>

                        <TextBlock Text="단축키" Style="{StaticResource SectionHeader}"/>
                        <Border Style="{StaticResource SettingsRow}">
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="*"/>
                                    <ColumnDefinition Width="200"/>
                                </Grid.ColumnDefinitions>
                                <!-- 아이콘 박스 -->
                                <Border Grid.Column="0" Width="36" Height="36" CornerRadius="9"
                                        Background="#4B5EFC" Margin="0,0,14,0" VerticalAlignment="Center">
                                    <TextBlock Text="&#xE765;" FontFamily="Segoe MDL2 Assets" FontSize="17"
                                               Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                </Border>
                                <StackPanel Grid.Column="1" VerticalAlignment="Center">
                                    <TextBlock Text="글로벌 단축키" Style="{StaticResource RowLabel}"/>
                                    <TextBlock Text="AX Commander를 열고 닫는 전역 단축키" Style="{StaticResource RowHint}"/>
                                </StackPanel>
                                <!-- ── 글로벌 단축키 콤보박스 ──────────────── -->
                                <ComboBox Grid.Column="2"
                                          x:Name="HotkeyCombo"
                                          SelectedValue="{Binding Hotkey}"
                                          SelectedValuePath="Tag"
                                          SelectionChanged="HotkeyCombo_SelectionChanged"
                                          Width="200" Height="34"
                                          FontSize="13" FontWeight="SemiBold"
                                          VerticalAlignment="Center"
                                          VerticalContentAlignment="Center">
                                    <!-- Spotlight / Alfred / Raycast 계열 인기 키조합 -->
                                    <ComboBoxItem Content="Alt + Space"         Tag="Alt+Space"/>
                                    <ComboBoxItem Content="Ctrl + Space"        Tag="Ctrl+Space"/>
                                    <ComboBoxItem Content="Ctrl + Alt + Space"  Tag="Ctrl+Alt+Space"/>
                                    <ComboBoxItem Content="Alt + X"             Tag="Alt+X"/>
                                    <ComboBoxItem Content="Alt + A"             Tag="Alt+A"/>
                                    <ComboBoxItem Content="Alt + Z"             Tag="Alt+Z"/>
                                    <ComboBoxItem Content="Ctrl + Shift + Space" Tag="Ctrl+Shift+Space"/>
                                    <ComboBoxItem Content="Ctrl + `"            Tag="Ctrl+Oem3"/>
                                    <ComboBoxItem Content="Win + Space"         Tag="Win+Space"/>
                                    <ComboBoxItem Content="Ctrl + Alt + A"      Tag="Ctrl+Alt+A"/>
                                    <ComboBoxItem Content="Ctrl + ;"            Tag="Ctrl+OemSemicolon"/>
                                    <ComboBoxItem Content="F12"                 Tag="F12"/>
                                </ComboBox>
                            </Grid>
                        </Border>

                        <TextBlock Text="검색 결과" Style="{StaticResource SectionHeader}"/>
                        <Border Style="{StaticResource SettingsRow}">
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="*"/>
                                    <ColumnDefinition Width="200"/>
                                </Grid.ColumnDefinitions>
                                <Border Grid.Column="0" Width="36" Height="36" CornerRadius="9"
                                        Background="#00A8CC" Margin="0,0,14,0" VerticalAlignment="Center">
                                    <TextBlock Text="&#xE721;" FontFamily="Segoe MDL2 Assets" FontSize="17"
                                               Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                </Border>
                                <StackPanel Grid.Column="1" VerticalAlignment="Center">
                                    <TextBlock Text="최대 결과 수" Style="{StaticResource RowLabel}"/>
                                    <TextBlock Text="한 번에 표시할 최대 항목 개수 (1–20)" Style="{StaticResource RowHint}"/>
                                </StackPanel>
                                <StackPanel Grid.Column="2" Orientation="Horizontal" VerticalAlignment="Center">
                                    <Slider Minimum="1" Maximum="20"
                                            Value="{Binding MaxResults, UpdateSourceTrigger=PropertyChanged}"
                                            Width="140" SmallChange="1" LargeChange="5"
                                            IsSnapToTickEnabled="True" TickFrequency="1"
                                            VerticalAlignment="Center"/>
                                    <Border Width="36" Height="28" CornerRadius="6" Background="#EEF0FF"
                                            Margin="8,0,0,0" VerticalAlignment="Center">
                                        <TextBlock Text="{Binding MaxResults}"
                                                   FontSize="13" FontWeight="SemiBold"
                                                   Foreground="#4B5EFC"
                                                   HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                    </Border>
                                </StackPanel>
                            </Grid>
                        </Border>

                        <!-- 기본 검색 엔진 -->
                        <Border Style="{StaticResource SettingsRow}">
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="*"/>
                                    <ColumnDefinition Width="200"/>
                                </Grid.ColumnDefinitions>
                                <Border Grid.Column="0" Width="36" Height="36" CornerRadius="9"
                                        Background="#006EAF" Margin="0,0,14,0" VerticalAlignment="Center">
                                    <TextBlock Text="&#xE774;" FontFamily="Segoe MDL2 Assets" FontSize="17"
                                               Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                </Border>
                                <StackPanel Grid.Column="1" VerticalAlignment="Center">
                                    <TextBlock Text="기본 검색 엔진" Style="{StaticResource RowLabel}"/>
                                    <TextBlock Text="'?' 예약어의 기본 검색 엔진" Style="{StaticResource RowHint}"/>
                                </StackPanel>
                                <ComboBox Grid.Column="2"
                                          SelectedValue="{Binding WebSearchEngine}"
                                          SelectedValuePath="Tag"
                                          Height="32" FontSize="12"
                                          VerticalContentAlignment="Center">
                                    <ComboBoxItem Tag="g">
                                        <StackPanel Orientation="Horizontal">
                                            <TextBlock Text="&#xE774;" FontFamily="Segoe MDL2 Assets" FontSize="11"
                                                       Foreground="#4285F4" Margin="0,0,7,0" VerticalAlignment="Center"/>
                                            <TextBlock Text="Google" VerticalAlignment="Center"/>
                                        </StackPanel>
                                    </ComboBoxItem>
                                    <ComboBoxItem Tag="n">
                                        <StackPanel Orientation="Horizontal">
                                            <TextBlock Text="&#xE774;" FontFamily="Segoe MDL2 Assets" FontSize="11"
                                                       Foreground="#03C75A" Margin="0,0,7,0" VerticalAlignment="Center"/>
                                            <TextBlock Text="Naver" VerticalAlignment="Center"/>
                                        </StackPanel>
                                    </ComboBoxItem>
                                    <ComboBoxItem Tag="d">
                                        <StackPanel Orientation="Horizontal">
                                            <TextBlock Text="&#xE774;" FontFamily="Segoe MDL2 Assets" FontSize="11"
                                                       Foreground="#DE5833" Margin="0,0,7,0" VerticalAlignment="Center"/>
                                            <TextBlock Text="DuckDuckGo" VerticalAlignment="Center"/>
                                        </StackPanel>
                                    </ComboBoxItem>
                                    <ComboBoxItem Tag="y">
                                        <StackPanel Orientation="Horizontal">
                                            <TextBlock Text="&#xE774;" FontFamily="Segoe MDL2 Assets" FontSize="11"
                                                       Foreground="#FF0000" Margin="0,0,7,0" VerticalAlignment="Center"/>
                                            <TextBlock Text="YouTube" VerticalAlignment="Center"/>
                                        </StackPanel>
                                    </ComboBoxItem>
                                    <ComboBoxItem Tag="w">
                                        <StackPanel Orientation="Horizontal">
                                            <TextBlock Text="&#xE774;" FontFamily="Segoe MDL2 Assets" FontSize="11"
                                                       Foreground="#888888" Margin="0,0,7,0" VerticalAlignment="Center"/>
                                            <TextBlock Text="Wikipedia" VerticalAlignment="Center"/>
                                        </StackPanel>
                                    </ComboBoxItem>
                                </ComboBox>
                            </Grid>
                        </Border>

                        <TextBlock Text="디스플레이" Style="{StaticResource SectionHeader}"/>
                        <Border Style="{StaticResource SettingsRow}">
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="*"/>
                                    <ColumnDefinition Width="200"/>
                                </Grid.ColumnDefinitions>
                                <Border Grid.Column="0" Width="36" Height="36" CornerRadius="9"
                                        Background="#7B2FBE" Margin="0,0,14,0" VerticalAlignment="Center">
                                    <TextBlock Text="&#xE706;" FontFamily="Segoe MDL2 Assets" FontSize="17"
                                               Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                </Border>
                                <StackPanel Grid.Column="1" VerticalAlignment="Center">
                                    <TextBlock Text="투명도" Style="{StaticResource RowLabel}"/>
                                    <TextBlock Text="AX Commander 창의 배경 불투명도" Style="{StaticResource RowHint}"/>
                                </StackPanel>
                                <StackPanel Grid.Column="2" Orientation="Horizontal" VerticalAlignment="Center">
                                    <Slider Minimum="0.4" Maximum="1.0"
                                            Value="{Binding Opacity, UpdateSourceTrigger=PropertyChanged}"
                                            Width="140" SmallChange="0.01" LargeChange="0.1"
                                            VerticalAlignment="Center"/>
                                    <Border Width="46" Height="28" CornerRadius="6" Background="#EEF0FF"
                                            Margin="8,0,0,0" VerticalAlignment="Center">
                                        <TextBlock FontSize="12" FontWeight="SemiBold" Foreground="#4B5EFC"
                                                   HorizontalAlignment="Center" VerticalAlignment="Center">
                                            <TextBlock.Text>
                                                <Binding Path="OpacityPercent" StringFormat="{}{0}%"/>
                                            </TextBlock.Text>
                                        </TextBlock>
                                    </Border>
                                </StackPanel>
                            </Grid>
                        </Border>

                        <!-- 런처 위치 -->
                        <Border Style="{StaticResource SettingsRow}">
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="*"/>
                                    <ColumnDefinition Width="200"/>
                                </Grid.ColumnDefinitions>
                                <Border Grid.Column="0" Width="36" Height="36" CornerRadius="9"
                                        Background="#5B4E7E" Margin="0,0,14,0" VerticalAlignment="Center">
                                    <TextBlock Text="&#xE81D;" FontFamily="Segoe MDL2 Assets" FontSize="17"
                                               Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                </Border>
                                <StackPanel Grid.Column="1" VerticalAlignment="Center">
                                    <TextBlock Text="AX Commander 위치" Style="{StaticResource RowLabel}"/>
                                    <TextBlock Text="AX Commander 창이 나타날 화면 위치" Style="{StaticResource RowHint}"/>
                                </StackPanel>
                                <ComboBox Grid.Column="2"
                                          SelectedValue="{Binding LauncherPosition}"
                                          SelectedValuePath="Tag"
                                          Height="32" FontSize="12"
                                          VerticalContentAlignment="Center">
                                    <ComboBoxItem Tag="center-top" Content="화면 상단 중앙 (기본)"/>
                                    <ComboBoxItem Tag="center"     Content="화면 정중앙"/>
                                    <ComboBoxItem Tag="bottom"     Content="화면 하단 중앙"/>
                                </ComboBox>
                            </Grid>
                        </Border>

                        <!-- 언어 -->
                        <Border Style="{StaticResource SettingsRow}">
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="*"/>
                                    <ColumnDefinition Width="200"/>
                                </Grid.ColumnDefinitions>
                                <Border Grid.Column="0" Width="36" Height="36" CornerRadius="9"
                                        Background="#6366F1" Margin="0,0,14,0" VerticalAlignment="Center">
                                    <TextBlock Text="&#xF2B7;" FontFamily="Segoe MDL2 Assets" FontSize="17"
                                               Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                </Border>
                                <StackPanel Grid.Column="1" VerticalAlignment="Center">
                                    <TextBlock Text="Language" Style="{StaticResource RowLabel}"/>
                                    <TextBlock Text="UI language (apply after save)" Style="{StaticResource RowHint}"/>
                                </StackPanel>
                                <ComboBox Grid.Column="2"
                                          SelectedValue="{Binding Language}"
                                          SelectedValuePath="Tag"
                                          Height="32" FontSize="12"
                                          VerticalContentAlignment="Center">
                                    <ComboBoxItem Tag="ko" Content="한국어"/>
                                    <ComboBoxItem Tag="en" Content="English"/>
                                    <ComboBoxItem Tag="ja" Content="日本語"/>
                                    <ComboBoxItem Tag="zh" Content="中文"/>
                                    <ComboBoxItem Tag="vi" Content="Tiếng Việt"/>
                                </ComboBox>
                            </Grid>
                        </Border>

                        <!-- ─── 인덱스 경로 ──────────────────────────────────────────────── -->
                        <TextBlock Text="인덱스 경로" Style="{StaticResource SectionHeader}"/>

                        <!-- 안내 배너 -->
                        <Border Background="White" CornerRadius="10" Padding="14,10" Margin="0,0,0,3">
                            <StackPanel Orientation="Horizontal">
                                <Border Width="36" Height="36" CornerRadius="9"
                                        Background="#1A8C4E" Margin="0,0,14,0" VerticalAlignment="Center">
                                    <TextBlock Text="&#xE838;" FontFamily="Segoe MDL2 Assets" FontSize="16"
                                               Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                </Border>
                                <StackPanel VerticalAlignment="Center">
                                    <TextBlock Text="검색할 폴더 목록" Style="{StaticResource RowLabel}"/>
                                    <TextBlock Text="앱·파일 퍼지 검색 대상 경로 (환경변수 사용 가능)" Style="{StaticResource RowHint}"/>
                                </StackPanel>
                            </StackPanel>
                        </Border>

                        <!-- 경로 목록 -->
                        <Border Background="White" CornerRadius="10" Padding="10,8" Margin="0,0,0,3">
                            <ItemsControl ItemsSource="{Binding IndexPaths}">
                                <ItemsControl.ItemTemplate>
                                    <DataTemplate>
                                        <Grid Margin="0,2">
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition Width="*"/>
                                                <ColumnDefinition Width="Auto"/>
                                            </Grid.ColumnDefinitions>
                                            <TextBlock Grid.Column="0" Text="{Binding}"
                                                       FontSize="12" Foreground="#333350"
                                                       VerticalAlignment="Center" Margin="4,0,8,0"
                                                       TextTrimming="CharacterEllipsis"
                                                       ToolTip="{Binding}"/>
                                            <Button Grid.Column="1"
                                                    Style="{StaticResource DeleteButton}"
                                                    Tag="{Binding}"
                                                    Click="RemoveIndexPath_Click"/>
                                        </Grid>
                                    </DataTemplate>
                                </ItemsControl.ItemTemplate>
                            </ItemsControl>
                        </Border>

                        <!-- 경로 추가 -->
                        <Border Background="White" CornerRadius="10" Padding="10,8" Margin="0,0,0,3">
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="*"/>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="Auto"/>
                                </Grid.ColumnDefinitions>
                                <TextBox x:Name="NewIndexPathBox"
                                         Grid.Column="0"
                                         Style="{StaticResource ModernTextBox}"
                                         VerticalAlignment="Center"
                                         Margin="0,0,8,0"/>
                                <Button Grid.Column="1" Content="찾아보기"
                                        Style="{StaticResource SecondaryButton}"
                                        Padding="12,6" FontSize="12"
                                        Margin="0,0,6,0"
                                        Click="BrowseIndexPath_Click"/>
                                <Button Grid.Column="2" Content="추가"
                                        Style="{StaticResource PrimaryButton}"
                                        Padding="14,6" FontSize="12"
                                        Click="AddIndexPath_Click"/>
                            </Grid>
                        </Border>

                        <!-- 검색 확장자 -->
                        <Border Background="#F0F0F5" CornerRadius="10" Padding="14,10" Margin="0,12,0,3">
                            <StackPanel>
                                <StackPanel Orientation="Horizontal" Margin="0,0,0,4">
                                    <Border Width="28" Height="28" CornerRadius="7" Background="#E08850" Margin="0,0,8,0">
                                        <TextBlock Text="&#xE8E5;" FontFamily="Segoe MDL2 Assets"
                                                   FontSize="13" Foreground="White"
                                                   HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                    </Border>
                                    <StackPanel VerticalAlignment="Center">
                                        <TextBlock Text="검색할 확장자" FontSize="13" FontWeight="SemiBold" Foreground="#1A1B2E"/>
                                        <TextBlock Text="인덱싱할 파일 확장자 (비어있으면 모든 파일)" FontSize="10.5" Foreground="#9999BB"/>
                                    </StackPanel>
                                </StackPanel>
                            </StackPanel>
                        </Border>

                        <Border Background="White" CornerRadius="10" Padding="10,8" Margin="0,0,0,3">
                            <ItemsControl ItemsSource="{Binding IndexExtensions}">
                                <ItemsControl.ItemsPanel>
                                    <ItemsPanelTemplate>
                                        <WrapPanel/>
                                    </ItemsPanelTemplate>
                                </ItemsControl.ItemsPanel>
                                <ItemsControl.ItemTemplate>
                                    <DataTemplate>
                                        <Border Background="#EEEEF5" CornerRadius="6" Padding="8,3" Margin="2,2">
                                            <StackPanel Orientation="Horizontal">
                                                <TextBlock Text="{Binding}" FontSize="11.5" Foreground="#333350"
                                                           VerticalAlignment="Center"/>
                                                <Button Content="&#xE711;" FontFamily="Segoe MDL2 Assets"
                                                        FontSize="9" Foreground="#AAAACC"
                                                        Background="Transparent" BorderThickness="0"
                                                        Padding="4,0,0,0" Cursor="Hand"
                                                        VerticalAlignment="Center"
                                                        Tag="{Binding}"
                                                        Click="RemoveExtension_Click"/>
                                            </StackPanel>
                                        </Border>
                                    </DataTemplate>
                                </ItemsControl.ItemTemplate>
                            </ItemsControl>
                        </Border>

                        <Border Background="White" CornerRadius="10" Padding="10,8" Margin="0,0,0,3">
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="*"/>
                                    <ColumnDefinition Width="Auto"/>
                                </Grid.ColumnDefinitions>
                                <TextBox x:Name="NewExtensionBox"
                                         Grid.Column="0"
                                         Style="{StaticResource ModernTextBox}"
                                         VerticalAlignment="Center"
                                         Margin="0,0,8,0"/>
                                <Button Grid.Column="1" Content="추가"
                                        Style="{StaticResource PrimaryButton}"
                                        Padding="14,6" FontSize="12"
                                        Click="AddExtension_Click"/>
                            </Grid>
                        </Border>

                        <!-- 인덱싱 속도 -->
                        <Border Style="{StaticResource SettingsRow}">
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="*"/>
                                    <ColumnDefinition Width="160"/>
                                </Grid.ColumnDefinitions>
                                <Border Grid.Column="0" Width="36" Height="36" CornerRadius="9"
                                        Background="#10B981" Margin="0,0,14,0" VerticalAlignment="Center">
                                    <TextBlock Text="&#xE916;" FontFamily="Segoe MDL2 Assets" FontSize="17"
                                               Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                </Border>
                                <StackPanel Grid.Column="1" VerticalAlignment="Center">
                                    <TextBlock Text="인덱싱 속도" Style="{StaticResource RowLabel}"/>
                                    <TextBlock Text="{Binding IndexSpeedHint}"
                                               FontSize="10.5" Foreground="#CC8800"
                                               TextWrapping="Wrap"/>
                                </StackPanel>
                                <ComboBox Grid.Column="2"
                                          SelectedValue="{Binding IndexSpeed}"
                                          SelectedValuePath="Tag"
                                          Height="32" FontSize="12"
                                          VerticalContentAlignment="Center">
                                    <ComboBoxItem Tag="slow" Content="느리게 (PC 부하 최소)"/>
                                    <ComboBoxItem Tag="normal" Content="보통 (권장)"/>
                                    <ComboBoxItem Tag="fast" Content="빠르게 (고성능 PC)"/>
                                </ComboBox>
                            </Grid>
                        </Border>

                    </StackPanel>
                    </ScrollViewer>
                    <!-- 알림 패널 (하위 탭) — 기존 알림 탭 내용을 여기로 통합 -->
                    <ScrollViewer x:Name="GeneralNotifyPanel" Grid.Row="2" Visibility="Collapsed"
                                  VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled">
                        <StackPanel x:Name="NotifyContent">
                            <!-- 이 내용은 기존 알림 탭에서 이동함 -->
                        </StackPanel>
                    </ScrollViewer>
                    <!-- 저장 공간 패널 (하위 탭) -->
                    <ScrollViewer x:Name="GeneralStoragePanel" Grid.Row="2" Visibility="Collapsed"
                                  VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled">
                        <StackPanel Margin="0,6,0,0">
                            <TextBlock Text="저장 공간 현황" Style="{StaticResource SectionHeader}"/>
                            <Border Style="{StaticResource SettingsRow}">
                                <StackPanel>
                                    <Grid>
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="*"/>
                                            <ColumnDefinition Width="Auto"/>
                                        </Grid.ColumnDefinitions>
                                        <StackPanel Grid.Column="0">
                                            <TextBlock x:Name="StorageSummaryText2" Style="{StaticResource RowLabel}" Text="분석 중..."/>
                                            <TextBlock x:Name="StorageDriveText2" Style="{StaticResource RowHint}" Text=""/>
                                        </StackPanel>
                                        <StackPanel Grid.Column="1" Orientation="Horizontal">
                                            <Button Content="새로고침" Click="BtnStorageRefresh2_Click"
                                                    Background="Transparent" BorderThickness="0"
                                                    Foreground="#4B5EFC" FontSize="12" Cursor="Hand" Padding="8,4" Margin="0,0,8,0"/>
                                            <Button Content="저장 공간 줄이기" Click="BtnStorageCleanup_Click"
                                                    Background="#DC2626" Foreground="White" FontSize="12"
                                                    Padding="14,6" Cursor="Hand" BorderThickness="0">
                                                <Button.Template>
                                                    <ControlTemplate TargetType="Button">
                                                        <Border Background="{TemplateBinding Background}" CornerRadius="8"
                                                                Padding="{TemplateBinding Padding}">
                                                            <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                                        </Border>
                                                    </ControlTemplate>
                                                </Button.Template>
                                            </Button>
                                        </StackPanel>
                                    </Grid>
                                    <StackPanel x:Name="StorageDetailPanel2" Margin="0,10,0,0"/>
                                </StackPanel>
                            </Border>
                        </StackPanel>
                    </ScrollViewer>
                </Grid>
            </TabItem>

            <!-- ════════════════════════════════════════════════════════════ -->
            <!-- 2. 테마 탭 (테마 선택 + 색상 편집 합침)                          -->
            <!-- ════════════════════════════════════════════════════════════ -->
            <TabItem Header="테마" Tag="&#xE790;" Style="{StaticResource SideNavItem}">
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="*"/>
                    </Grid.RowDefinitions>
                    <TextBlock Grid.Row="0" Text="테마 설정" FontSize="16" FontWeight="SemiBold" Foreground="#1A1B2E" Margin="0,0,0,2"/>
                    <Border Grid.Row="1" Background="#EEEEF2" CornerRadius="8" Padding="3" Margin="0,4,0,8">
                        <StackPanel Orientation="Horizontal">
                            <RadioButton x:Name="ThemeSubTabSelect" Content="테마 선택" IsChecked="True"
                                         GroupName="ThemeSubTab" Style="{StaticResource AgentSubTabStyle}"
                                         Checked="ThemeSubTab_Checked"/>
                            <RadioButton x:Name="ThemeSubTabColors" Content="색상 편집"
                                         GroupName="ThemeSubTab" Style="{StaticResource AgentSubTabStyle}"
                                         Checked="ThemeSubTab_Checked"/>
                        </StackPanel>
                    </Border>
                    <!-- 테마 선택 패널 -->
                    <ScrollViewer x:Name="ThemeSelectPanel" Grid.Row="2" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled">
                    <StackPanel>
                        <!-- ── 시각 효과 ── -->
                        <TextBlock Text="시각 효과" Style="{StaticResource SectionHeader}"/>
                        <Border Style="{StaticResource SettingsRow}">
                            <Grid>
                                <StackPanel HorizontalAlignment="Left" Margin="0,0,60,0">
                                    <StackPanel Orientation="Horizontal">
                                        <TextBlock Style="{StaticResource RowLabel}" Text="런처 무지개 글로우"/>
                                        <Border Width="16" Height="16" CornerRadius="8" Background="#EEF0FF" Margin="6,0,0,0" Cursor="Help" VerticalAlignment="Center">
                                            <TextBlock Text="?" FontSize="10" FontWeight="Bold" Foreground="#4B5EFC" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                            <Border.ToolTip>
                                                <ToolTip Style="{StaticResource HelpTooltipStyle}">
                                                    <TextBlock TextWrapping="Wrap" Foreground="White" FontSize="12" LineHeight="18">
                                                        AX Commander 테두리에 무지개빛 회전 애니메이션을 표시합니다.
                                                        <LineBreak/>GPU 가속을 사용하므로 저사양 PC에서는 끄는 것을 권장합니다.
                                                    </TextBlock>
                                                </ToolTip>
                                            </Border.ToolTip>
                                        </Border>
                                    </StackPanel>
                                    <TextBlock Style="{StaticResource RowHint}" Text="AX Commander 테두리에 무지개빛 글로우 효과를 표시합니다. 저사양 PC에서는 끄는 것을 권장합니다."/>
                                </StackPanel>
                                <CheckBox Style="{StaticResource ToggleSwitch}" HorizontalAlignment="Right" VerticalAlignment="Center"
                                          IsChecked="{Binding EnableRainbowGlow, Mode=TwoWay}"/>
                            </Grid>
                        </Border>
                        <Border Style="{StaticResource SettingsRow}">
                            <Grid>
                                <StackPanel HorizontalAlignment="Left" Margin="0,0,60,0">
                                    <TextBlock Style="{StaticResource RowLabel}" Text="선택 아이템 글로우"/>
                                    <TextBlock Style="{StaticResource RowHint}" Text="선택된 항목에 은은한 글로우를 상시 표시합니다. 테마 AccentColor를 기반으로 색상이 적용됩니다."/>
                                </StackPanel>
                                <CheckBox Style="{StaticResource ToggleSwitch}" HorizontalAlignment="Right" VerticalAlignment="Center"
                                          IsChecked="{Binding EnableSelectionGlow, Mode=TwoWay}"/>
                            </Grid>
                        </Border>
                        <Border Style="{StaticResource SettingsRow}">
                            <Grid>
                                <StackPanel HorizontalAlignment="Left" Margin="0,0,60,0">
                                    <TextBlock Style="{StaticResource RowLabel}" Text="채팅 입력창 무지개 글로우"/>
                                    <TextBlock Style="{StaticResource RowHint}" Text="메시지 전송 시 입력창 테두리에 무지개빛 글로우 효과를 표시합니다. 저사양 PC에서는 끄는 것을 권장합니다."/>
                                </StackPanel>
                                <CheckBox Style="{StaticResource ToggleSwitch}" HorizontalAlignment="Right" VerticalAlignment="Center"
                                          IsChecked="{Binding EnableChatRainbowGlow, Mode=TwoWay}"/>
                            </Grid>
                        </Border>

                        <TextBlock Text="테마 선택" Style="{StaticResource SectionHeader}"/>
                        <Border Background="White" CornerRadius="10" Padding="14,10" Margin="0,0,0,14">
                            <StackPanel Orientation="Horizontal">
                                <TextBlock Text="&#xE946;" FontFamily="Segoe MDL2 Assets" FontSize="13"
                                           Foreground="#4B5EFC" VerticalAlignment="Center" Margin="0,0,8,0"/>
                                <TextBlock Text="카드를 클릭하면 즉시 AX Commander에 미리보기가 적용됩니다."
                                           FontSize="12" Foreground="#7777AA" VerticalAlignment="Center"/>
                            </StackPanel>
                        </Border>

                        <ItemsControl x:Name="ThemeCardsPanel" ItemsSource="{Binding ThemeCards}">
                            <ItemsControl.ItemsPanel>
                                <ItemsPanelTemplate>
                                    <WrapPanel Orientation="Horizontal"/>
                                </ItemsPanelTemplate>
                            </ItemsControl.ItemsPanel>
                            <ItemsControl.ItemTemplate>
                                <DataTemplate DataType="{x:Type vm:ThemeCardModel}">
                                    <Button x:Name="CardBtn"
                                            Width="188" Height="148"
                                            Margin="0,0,10,10"
                                            Tag="{Binding Key}"
                                            Click="ThemeCard_Click">
                                        <Button.Background>
                                            <SolidColorBrush Color="{Binding PreviewBackground, Converter={x:Static converters:HexToColorConverter.Instance}}"/>
                                        </Button.Background>
                                        <Button.Style>
                                            <Style TargetType="Button" BasedOn="{StaticResource ThemeCard}">
                                                <Setter Property="BorderBrush" Value="#DDDDEE"/>
                                                <Style.Triggers>
                                                    <DataTrigger Binding="{Binding IsSelected}" Value="True">
                                                        <Setter Property="BorderBrush" Value="#4B5EFC"/>
                                                    </DataTrigger>
                                                </Style.Triggers>
                                            </Style>
                                        </Button.Style>
                                        <Grid>
                                            <Grid.RowDefinitions>
                                                <RowDefinition Height="*"/>
                                                <RowDefinition Height="38"/>
                                            </Grid.RowDefinitions>
                                            <!-- 미니 런처 미리보기 -->
                                            <Border Grid.Row="0" Padding="10,10,10,6">
                                                <Border CornerRadius="6" Padding="8,6">
                                                    <Border.Background>
                                                        <SolidColorBrush Color="{Binding PreviewItem, Converter={x:Static converters:HexToColorConverter.Instance}}"/>
                                                    </Border.Background>
                                                    <StackPanel>
                                                        <Grid Margin="0,0,0,5">
                                                            <Grid.ColumnDefinitions>
                                                                <ColumnDefinition Width="8"/>
                                                                <ColumnDefinition Width="*"/>
                                                            </Grid.ColumnDefinitions>
                                                            <Border Width="6" Height="6" CornerRadius="3" VerticalAlignment="Center" Margin="0,0,4,0">
                                                                <Border.Background><SolidColorBrush Color="{Binding PreviewAccent, Converter={x:Static converters:HexToColorConverter.Instance}}"/></Border.Background>
                                                            </Border>
                                                            <Border Grid.Column="1" Height="5" CornerRadius="3" Margin="2,0,12,0" VerticalAlignment="Center">
                                                                <Border.Background><SolidColorBrush Color="{Binding PreviewSubText, Converter={x:Static converters:HexToColorConverter.Instance}}"/></Border.Background>
                                                            </Border>
                                                        </Grid>
                                                        <Border Height="14" CornerRadius="3" Margin="0,0,0,3" Padding="5,0">
                                                            <Border.Background><SolidColorBrush Color="{Binding PreviewAccent, Converter={x:Static converters:HexToColorConverter.Instance}}" Opacity="0.28"/></Border.Background>
                                                            <Border Width="5" Height="5" CornerRadius="2.5" HorizontalAlignment="Left" VerticalAlignment="Center">
                                                                <Border.Background><SolidColorBrush Color="{Binding PreviewAccent, Converter={x:Static converters:HexToColorConverter.Instance}}"/></Border.Background>
                                                            </Border>
                                                        </Border>
                                                        <Border Height="11" CornerRadius="3" Margin="0,0,0,3">
                                                            <Border.Background><SolidColorBrush Color="{Binding PreviewBackground, Converter={x:Static converters:HexToColorConverter.Instance}}" Opacity="0.4"/></Border.Background>
                                                        </Border>
                                                        <Border Height="11" CornerRadius="3">
                                                            <Border.Background><SolidColorBrush Color="{Binding PreviewBackground, Converter={x:Static converters:HexToColorConverter.Instance}}" Opacity="0.4"/></Border.Background>
                                                        </Border>
                                                    </StackPanel>
                                                </Border>
                                            </Border>
                                            <!-- 하단 정보 바 -->
                                            <Border Grid.Row="1" Padding="10,0,8,0">
                                                <Border.Background>
                                                    <SolidColorBrush Color="{Binding PreviewItem, Converter={x:Static converters:HexToColorConverter.Instance}}" Opacity="0.7"/>
                                                </Border.Background>
                                                <Grid>
                                                    <TextBlock Text="{Binding Name}" FontSize="11" FontWeight="SemiBold" VerticalAlignment="Center">
                                                        <TextBlock.Foreground><SolidColorBrush Color="{Binding PreviewText, Converter={x:Static converters:HexToColorConverter.Instance}}"/></TextBlock.Foreground>
                                                    </TextBlock>
                                                    <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Center">
                                                        <Ellipse Width="8" Height="8" Margin="0,0,3,0"><Ellipse.Fill><SolidColorBrush Color="{Binding PreviewBackground, Converter={x:Static converters:HexToColorConverter.Instance}}"/></Ellipse.Fill></Ellipse>
                                                        <Ellipse Width="8" Height="8" Margin="0,0,3,0"><Ellipse.Fill><SolidColorBrush Color="{Binding PreviewAccent,     Converter={x:Static converters:HexToColorConverter.Instance}}"/></Ellipse.Fill></Ellipse>
                                                        <Ellipse Width="8" Height="8" Margin="0,0,4,0"><Ellipse.Fill><SolidColorBrush Color="{Binding PreviewText,       Converter={x:Static converters:HexToColorConverter.Instance}}"/></Ellipse.Fill></Ellipse>
                                                        <TextBlock Text="&#xE73E;" FontFamily="Segoe MDL2 Assets" FontSize="10"
                                                                   Foreground="#4B5EFC" VerticalAlignment="Center"
                                                                   Visibility="{Binding IsSelected, Converter={StaticResource BoolToVisibilityConverter}}"/>
                                                    </StackPanel>
                                                </Grid>
                                            </Border>
                                        </Grid>
                                    </Button>
                                </DataTemplate>
                            </ItemsControl.ItemTemplate>
                        </ItemsControl>

                    </StackPanel>
                    </ScrollViewer>
                    <!-- 색상 편집 패널 -->
                    <Grid x:Name="ThemeColorsPanel" Grid.Row="2" Visibility="Collapsed">
                    <!-- 커스텀 테마 미선택 안내 -->
                    <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center"
                                Visibility="{Binding IsCustomTheme, Converter={StaticResource InverseBoolToVisibilityConverter}}">
                        <Border Width="64" Height="64" CornerRadius="18" Background="#EEF0FF"
                                HorizontalAlignment="Center" Margin="0,0,0,16">
                            <TextBlock Text="&#xE771;" FontFamily="Segoe MDL2 Assets"
                                       FontSize="32" Foreground="#4B5EFC"
                                       HorizontalAlignment="Center" VerticalAlignment="Center"/>
                        </Border>
                        <TextBlock Text="커스텀 테마를 선택하세요"
                                   FontSize="15" FontWeight="SemiBold"
                                   Foreground="#333350" HorizontalAlignment="Center"/>
                        <TextBlock Text="위 '테마 선택' 탭에서 '커스텀'을 선택하면 각 색상을 편집할 수 있습니다."
                                   FontSize="12" Foreground="#9999BB"
                                   HorizontalAlignment="Center" Margin="0,6,0,0" TextWrapping="Wrap"
                                   MaxWidth="300" TextAlignment="Center"/>
                    </StackPanel>

                    <!-- 색상 편집 목록 -->
                    <ScrollViewer VerticalScrollBarVisibility="Auto"
                                  Visibility="{Binding IsCustomTheme, Converter={StaticResource BoolToVisibilityConverter}}">
                        <StackPanel>
                            <TextBlock Text="커스텀 색상" Style="{StaticResource SectionHeader}"/>
                            <Border Background="White" CornerRadius="10" Padding="14,10" Margin="0,0,0,12">
                                <StackPanel Orientation="Horizontal">
                                    <TextBlock Text="&#xE946;" FontFamily="Segoe MDL2 Assets" FontSize="13"
                                               Foreground="#4B5EFC" VerticalAlignment="Center" Margin="0,0,8,0"/>
                                    <TextBlock Text="색상 버튼 클릭 또는 헥스 코드 직접 입력 (#RRGGBB)"
                                               FontSize="12" Foreground="#7777AA" VerticalAlignment="Center"/>
                                </StackPanel>
                            </Border>
                            <ItemsControl ItemsSource="{Binding ColorRows}">
                                <ItemsControl.ItemTemplate>
                                    <DataTemplate DataType="{x:Type vm:ColorRowModel}">
                                        <Border Style="{StaticResource SettingsRow}">
                                            <Grid>
                                                <Grid.ColumnDefinitions>
                                                    <ColumnDefinition Width="160"/>
                                                    <ColumnDefinition Width="*"/>
                                                    <ColumnDefinition Width="Auto"/>
                                                </Grid.ColumnDefinitions>
                                                <TextBlock Grid.Column="0" Text="{Binding Label}"
                                                           Style="{StaticResource RowLabel}"/>
                                                <TextBox Grid.Column="1"
                                                         Style="{StaticResource ModernTextBox}"
                                                         Text="{Binding Hex, UpdateSourceTrigger=PropertyChanged}"
                                                         FontFamily="Consolas, Courier New"
                                                         MaxLength="9" VerticalAlignment="Center" Margin="8,0"/>
                                                <Button Grid.Column="2"
                                                        Style="{StaticResource ColorSwatchButton}"
                                                        Background="{Binding Preview}"
                                                        Tag="{Binding}" Click="ColorSwatch_Click"
                                                        ToolTip="클릭하여 색상 선택"/>
                                            </Grid>
                                        </Border>
                                    </DataTemplate>
                                </ItemsControl.ItemTemplate>
                            </ItemsControl>

                            <TextBlock Text="모양 (모서리 라운딩)" Style="{StaticResource SectionHeader}"/>

                            <!-- 창 전체 모서리 -->
                            <Border Style="{StaticResource SettingsRow}">
                                <Grid>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="Auto"/>
                                        <ColumnDefinition Width="*"/>
                                        <ColumnDefinition Width="40"/>
                                    </Grid.ColumnDefinitions>
                                    <Border Grid.Column="0" Width="36" Height="36" CornerRadius="9"
                                            Background="#7C3AED" Margin="0,0,14,0" VerticalAlignment="Center">
                                        <TextBlock Text="&#xE8A0;" FontFamily="Segoe MDL2 Assets" FontSize="17"
                                                   Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                    </Border>
                                    <StackPanel Grid.Column="1" VerticalAlignment="Center">
                                        <TextBlock Text="창 모서리 라운딩" Style="{StaticResource RowLabel}"/>
                                        <Slider Minimum="0" Maximum="30"
                                                Value="{Binding CustomWindowCornerRadius}"
                                                TickFrequency="2" IsSnapToTickEnabled="True"
                                                Margin="0,6,0,0"/>
                                    </StackPanel>
                                    <TextBlock Grid.Column="2"
                                               Text="{Binding CustomWindowCornerRadius, StringFormat={}{0}px}"
                                               FontFamily="Consolas" FontSize="12" Foreground="#7777AA"
                                               VerticalAlignment="Center" HorizontalAlignment="Center"/>
                                </Grid>
                            </Border>

                            <!-- 항목 모서리 -->
                            <Border Style="{StaticResource SettingsRow}">
                                <Grid>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="Auto"/>
                                        <ColumnDefinition Width="*"/>
                                        <ColumnDefinition Width="40"/>
                                    </Grid.ColumnDefinitions>
                                    <Border Grid.Column="0" Width="36" Height="36" CornerRadius="9"
                                            Background="#4B5EFC" Margin="0,0,14,0" VerticalAlignment="Center">
                                        <TextBlock Text="&#xE8A0;" FontFamily="Segoe MDL2 Assets" FontSize="17"
                                                   Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                    </Border>
                                    <StackPanel Grid.Column="1" VerticalAlignment="Center">
                                        <TextBlock Text="항목 모서리 라운딩" Style="{StaticResource RowLabel}"/>
                                        <Slider Minimum="0" Maximum="20"
                                                Value="{Binding CustomItemCornerRadius}"
                                                TickFrequency="2" IsSnapToTickEnabled="True"
                                                Margin="0,6,0,0"/>
                                    </StackPanel>
                                    <TextBlock Grid.Column="2"
                                               Text="{Binding CustomItemCornerRadius, StringFormat={}{0}px}"
                                               FontFamily="Consolas" FontSize="12" Foreground="#7777AA"
                                               VerticalAlignment="Center" HorizontalAlignment="Center"/>
                                </Grid>
                            </Border>

                        </StackPanel>
                    </ScrollViewer>
                    </Grid>
                </Grid>
            </TabItem>

            <!-- ════════════════════════════════════════════════════════════ -->
            <!-- 독 바 설정 탭                                                 -->
            <!-- ════════════════════════════════════════════════════════════ -->
            <TabItem Header="독 바" Tag="&#xE8A0;" Style="{StaticResource SideNavItem}">
                <ScrollViewer VerticalScrollBarVisibility="Auto">
                    <StackPanel>

                        <TextBlock Text="독 바 기본" Style="{StaticResource SectionHeader}"/>

                        <!-- 자동 표시 -->
                        <Border Style="{StaticResource SettingsRow}">
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="*"/>
                                    <ColumnDefinition Width="Auto"/>
                                </Grid.ColumnDefinitions>
                                <StackPanel Grid.Column="0" VerticalAlignment="Center">
                                    <TextBlock Text="앱 시작 시 독 바 자동 표시" Style="{StaticResource RowLabel}"/>
                                    <TextBlock Text="AX Copilot 시작 시 독 바를 자동으로 띄웁니다" Style="{StaticResource RowHint}"/>
                                </StackPanel>
                                <CheckBox x:Name="ChkDockAutoShow" Grid.Column="1"
                                          Style="{StaticResource ToggleSwitch}"
                                          HorizontalAlignment="Right" VerticalAlignment="Center"/>
                            </Grid>
                        </Border>

                        <!-- 무지개 글로우 -->
                        <Border Style="{StaticResource SettingsRow}">
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="*"/>
                                    <ColumnDefinition Width="Auto"/>
                                </Grid.ColumnDefinitions>
                                <StackPanel Grid.Column="0" VerticalAlignment="Center">
                                    <TextBlock Text="무지개 글로우 효과" Style="{StaticResource RowLabel}"/>
                                    <TextBlock Text="독 바 테두리에 무지개 애니메이션을 표시합니다" Style="{StaticResource RowHint}"/>
                                </StackPanel>
                                <CheckBox x:Name="ChkDockRainbowGlow" Grid.Column="1"
                                          Style="{StaticResource ToggleSwitch}"
                                          HorizontalAlignment="Right" VerticalAlignment="Center"/>
                            </Grid>
                        </Border>

                        <!-- 투명도 -->
                        <Border Style="{StaticResource SettingsRow}">
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="*"/>
                                    <ColumnDefinition Width="120"/>
                                </Grid.ColumnDefinitions>
                                <StackPanel Grid.Column="0" VerticalAlignment="Center">
                                    <TextBlock Text="독 바 투명도" Style="{StaticResource RowLabel}"/>
                                    <TextBlock Text="0.3 (반투명) ~ 1.0 (불투명)" Style="{StaticResource RowHint}"/>
                                </StackPanel>
                                <Slider x:Name="SliderDockOpacity" Grid.Column="1"
                                        Minimum="0.3" Maximum="1.0" Value="0.92"
                                        TickFrequency="0.05" IsSnapToTickEnabled="True"
                                        VerticalAlignment="Center"/>
                            </Grid>
                        </Border>

                        <!-- 위치 재조정 -->
                        <Border Style="{StaticResource SettingsRow}">
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="*"/>
                                    <ColumnDefinition Width="Auto"/>
                                </Grid.ColumnDefinitions>
                                <StackPanel Grid.Column="0" VerticalAlignment="Center">
                                    <TextBlock Text="독 바 위치 초기화" Style="{StaticResource RowLabel}"/>
                                    <TextBlock Text="독 바를 화면 하단 중앙으로 되돌립니다" Style="{StaticResource RowHint}"/>
                                </StackPanel>
                                <Button Grid.Column="1" Content="중앙으로 이동"
                                        Click="BtnDockResetPosition_Click"
                                        Background="#4B5EFC" Foreground="White"
                                        FontSize="12" Padding="14,6" Cursor="Hand"
                                        BorderThickness="0">
                                    <Button.Template>
                                        <ControlTemplate TargetType="Button">
                                            <Border Background="{TemplateBinding Background}" CornerRadius="8"
                                                    Padding="{TemplateBinding Padding}">
                                                <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                            </Border>
                                        </ControlTemplate>
                                    </Button.Template>
                                </Button>
                            </Grid>
                        </Border>

                        <TextBlock Text="표시 항목" Style="{StaticResource SectionHeader}"/>
                        <Border Style="{StaticResource SettingsRow}">
                            <StackPanel>
                                <TextBlock Style="{StaticResource RowHint}" Text="독 바에 표시할 항목을 선택하세요. 변경 후 독 바를 다시 열면 적용됩니다."/>
                                <StackPanel x:Name="DockItemsPanel" Margin="0,8,0,0"/>
                            </StackPanel>
                        </Border>

                    </StackPanel>
                </ScrollViewer>
            </TabItem>
            <!-- 4. 스니펫 탭                                                  -->
            <!-- ════════════════════════════════════════════════════════════ -->
            <TabItem Header="스니펫" Tag="&#xE70B;" Style="{StaticResource SideNavItem}">
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="*"/>
                    </Grid.RowDefinitions>

                    <StackPanel Grid.Row="0">
                        <TextBlock Text="자동 확장" Style="{StaticResource SectionHeader}"/>
                        <!-- 자동 확장 토글 -->
                        <Border Style="{StaticResource SettingsRow}">
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="*"/>
                                    <ColumnDefinition Width="Auto"/>
                                </Grid.ColumnDefinitions>
                                <Border Grid.Column="0" Width="36" Height="36" CornerRadius="9"
                                        Background="#FF6B35" Margin="0,0,14,0" VerticalAlignment="Center">
                                    <TextBlock Text="&#xE70B;" FontFamily="Segoe MDL2 Assets" FontSize="17"
                                               Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                </Border>
                                <StackPanel Grid.Column="1" VerticalAlignment="Center">
                                    <TextBlock Text="글로벌 스니펫 자동 확장" Style="{StaticResource RowLabel}"/>
                                    <TextBlock Text=";키워드 + Space/Enter → 모든 앱에서 텍스트 자동 입력" Style="{StaticResource RowHint}"/>
                                </StackPanel>
                                <CheckBox Grid.Column="2"
                                          Style="{StaticResource ToggleSwitch}"
                                          IsChecked="{Binding SnippetAutoExpand}"
                                          VerticalAlignment="Center"/>
                            </Grid>
                        </Border>

                        <TextBlock Text="텍스트 스니펫" Style="{StaticResource SectionHeader}"/>
                        <!-- 안내 배너 -->
                        <Border Background="White" CornerRadius="10" Padding="14,11" Margin="0,0,0,10">
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="*"/>
                                </Grid.ColumnDefinitions>
                                <Border Grid.Column="0" Width="36" Height="36" CornerRadius="9"
                                        Background="#FF6B35" Margin="0,0,12,0" VerticalAlignment="Center">
                                    <TextBlock Text="&#xE70B;" FontFamily="Segoe MDL2 Assets" FontSize="17"
                                               Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                </Border>
                                <StackPanel Grid.Column="1" VerticalAlignment="Center">
                                    <TextBlock FontSize="12" Foreground="#444466" TextWrapping="Wrap">
                                        AX Commander에서 <Run FontWeight="SemiBold" Foreground="#4B5EFC">;</Run> 다음 키워드를 입력하면 미리 저장된 텍스트를 즉시 붙여넣습니다.
                                    </TextBlock>
                                    <TextBlock FontSize="11" Foreground="#9999BB" Margin="0,3,0,0">
                                        변수: <Run FontFamily="Consolas" Foreground="#FF6B35">{date}</Run>
                                        <Run FontFamily="Consolas" Foreground="#FF6B35"> {time}</Run>
                                        <Run FontFamily="Consolas" Foreground="#FF6B35"> {datetime}</Run>
                                        <Run FontFamily="Consolas" Foreground="#FF6B35"> {year}</Run>
                                        <Run FontFamily="Consolas" Foreground="#FF6B35"> {month}</Run>
                                        <Run FontFamily="Consolas" Foreground="#FF6B35"> {day}</Run>
                                    </TextBlock>
                                </StackPanel>
                            </Grid>
                        </Border>

                        <!-- 새 스니펫 입력 폼 -->
                        <Border Background="White" CornerRadius="10" Padding="16,14" Margin="0,0,0,10"
                                BorderBrush="#E0E0EC" BorderThickness="1.5">
                            <Grid>
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="8"/>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="8"/>
                                    <RowDefinition Height="Auto"/>
                                </Grid.RowDefinitions>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="90"/>
                                    <ColumnDefinition Width="*"/>
                                </Grid.ColumnDefinitions>
                                <TextBlock Grid.Row="0" Grid.Column="0" Text="키워드"
                                           Style="{StaticResource RowLabel}" VerticalAlignment="Center"/>
                                <TextBox   Grid.Row="0" Grid.Column="1"
                                           Style="{StaticResource ModernTextBox}"
                                           Text="{Binding NewSnippetKey, UpdateSourceTrigger=PropertyChanged}"
                                           ToolTip="예: addr, sig, greet"/>
                                <TextBlock Grid.Row="2" Grid.Column="0" Text="표시 이름"
                                           Style="{StaticResource RowLabel}" VerticalAlignment="Center"/>
                                <TextBox   Grid.Row="2" Grid.Column="1"
                                           Style="{StaticResource ModernTextBox}"
                                           Text="{Binding NewSnippetName, UpdateSourceTrigger=PropertyChanged}"
                                           ToolTip="예: 사무실 주소, 이메일 서명"/>
                                <TextBlock Grid.Row="4" Grid.Column="0" Text="내용"
                                           Style="{StaticResource RowLabel}" VerticalAlignment="Top" Margin="0,8,0,0"/>
                                <Grid Grid.Row="4" Grid.Column="1">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="*"/>
                                        <ColumnDefinition Width="Auto"/>
                                    </Grid.ColumnDefinitions>
                                    <TextBox Grid.Column="0"
                                             Style="{StaticResource ModernTextBox}"
                                             Text="{Binding NewSnippetContent, UpdateSourceTrigger=PropertyChanged}"
                                             AcceptsReturn="True" TextWrapping="Wrap"
                                             Height="58" VerticalScrollBarVisibility="Auto"
                                             ToolTip="붙여넣기될 텍스트. {date} {time} {datetime} 사용 가능"/>
                                    <Button Grid.Column="1" Style="{StaticResource PrimaryButton}"
                                            Padding="10,0" MinWidth="72" Margin="6,0,0,0"
                                            VerticalAlignment="Bottom" Click="AddSnippet_Click">
                                        <StackPanel Orientation="Horizontal">
                                            <TextBlock Text="&#xE710;" FontFamily="Segoe MDL2 Assets"
                                                       FontSize="12" Margin="0,0,5,0" VerticalAlignment="Center"/>
                                            <TextBlock Text="추가" VerticalAlignment="Center"/>
                                        </StackPanel>
                                    </Button>
                                </Grid>
                            </Grid>
                        </Border>

                        <!-- 목록 헤더 -->
                        <Grid Margin="4,2,4,4">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="110"/>
                                <ColumnDefinition Width="140"/>
                                <ColumnDefinition Width="*"/>
                                <ColumnDefinition Width="32"/>
                            </Grid.ColumnDefinitions>
                            <TextBlock Grid.Column="0" Text="; 키워드"   Style="{StaticResource RowHint}"/>
                            <TextBlock Grid.Column="1" Text="이름"        Style="{StaticResource RowHint}"/>
                            <TextBlock Grid.Column="2" Text="내용 미리보기" Style="{StaticResource RowHint}"/>
                        </Grid>
                    </StackPanel>

                    <!-- 스니펫 목록 -->
                    <ScrollViewer Grid.Row="1" VerticalScrollBarVisibility="Auto">
                        <StackPanel>
                            <ItemsControl ItemsSource="{Binding Snippets}">
                                <ItemsControl.ItemTemplate>
                                    <DataTemplate DataType="{x:Type vm:SnippetRowModel}">
                                        <Border Background="White" CornerRadius="9"
                                                Margin="0,0,0,2" Padding="12,10">
                                            <Grid>
                                                <Grid.ColumnDefinitions>
                                                    <ColumnDefinition Width="110"/>
                                                    <ColumnDefinition Width="140"/>
                                                    <ColumnDefinition Width="*"/>
                                                    <ColumnDefinition Width="32"/>
                                                </Grid.ColumnDefinitions>
                                                <Border Grid.Column="0" Background="#FFF3EE" CornerRadius="6"
                                                        Padding="8,4" HorizontalAlignment="Left" VerticalAlignment="Center">
                                                    <TextBlock FontSize="12" FontWeight="SemiBold" Foreground="#FF6B35">
                                                        <Run Text=";"/><Run Text="{Binding Key}"/>
                                                    </TextBlock>
                                                </Border>
                                                <TextBlock Grid.Column="1" Text="{Binding Name}"
                                                           FontSize="12" Foreground="#333350"
                                                           VerticalAlignment="Center" TextTrimming="CharacterEllipsis"
                                                           Margin="0,0,8,0"/>
                                                <TextBlock Grid.Column="2" Text="{Binding Preview}"
                                                           FontSize="11" Foreground="#9999BB"
                                                           FontFamily="Consolas, Courier New"
                                                           VerticalAlignment="Center"
                                                           TextTrimming="CharacterEllipsis"/>
                                                <Button Grid.Column="3" Style="{StaticResource DeleteButton}"
                                                        Tag="{Binding}" Click="DeleteSnippet_Click"
                                                        ToolTip="삭제" VerticalAlignment="Center"/>
                                            </Grid>
                                        </Border>
                                    </DataTemplate>
                                </ItemsControl.ItemTemplate>
                            </ItemsControl>
                            <!-- 빈 상태 안내 (count==0 일 때 표시) -->
                            <Border CornerRadius="10" Background="White" Padding="30,22">
                                <Border.Style>
                                    <Style TargetType="Border">
                                        <Setter Property="Visibility" Value="Collapsed"/>
                                        <Style.Triggers>
                                            <DataTrigger Binding="{Binding Snippets.Count}" Value="0">
                                                <Setter Property="Visibility" Value="Visible"/>
                                            </DataTrigger>
                                        </Style.Triggers>
                                    </Style>
                                </Border.Style>
                                <StackPanel HorizontalAlignment="Center">
                                    <TextBlock Text="&#xE70B;" FontFamily="Segoe MDL2 Assets"
                                               FontSize="28" Foreground="#DDDDEE"
                                               HorizontalAlignment="Center" Margin="0,0,0,10"/>
                                    <TextBlock Text="스니펫이 없습니다." FontSize="13" Foreground="#AAAACC"
                                               HorizontalAlignment="Center"/>
                                    <TextBlock Text="위 폼에서 키워드와 내용을 입력하고 추가하세요."
                                               FontSize="11" Foreground="#CCCCDD"
                                               HorizontalAlignment="Center" Margin="0,4,0,0"/>
                                </StackPanel>
                            </Border>
                        </StackPanel>
                    </ScrollViewer>
                </Grid>
            </TabItem>

            <!-- ════════════════════════════════════════════════════════════ -->
            <!-- 5. 클립보드 탭                                                -->
            <!-- ════════════════════════════════════════════════════════════ -->
            <TabItem Header="클립보드" Tag="&#xE77F;" Style="{StaticResource SideNavItem}">
                <ScrollViewer VerticalScrollBarVisibility="Auto">
                    <StackPanel>
                        <TextBlock Text="클립보드 히스토리" Style="{StaticResource SectionHeader}"/>

                        <!-- 활성화 토글 -->
                        <Border Style="{StaticResource SettingsRow}">
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="*"/>
                                    <ColumnDefinition Width="Auto"/>
                                </Grid.ColumnDefinitions>
                                <Border Grid.Column="0" Width="36" Height="36" CornerRadius="9"
                                        Background="#20B2AA" Margin="0,0,14,0" VerticalAlignment="Center">
                                    <TextBlock Text="&#xE77F;" FontFamily="Segoe MDL2 Assets" FontSize="17"
                                               Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                </Border>
                                <StackPanel Grid.Column="1" VerticalAlignment="Center">
                                    <TextBlock Text="히스토리 활성화" Style="{StaticResource RowLabel}"/>
                                    <TextBlock Text="클립보드 변경을 감지하여 히스토리에 기록합니다" Style="{StaticResource RowHint}"/>
                                </StackPanel>
                                <CheckBox Grid.Column="2" Style="{StaticResource ToggleSwitch}"
                                          IsChecked="{Binding ClipboardEnabled}"
                                          VerticalAlignment="Center"/>
                            </Grid>
                        </Border>

                        <TextBlock Text="저장 개수" Style="{StaticResource SectionHeader}"/>
                        <Border Style="{StaticResource SettingsRow}">
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="*"/>
                                    <ColumnDefinition Width="200"/>
                                </Grid.ColumnDefinitions>
                                <Border Grid.Column="0" Width="36" Height="36" CornerRadius="9"
                                        Background="#FF8C42" Margin="0,0,14,0" VerticalAlignment="Center">
                                    <TextBlock Text="&#xE81C;" FontFamily="Segoe MDL2 Assets" FontSize="17"
                                               Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                </Border>
                                <StackPanel Grid.Column="1" VerticalAlignment="Center">
                                    <TextBlock Text="최대 보관 개수" Style="{StaticResource RowLabel}"/>
                                    <TextBlock Text="오래된 항목부터 자동 삭제 (10–200)" Style="{StaticResource RowHint}"/>
                                </StackPanel>
                                <StackPanel Grid.Column="2" Orientation="Horizontal" VerticalAlignment="Center">
                                    <Slider Minimum="10" Maximum="200"
                                            Value="{Binding ClipboardMaxItems}"
                                            Width="140" SmallChange="5" LargeChange="20"
                                            IsSnapToTickEnabled="True" TickFrequency="5"
                                            VerticalAlignment="Center"/>
                                    <Border Width="46" Height="28" CornerRadius="6" Background="#EEF0FF"
                                            Margin="8,0,0,0" VerticalAlignment="Center">
                                        <TextBlock Text="{Binding ClipboardMaxItems}"
                                                   FontSize="13" FontWeight="SemiBold" Foreground="#4B5EFC"
                                                   HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                    </Border>
                                </StackPanel>
                            </Grid>
                        </Border>

                        <TextBlock Text="보안 — 제외 패턴" Style="{StaticResource SectionHeader}"/>
                        <Border Style="{StaticResource SettingsRow}">
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="*"/>
                                </Grid.ColumnDefinitions>
                                <Border Grid.Column="0" Width="36" Height="36" CornerRadius="9"
                                        Background="#C50F1F" Margin="0,2,14,0" VerticalAlignment="Top">
                                    <TextBlock Text="&#xE72E;" FontFamily="Segoe MDL2 Assets" FontSize="17"
                                               Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                </Border>
                                <StackPanel Grid.Column="1">
                                    <TextBlock Text="민감 데이터 자동 제외 (Regex)"
                                               Style="{StaticResource RowLabel}"/>
                                    <TextBlock Text="아래 정규식에 일치하는 텍스트는 히스토리에 저장되지 않습니다."
                                               Style="{StaticResource RowHint}" TextWrapping="Wrap" Margin="0,2,0,10"/>
                                    <Border Background="#FFF5F5" CornerRadius="7" Padding="10,8" Margin="0,0,0,4"
                                            BorderBrush="#FFCCCC" BorderThickness="1">
                                        <StackPanel Orientation="Horizontal">
                                            <TextBlock Text="&#xE74D;" FontFamily="Segoe MDL2 Assets"
                                                       FontSize="10" Foreground="#CC3333" VerticalAlignment="Center" Margin="0,0,8,0"/>
                                            <TextBlock Text="^\d{4}[\s\-]?\d{4}[\s\-]?\d{4}[\s\-]?\d{4}$"
                                                       FontFamily="Consolas, Courier New" FontSize="11"
                                                       Foreground="#993333" VerticalAlignment="Center"/>
                                            <TextBlock Text="  신용카드 번호" FontSize="10" Foreground="#BB7777"
                                                       VerticalAlignment="Center" Margin="8,0,0,0"/>
                                        </StackPanel>
                                    </Border>
                                    <Border Background="#FFF5F5" CornerRadius="7" Padding="10,8"
                                            BorderBrush="#FFCCCC" BorderThickness="1">
                                        <StackPanel Orientation="Horizontal">
                                            <TextBlock Text="&#xE74D;" FontFamily="Segoe MDL2 Assets"
                                                       FontSize="10" Foreground="#CC3333" VerticalAlignment="Center" Margin="0,0,8,0"/>
                                            <TextBlock Text="^(?:\d{1,3}\.){3}\d{1,3}$"
                                                       FontFamily="Consolas, Courier New" FontSize="11"
                                                       Foreground="#993333" VerticalAlignment="Center"/>
                                            <TextBlock Text="  IP 주소" FontSize="10" Foreground="#BB7777"
                                                       VerticalAlignment="Center" Margin="8,0,0,0"/>
                                        </StackPanel>
                                    </Border>
                                </StackPanel>
                            </Grid>
                        </Border>

                    </StackPanel>
                </ScrollViewer>
            </TabItem>

            <!-- ════════════════════════════════════════════════════════════ -->
            <!-- 6. 캡처 탭                                                    -->
            <!-- ════════════════════════════════════════════════════════════ -->
            <TabItem Header="캡처" Tag="&#xE722;" Style="{StaticResource SideNavItem}">
                <ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled">
                    <StackPanel>

                        <TextBlock Text="명령어 예약어" Style="{StaticResource SectionHeader}"/>

                        <!-- 안내 -->
                        <Border Background="White" CornerRadius="10" Padding="14,10" Margin="0,0,0,8">
                            <StackPanel Orientation="Horizontal">
                                <TextBlock Text="&#xE946;" FontFamily="Segoe MDL2 Assets" FontSize="13"
                                           Foreground="#4B5EFC" VerticalAlignment="Center" Margin="0,0,8,0"/>
                                <TextBlock FontSize="12" Foreground="#7777AA" TextWrapping="Wrap" VerticalAlignment="Center">
                                    <Run>AX Commander에서 캡처를 실행하는 예약어입니다. 기본값은</Run>
                                    <Run FontFamily="Consolas" Foreground="#4B5EFC">cap</Run>
                                    <Run>— 짧게 바꾸면 더 빠르게 실행할 수 있습니다 (예:</Run>
                                    <Run FontFamily="Consolas" Foreground="#4B5EFC">c</Run>
                                    <Run>).</Run>
                                </TextBlock>
                            </StackPanel>
                        </Border>

                        <!-- 예약어 입력 -->
                        <Border Style="{StaticResource SettingsRow}">
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="*"/>
                                    <ColumnDefinition Width="130"/>
                                    <ColumnDefinition Width="Auto"/>
                                </Grid.ColumnDefinitions>
                                <Border Grid.Column="0" Width="36" Height="36" CornerRadius="9"
                                        Background="#7C3AED" Margin="0,0,14,0" VerticalAlignment="Center">
                                    <TextBlock Text="&#xE765;" FontFamily="Segoe MDL2 Assets" FontSize="17"
                                               Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                </Border>
                                <StackPanel Grid.Column="1" VerticalAlignment="Center">
                                    <TextBlock Text="캡처 명령어 예약어" Style="{StaticResource RowLabel}"/>
                                    <TextBlock Style="{StaticResource RowHint}">
                                        <Run>현재: </Run>
                                        <Run FontFamily="Consolas" Foreground="#4B5EFC"
                                             Text="{Binding CapPrefix, Mode=OneWay}"/>
                                        <Run> screen / window / scroll / region</Run>
                                    </TextBlock>
                                </StackPanel>
                                <TextBox Grid.Column="2"
                                         Style="{StaticResource ModernTextBox}"
                                         Text="{Binding CapPrefix, UpdateSourceTrigger=PropertyChanged}"
                                         MaxLength="20"
                                         FontFamily="Consolas"
                                         VerticalAlignment="Center" Margin="8,0"/>
                                <Button Grid.Column="3" Content="기본값"
                                        Style="{StaticResource SecondaryButton}"
                                        Click="ResetCapPrefix_Click"
                                        VerticalAlignment="Center"/>
                            </Grid>
                        </Border>

                        <TextBlock Text="글로벌 캡처 단축키" Style="{StaticResource SectionHeader}"/>

                        <!-- 안내 -->
                        <Border Background="White" CornerRadius="10" Padding="14,10" Margin="0,0,0,8">
                            <StackPanel Orientation="Horizontal">
                                <TextBlock Text="&#xE946;" FontFamily="Segoe MDL2 Assets" FontSize="13"
                                           Foreground="#4B5EFC" VerticalAlignment="Center" Margin="0,0,8,0"/>
                                <TextBlock FontSize="12" Foreground="#7777AA" TextWrapping="Wrap" VerticalAlignment="Center">
                                    <Run>AX Commander를 열지 않고 단축키만으로 즉시 캡처합니다.</Run>
                                    <Run>기본값은 비활성화입니다.</Run>
                                </TextBlock>
                            </StackPanel>
                        </Border>

                        <!-- 활성화 토글 -->
                        <Border Style="{StaticResource SettingsRow}">
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="*"/>
                                    <ColumnDefinition Width="Auto"/>
                                </Grid.ColumnDefinitions>
                                <Border Grid.Column="0" Width="36" Height="36" CornerRadius="9"
                                        Background="#0078D4" Margin="0,0,14,0" VerticalAlignment="Center">
                                    <TextBlock Text="&#xE765;" FontFamily="Segoe MDL2 Assets" FontSize="17"
                                               Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                </Border>
                                <StackPanel Grid.Column="1" VerticalAlignment="Center">
                                    <TextBlock Text="글로벌 캡처 단축키 사용" Style="{StaticResource RowLabel}"/>
                                    <TextBlock Text="AX Commander를 열지 않고 단축키로 바로 캡처" Style="{StaticResource RowHint}"/>
                                </StackPanel>
                                <CheckBox Grid.Column="2" Style="{StaticResource ToggleSwitch}"
                                          IsChecked="{Binding CapGlobalHotkeyEnabled}"
                                          VerticalAlignment="Center"/>
                            </Grid>
                        </Border>

                        <!-- 단축키 입력 (활성화 시만 표시) -->
                        <Border Style="{StaticResource SettingsRow}"
                                Visibility="{Binding CapGlobalHotkeyEnabled, Converter={StaticResource BoolToVisibilityConverter}}">
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="*"/>
                                    <ColumnDefinition Width="160"/>
                                    <ColumnDefinition Width="Auto"/>
                                </Grid.ColumnDefinitions>
                                <Border Grid.Column="0" Width="36" Height="36" CornerRadius="9"
                                        Background="#4B5EFC" Margin="0,0,14,0" VerticalAlignment="Center">
                                    <TextBlock Text="&#xE765;" FontFamily="Segoe MDL2 Assets" FontSize="17"
                                               Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                </Border>
                                <StackPanel Grid.Column="1" VerticalAlignment="Center">
                                    <TextBlock Text="캡처 단축키" Style="{StaticResource RowLabel}"/>
                                    <TextBlock Text="클릭 후 원하는 키 조합 입력" Style="{StaticResource RowHint}"/>
                                </StackPanel>
                                <TextBox Grid.Column="2"
                                         Style="{StaticResource ModernTextBox}"
                                         Text="{Binding CapGlobalHotkey, UpdateSourceTrigger=PropertyChanged}"
                                         FontFamily="Consolas"
                                         FontWeight="Bold"
                                         IsReadOnly="True"
                                         PreviewKeyDown="CapHotkeyRecorder_PreviewKeyDown"
                                         VerticalAlignment="Center" Margin="8,0"/>
                                <Button Grid.Column="3" Content="기본값"
                                        Style="{StaticResource SecondaryButton}"
                                        Click="ResetCapGlobalHotkey_Click"
                                        VerticalAlignment="Center"/>
                            </Grid>
                        </Border>

                        <!-- 캡처 모드 선택 (활성화 시만 표시) -->
                        <Border Style="{StaticResource SettingsRow}"
                                Visibility="{Binding CapGlobalHotkeyEnabled, Converter={StaticResource BoolToVisibilityConverter}}">
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="*"/>
                                    <ColumnDefinition Width="160"/>
                                </Grid.ColumnDefinitions>
                                <Border Grid.Column="0" Width="36" Height="36" CornerRadius="9"
                                        Background="#E722AA" Margin="0,0,14,0" VerticalAlignment="Center">
                                    <TextBlock Text="&#xE722;" FontFamily="Segoe MDL2 Assets" FontSize="17"
                                               Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                </Border>
                                <StackPanel Grid.Column="1" VerticalAlignment="Center">
                                    <TextBlock Text="단축키 실행 모드" Style="{StaticResource RowLabel}"/>
                                    <TextBlock Text="단축키를 누르면 실행할 캡처 종류" Style="{StaticResource RowHint}"/>
                                </StackPanel>
                                <ComboBox Grid.Column="2"                                           SelectedValue="{Binding CapGlobalMode}"
                                          SelectedValuePath="Tag"
                                          VerticalAlignment="Center" Margin="8,0">
                                    <ComboBoxItem Content="전체 화면" Tag="screen"/>
                                    <ComboBoxItem Content="활성 창" Tag="window"/>
                                    <ComboBoxItem Content="영역 선택" Tag="region"/>
                                </ComboBox>
                            </Grid>
                        </Border>

                        <TextBlock Text="고급" Style="{StaticResource SectionHeader}"/>

                        <!-- 스크롤 캡처 딜레이 -->
                        <Border Style="{StaticResource SettingsRow}">
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="*"/>
                                    <ColumnDefinition Width="130"/>
                                </Grid.ColumnDefinitions>
                                <Border Grid.Column="0" Width="36" Height="36" CornerRadius="9"
                                        Background="#B45309" Margin="0,0,14,0" VerticalAlignment="Center">
                                    <TextBlock Text="&#xE916;" FontFamily="Segoe MDL2 Assets" FontSize="17"
                                               Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                </Border>
                                <StackPanel Grid.Column="1" VerticalAlignment="Center">
                                    <TextBlock Text="스크롤 캡처 대기 시간" Style="{StaticResource RowLabel}"/>
                                    <TextBlock Text="프레임 간 대기 시간 (ms). 느린 페이지는 값을 높이세요" Style="{StaticResource RowHint}"/>
                                </StackPanel>
                                <ComboBox Grid.Column="2"                                           SelectedValue="{Binding CapScrollDelayMsStr}"
                                          SelectedValuePath="Tag"
                                          VerticalAlignment="Center" Margin="8,0">
                                    <ComboBoxItem Content="80ms (빠른 페이지)" Tag="80"/>
                                    <ComboBoxItem Content="120ms (기본)" Tag="120"/>
                                    <ComboBoxItem Content="200ms (보통)" Tag="200"/>
                                    <ComboBoxItem Content="300ms (느린 페이지)" Tag="300"/>
                                    <ComboBoxItem Content="500ms (매우 느린)" Tag="500"/>
                                </ComboBox>
                            </Grid>
                        </Border>

                    </StackPanel>
                </ScrollViewer>
            </TabItem>

            <!-- ════════════════════════════════════════════════════════════ -->
            <!-- 7. 알림 탭 (좌측 사이드바에서 숨김 — 일반 탭 내 알림 서브탭으로 통합됨)  -->
            <!-- ════════════════════════════════════════════════════════════ -->
            <TabItem Header="알림" Tag="&#xEA8F;" Style="{StaticResource SideNavItem}" Visibility="Collapsed">
                <ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled">
                    <StackPanel>

                        <!-- 안내 -->
                        <Border Background="White" CornerRadius="10" Padding="14,10" Margin="0,18,0,8">
                            <StackPanel Orientation="Horizontal">
                                <TextBlock Text="&#xE946;" FontFamily="Segoe MDL2 Assets" FontSize="13"
                                           Foreground="#4B5EFC" VerticalAlignment="Center" Margin="0,0,8,0"/>
                                <TextBlock FontSize="12" Foreground="#7777AA" TextWrapping="Wrap" VerticalAlignment="Center">
                                    <Run>PC 잠금을 해제할 때 격려 문구와 오늘의 근무 시간을 보여줍니다.</Run>
                                    <Run>기본값은 비활성화입니다.</Run>
                                </TextBlock>
                            </StackPanel>
                        </Border>

                        <TextBlock Text="기능 활성화" Style="{StaticResource SectionHeader}"/>

                        <!-- 활성화 토글 -->
                        <Border Style="{StaticResource SettingsRow}">
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="*"/>
                                    <ColumnDefinition Width="Auto"/>
                                </Grid.ColumnDefinitions>
                                <Border Grid.Column="0" Width="36" Height="36" CornerRadius="9"
                                        Background="#4B5EFC" Margin="0,0,14,0" VerticalAlignment="Center">
                                    <TextBlock Text="&#xEA8F;" FontFamily="Segoe MDL2 Assets" FontSize="17"
                                               Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                </Border>
                                <StackPanel Grid.Column="1" VerticalAlignment="Center">
                                    <TextBlock Text="잠금 해제 알림 사용" Style="{StaticResource RowLabel}"/>
                                    <TextBlock Text="잠금 해제 시 격려 문구 팝업을 표시합니다" Style="{StaticResource RowHint}"/>
                                </StackPanel>
                                <CheckBox Grid.Column="2" Style="{StaticResource ToggleSwitch}"
                                          IsChecked="{Binding ReminderEnabled}"
                                          VerticalAlignment="Center"/>
                            </Grid>
                        </Border>

                        <TextBlock Text="표시 위치" Style="{StaticResource SectionHeader}"/>

                        <!-- 코너 선택 (2×2 버튼 그리드) -->
                        <Border Style="{StaticResource SettingsRow}">
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="*"/>
                                </Grid.ColumnDefinitions>
                                <Border Grid.Column="0" Width="36" Height="36" CornerRadius="9"
                                        Background="#8E44AD" Margin="0,0,14,0" VerticalAlignment="Center">
                                    <TextBlock Text="&#xE744;" FontFamily="Segoe MDL2 Assets" FontSize="17"
                                               Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                </Border>
                                <StackPanel Grid.Column="1">
                                    <TextBlock Text="팝업 표시 위치" Style="{StaticResource RowLabel}" Margin="0,0,0,10"/>
                                    <UniformGrid Rows="2" Columns="2" HorizontalAlignment="Left" Width="280">
                                        <RadioButton Content="좌측 상단" Margin="0,0,8,6"
                                                     IsChecked="{Binding ReminderCorner, Converter={StaticResource StringEqualConverter}, ConverterParameter=top-left}"
                                                     Tag="top-left" Click="ReminderCorner_Click"/>
                                        <RadioButton Content="우측 상단" Margin="0,0,0,6"
                                                     IsChecked="{Binding ReminderCorner, Converter={StaticResource StringEqualConverter}, ConverterParameter=top-right}"
                                                     Tag="top-right" Click="ReminderCorner_Click"/>
                                        <RadioButton Content="좌측 하단" Margin="0,0,8,0"
                                                     IsChecked="{Binding ReminderCorner, Converter={StaticResource StringEqualConverter}, ConverterParameter=bottom-left}"
                                                     Tag="bottom-left" Click="ReminderCorner_Click"/>
                                        <RadioButton Content="우측 하단 (기본)" Margin="0"
                                                     IsChecked="{Binding ReminderCorner, Converter={StaticResource StringEqualConverter}, ConverterParameter=bottom-right}"
                                                     Tag="bottom-right" Click="ReminderCorner_Click"/>
                                    </UniformGrid>
                                </StackPanel>
                            </Grid>
                        </Border>

                        <TextBlock Text="알림 콘텐츠" Style="{StaticResource SectionHeader}"/>
                        <Border Style="{StaticResource SettingsRow}">
                            <StackPanel>
                                <TextBlock Style="{StaticResource RowLabel}" Text="표시할 알림 카테고리"/>
                                <TextBlock Style="{StaticResource RowHint}" Text="선택한 카테고리의 문구가 랜덤으로 표시됩니다. 아무것도 선택하지 않으면 격려 문구가 기본으로 표시됩니다."/>
                                <StackPanel x:Name="QuoteCategoryPanel" Margin="0,8,0,0"/>
                            </StackPanel>
                        </Border>

                        <TextBlock Text="알림 간격" Style="{StaticResource SectionHeader}"/>

                        <!-- 간격 선택 -->
                        <Border Style="{StaticResource SettingsRow}">
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="*"/>
                                    <ColumnDefinition Width="Auto"/>
                                </Grid.ColumnDefinitions>
                                <Border Grid.Column="0" Width="36" Height="36" CornerRadius="9"
                                        Background="#E67E22" Margin="0,0,14,0" VerticalAlignment="Center">
                                    <TextBlock Text="&#xE823;" FontFamily="Segoe MDL2 Assets" FontSize="17"
                                               Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                </Border>
                                <StackPanel Grid.Column="1" VerticalAlignment="Center">
                                    <TextBlock Text="표시 간격" Style="{StaticResource RowLabel}"/>
                                    <TextBlock Text="잠금 해제 후 이 시간이 지났을 때 알림 표시" Style="{StaticResource RowHint}"/>
                                </StackPanel>
                                <ComboBox Grid.Column="2"
                                          SelectedValue="{Binding ReminderIntervalMinutes}"
                                          SelectedValuePath="Tag"
                                          Width="120" VerticalAlignment="Center">
                                    <ComboBoxItem Content="5분"   Tag="5"/>
                                    <ComboBoxItem Content="10분"  Tag="10"/>
                                    <ComboBoxItem Content="20분"  Tag="20"/>
                                    <ComboBoxItem Content="30분"  Tag="30"/>
                                    <ComboBoxItem Content="1시간" Tag="60"/>
                                    <ComboBoxItem Content="2시간" Tag="120"/>
                                    <ComboBoxItem Content="3시간" Tag="180"/>
                                    <ComboBoxItem Content="4시간" Tag="240"/>
                                </ComboBox>
                            </Grid>
                        </Border>

                        <TextBlock Text="표시 시간" Style="{StaticResource SectionHeader}"/>

                        <!-- 표시 시간 선택 -->
                        <Border Style="{StaticResource SettingsRow}">
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="*"/>
                                    <ColumnDefinition Width="Auto"/>
                                </Grid.ColumnDefinitions>
                                <Border Grid.Column="0" Width="36" Height="36" CornerRadius="9"
                                        Background="#27AE60" Margin="0,0,14,0" VerticalAlignment="Center">
                                    <TextBlock Text="&#xE916;" FontFamily="Segoe MDL2 Assets" FontSize="17"
                                               Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                </Border>
                                <StackPanel Grid.Column="1" VerticalAlignment="Center">
                                    <TextBlock Text="자동 닫힘 시간" Style="{StaticResource RowLabel}"/>
                                    <TextBlock Text="팝업이 자동으로 닫히는 시간 (기본 15초)" Style="{StaticResource RowHint}"/>
                                </StackPanel>
                                <ComboBox Grid.Column="2"
                                          SelectedValue="{Binding ReminderDisplaySeconds}"
                                          SelectedValuePath="Tag"
                                          Width="120" VerticalAlignment="Center">
                                    <ComboBoxItem Content="5초"  Tag="5"/>
                                    <ComboBoxItem Content="10초" Tag="10"/>
                                    <ComboBoxItem Content="15초 (기본)" Tag="15"/>
                                    <ComboBoxItem Content="20초" Tag="20"/>
                                    <ComboBoxItem Content="30초" Tag="30"/>
                                    <ComboBoxItem Content="1분"  Tag="60"/>
                                    <ComboBoxItem Content="2분"  Tag="120"/>
                                    <ComboBoxItem Content="3분"  Tag="180"/>
                                </ComboBox>
                            </Grid>
                        </Border>

                        <!-- 바로보기 버튼 -->
                        <Border Background="White" CornerRadius="10" Padding="14,12" Margin="0,10,0,0">
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="*"/>
                                    <ColumnDefinition Width="Auto"/>
                                </Grid.ColumnDefinitions>
                                <Border Grid.Column="0" Width="36" Height="36" CornerRadius="9"
                                        Background="#EBF5FF" Margin="0,0,14,0" VerticalAlignment="Center">
                                    <TextBlock Text="&#xE7BE;" FontFamily="Segoe MDL2 Assets" FontSize="16"
                                               Foreground="#4B5EFC" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                </Border>
                                <StackPanel Grid.Column="1" VerticalAlignment="Center">
                                    <TextBlock Text="알림 미리보기" Style="{StaticResource RowLabel}"/>
                                    <TextBlock Text="설정한 옵션으로 알림 팝업을 즉시 확인합니다" Style="{StaticResource RowHint}"/>
                                </StackPanel>
                                <Button Grid.Column="2" Content="바로보기" Click="ReminderPreview_Click"
                                        Width="84" Height="32" FontSize="12" FontWeight="SemiBold"
                                        Foreground="White" Background="#4B5EFC" BorderThickness="0"
                                        Cursor="Hand" VerticalAlignment="Center">
                                    <Button.Template>
                                        <ControlTemplate TargetType="Button">
                                            <Border x:Name="Bd" Background="{TemplateBinding Background}"
                                                    CornerRadius="8" Padding="12,6">
                                                <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                            </Border>
                                            <ControlTemplate.Triggers>
                                                <Trigger Property="IsMouseOver" Value="True">
                                                    <Setter TargetName="Bd" Property="Background" Value="#3B4EEC"/>
                                                </Trigger>
                                            </ControlTemplate.Triggers>
                                        </ControlTemplate>
                                    </Button.Template>
                                </Button>
                            </Grid>
                        </Border>

                    </StackPanel>
                </ScrollViewer>
            </TabItem>

            <!-- ════════════════════════════════════════════════════════════ -->

            <!-- ════════════════════════════════════════════════════════════ -->
            <!-- 8. 시스템 명령 탭                                             -->
            <!-- ════════════════════════════════════════════════════════════ -->
            <TabItem Header="시스템" Tag="&#xE7E8;" Style="{StaticResource SideNavItem}">
                <ScrollViewer VerticalScrollBarVisibility="Auto">
                    <StackPanel>
                        <TextBlock Text="시스템 명령 표시 여부" Style="{StaticResource SectionHeader}"/>
                        <Border Background="White" CornerRadius="10" Padding="14,10" Margin="0,0,0,12">
                            <StackPanel Orientation="Horizontal">
                                <TextBlock Text="&#xE946;" FontFamily="Segoe MDL2 Assets" FontSize="13"
                                           Foreground="#4B5EFC" VerticalAlignment="Center" Margin="0,0,8,0"/>
                                <TextBlock Text="AX Commander에서 / 예약어로 실행 가능한 시스템 명령을 개별 활성화할 수 있습니다."
                                           FontSize="12" Foreground="#7777AA" TextWrapping="Wrap" VerticalAlignment="Center"/>
                            </StackPanel>
                        </Border>

                        <!-- 별칭 입력 힌트 -->
                        <Border Background="#F0F4FF" CornerRadius="8" Padding="12,8" Margin="0,0,0,8">
                            <StackPanel Orientation="Horizontal">
                                <TextBlock Text="&#xE70F;" FontFamily="Segoe MDL2 Assets" FontSize="11"
                                           Foreground="#4B5EFC" VerticalAlignment="Center" Margin="0,0,8,0"/>
                                <TextBlock FontSize="11" Foreground="#5558AA" VerticalAlignment="Center">
                                    <Run>별칭 입력: 쉼표로 구분해서 입력 (예:</Run>
                                    <Run FontFamily="Consolas" Foreground="#4B5EFC">잠금, l</Run>
                                    <Run>) → AX Commander에서</Run>
                                    <Run FontFamily="Consolas" Foreground="#4B5EFC">/잠금</Run>
                                    <Run>또는</Run>
                                    <Run FontFamily="Consolas" Foreground="#4B5EFC">/l</Run>
                                    <Run>로 실행</Run>
                                </TextBlock>
                            </StackPanel>
                        </Border>

                        <!-- 각 명령 토글 + 별칭 -->
                        <Border Style="{StaticResource SettingsRow}">
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="110"/>
                                    <ColumnDefinition Width="*"/>
                                    <ColumnDefinition Width="Auto"/>
                                </Grid.ColumnDefinitions>
                                <Border Grid.Column="0" Width="36" Height="36" CornerRadius="9" Background="#0078D4" Margin="0,0,12,0" VerticalAlignment="Center">
                                    <TextBlock Text="&#xE72E;" FontFamily="Segoe MDL2 Assets" FontSize="17" Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                </Border>
                                <StackPanel Grid.Column="1" VerticalAlignment="Center">
                                    <TextBlock Text="화면 잠금" Style="{StaticResource RowLabel}"/>
                                    <TextBlock FontFamily="Consolas" FontSize="11" Foreground="#9999BB">/lock</TextBlock>
                                </StackPanel>
                                <TextBox Grid.Column="2" Style="{StaticResource ModernTextBox}"
                                         Text="{Binding AliasLock, UpdateSourceTrigger=PropertyChanged}"
                                         ToolTip="별칭 (쉼표 구분, 예: 잠금, l)"
                                         FontSize="12" Margin="8,0,12,0" VerticalAlignment="Center"/>
                                <CheckBox Grid.Column="3" Style="{StaticResource ToggleSwitch}" IsChecked="{Binding SysShowLock}" VerticalAlignment="Center"/>
                            </Grid>
                        </Border>

                        <Border Style="{StaticResource SettingsRow}">
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="110"/>
                                    <ColumnDefinition Width="*"/>
                                    <ColumnDefinition Width="Auto"/>
                                </Grid.ColumnDefinitions>
                                <Border Grid.Column="0" Width="36" Height="36" CornerRadius="9" Background="#7B2FBE" Margin="0,0,12,0" VerticalAlignment="Center">
                                    <TextBlock Text="&#xEC46;" FontFamily="Segoe MDL2 Assets" FontSize="17" Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                </Border>
                                <StackPanel Grid.Column="1" VerticalAlignment="Center">
                                    <TextBlock Text="절전 모드" Style="{StaticResource RowLabel}"/>
                                    <TextBlock FontFamily="Consolas" FontSize="11" Foreground="#9999BB">/sleep</TextBlock>
                                </StackPanel>
                                <TextBox Grid.Column="2" Style="{StaticResource ModernTextBox}"
                                         Text="{Binding AliasSleep, UpdateSourceTrigger=PropertyChanged}"
                                         ToolTip="별칭 (쉼표 구분)"
                                         FontSize="12" Margin="8,0,12,0" VerticalAlignment="Center"/>
                                <CheckBox Grid.Column="3" Style="{StaticResource ToggleSwitch}" IsChecked="{Binding SysShowSleep}" VerticalAlignment="Center"/>
                            </Grid>
                        </Border>

                        <Border Style="{StaticResource SettingsRow}">
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="110"/>
                                    <ColumnDefinition Width="*"/>
                                    <ColumnDefinition Width="Auto"/>
                                </Grid.ColumnDefinitions>
                                <Border Grid.Column="0" Width="36" Height="36" CornerRadius="9" Background="#0099BC" Margin="0,0,12,0" VerticalAlignment="Center">
                                    <TextBlock Text="&#xEC46;" FontFamily="Segoe MDL2 Assets" FontSize="17" Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                </Border>
                                <StackPanel Grid.Column="1" VerticalAlignment="Center">
                                    <TextBlock Text="최대 절전" Style="{StaticResource RowLabel}"/>
                                    <TextBlock FontFamily="Consolas" FontSize="11" Foreground="#9999BB">/hibernate</TextBlock>
                                </StackPanel>
                                <TextBox Grid.Column="2" Style="{StaticResource ModernTextBox}"
                                         Text="{Binding AliasHibernate, UpdateSourceTrigger=PropertyChanged}"
                                         ToolTip="별칭 (쉼표 구분)"
                                         FontSize="12" Margin="8,0,12,0" VerticalAlignment="Center"/>
                                <CheckBox Grid.Column="3" Style="{StaticResource ToggleSwitch}" IsChecked="{Binding SysShowHibernate}" VerticalAlignment="Center"/>
                            </Grid>
                        </Border>

                        <Border Style="{StaticResource SettingsRow}">
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="110"/>
                                    <ColumnDefinition Width="*"/>
                                    <ColumnDefinition Width="Auto"/>
                                </Grid.ColumnDefinitions>
                                <Border Grid.Column="0" Width="36" Height="36" CornerRadius="9" Background="#107C10" Margin="0,0,12,0" VerticalAlignment="Center">
                                    <TextBlock Text="&#xE777;" FontFamily="Segoe MDL2 Assets" FontSize="17" Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                </Border>
                                <StackPanel Grid.Column="1" VerticalAlignment="Center">
                                    <TextBlock Text="재시작" Style="{StaticResource RowLabel}"/>
                                    <TextBlock FontFamily="Consolas" FontSize="11" Foreground="#9999BB">/restart</TextBlock>
                                </StackPanel>
                                <TextBox Grid.Column="2" Style="{StaticResource ModernTextBox}"
                                         Text="{Binding AliasRestart, UpdateSourceTrigger=PropertyChanged}"
                                         ToolTip="별칭 (쉼표 구분)"
                                         FontSize="12" Margin="8,0,12,0" VerticalAlignment="Center"/>
                                <CheckBox Grid.Column="3" Style="{StaticResource ToggleSwitch}" IsChecked="{Binding SysShowRestart}" VerticalAlignment="Center"/>
                            </Grid>
                        </Border>

                        <Border Style="{StaticResource SettingsRow}">
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="110"/>
                                    <ColumnDefinition Width="*"/>
                                    <ColumnDefinition Width="Auto"/>
                                </Grid.ColumnDefinitions>
                                <Border Grid.Column="0" Width="36" Height="36" CornerRadius="9" Background="#C50F1F" Margin="0,0,12,0" VerticalAlignment="Center">
                                    <TextBlock Text="&#xE7E8;" FontFamily="Segoe MDL2 Assets" FontSize="17" Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                </Border>
                                <StackPanel Grid.Column="1" VerticalAlignment="Center">
                                    <TextBlock Text="시스템 종료" Style="{StaticResource RowLabel}"/>
                                    <TextBlock FontFamily="Consolas" FontSize="11" Foreground="#9999BB">/shutdown</TextBlock>
                                </StackPanel>
                                <TextBox Grid.Column="2" Style="{StaticResource ModernTextBox}"
                                         Text="{Binding AliasShutdown, UpdateSourceTrigger=PropertyChanged}"
                                         ToolTip="별칭 (쉼표 구분)"
                                         FontSize="12" Margin="8,0,12,0" VerticalAlignment="Center"/>
                                <CheckBox Grid.Column="3" Style="{StaticResource ToggleSwitch}" IsChecked="{Binding SysShowShutdown}" VerticalAlignment="Center"/>
                            </Grid>
                        </Border>

                        <Border Style="{StaticResource SettingsRow}">
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="110"/>
                                    <ColumnDefinition Width="*"/>
                                    <ColumnDefinition Width="Auto"/>
                                </Grid.ColumnDefinitions>
                                <Border Grid.Column="0" Width="36" Height="36" CornerRadius="9" Background="#CA5010" Margin="0,0,12,0" VerticalAlignment="Center">
                                    <TextBlock Text="&#xF3B1;" FontFamily="Segoe MDL2 Assets" FontSize="17" Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                </Border>
                                <StackPanel Grid.Column="1" VerticalAlignment="Center">
                                    <TextBlock Text="로그아웃" Style="{StaticResource RowLabel}"/>
                                    <TextBlock FontFamily="Consolas" FontSize="11" Foreground="#9999BB">/logout</TextBlock>
                                </StackPanel>
                                <TextBox Grid.Column="2" Style="{StaticResource ModernTextBox}"
                                         Text="{Binding AliasLogout, UpdateSourceTrigger=PropertyChanged}"
                                         ToolTip="별칭 (쉼표 구분)"
                                         FontSize="12" Margin="8,0,12,0" VerticalAlignment="Center"/>
                                <CheckBox Grid.Column="3" Style="{StaticResource ToggleSwitch}" IsChecked="{Binding SysShowLogout}" VerticalAlignment="Center"/>
                            </Grid>
                        </Border>

                        <Border Style="{StaticResource SettingsRow}">
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="110"/>
                                    <ColumnDefinition Width="*"/>
                                    <ColumnDefinition Width="Auto"/>
                                </Grid.ColumnDefinitions>
                                <Border Grid.Column="0" Width="36" Height="36" CornerRadius="9" Background="#605E5C" Margin="0,0,12,0" VerticalAlignment="Center">
                                    <TextBlock Text="&#xE74D;" FontFamily="Segoe MDL2 Assets" FontSize="17" Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                </Border>
                                <StackPanel Grid.Column="1" VerticalAlignment="Center">
                                    <TextBlock Text="휴지통 비우기" Style="{StaticResource RowLabel}"/>
                                    <TextBlock FontFamily="Consolas" FontSize="11" Foreground="#9999BB">/recycle</TextBlock>
                                </StackPanel>
                                <TextBox Grid.Column="2" Style="{StaticResource ModernTextBox}"
                                         Text="{Binding AliasRecycle, UpdateSourceTrigger=PropertyChanged}"
                                         ToolTip="별칭 (쉼표 구분)"
                                         FontSize="12" Margin="8,0,12,0" VerticalAlignment="Center"/>
                                <CheckBox Grid.Column="3" Style="{StaticResource ToggleSwitch}" IsChecked="{Binding SysShowRecycleBin}" VerticalAlignment="Center"/>
                            </Grid>
                        </Border>

                        <!-- 기본값 초기화 버튼 -->
                        <Border Background="White" CornerRadius="10" Padding="14,10" Margin="0,4,0,0">
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="*"/>
                                    <ColumnDefinition Width="Auto"/>
                                </Grid.ColumnDefinitions>
                                <TextBlock Grid.Column="0" FontSize="12" Foreground="#9999BB" VerticalAlignment="Center">
                                    별칭을 모두 지우고 기본 명령어만 사용합니다.
                                </TextBlock>
                                <Button Grid.Column="1" Style="{StaticResource SecondaryButton}"
                                        Padding="12,6" Click="ResetCommandAliases_Click">
                                    <StackPanel Orientation="Horizontal">
                                        <TextBlock Text="&#xE72C;" FontFamily="Segoe MDL2 Assets"
                                                   FontSize="11" Margin="0,0,6,0" VerticalAlignment="Center"/>
                                        <TextBlock Text="별칭 기본값 초기화" VerticalAlignment="Center"/>
                                    </StackPanel>
                                </Button>
                            </Grid>
                        </Border>

                    </StackPanel>
                </ScrollViewer>
            </TabItem>

            <!-- ════════════════════════════════════════════════════════════ -->
            <!-- 7. 빠른 실행 탭                                               -->
            <!-- ════════════════════════════════════════════════════════════ -->
            <TabItem Header="빠른 실행" Tag="&#xE7C3;" Style="{StaticResource SideNavItem}">
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="*"/>
                    </Grid.RowDefinitions>

                    <StackPanel Grid.Row="0">
                        <TextBlock Text="앱 단축키" Style="{StaticResource SectionHeader}"/>
                        <!-- 안내 배너 -->
                        <Border Background="White" CornerRadius="10" Padding="14,11" Margin="0,0,0,10">
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="*"/>
                                </Grid.ColumnDefinitions>
                                <Border Grid.Column="0" Width="36" Height="36" CornerRadius="9"
                                        Background="#4B5EFC" Margin="0,0,12,0" VerticalAlignment="Center">
                                    <TextBlock Text="&#xE7C3;" FontFamily="Segoe MDL2 Assets" FontSize="17"
                                               Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                </Border>
                                <TextBlock Grid.Column="1" FontSize="12" Foreground="#444466"
                                           TextWrapping="Wrap" VerticalAlignment="Center">
                                    키워드를 입력하면 AX Commander에서 <Run FontWeight="SemiBold" Foreground="#4B5EFC">예약어 없이</Run> 바로 앱·URL·폴더를 열 수 있습니다.
                                </TextBlock>
                            </Grid>
                        </Border>

                        <!-- 입력 폼 -->
                        <Border Background="White" CornerRadius="10" Padding="16,14" Margin="0,0,0,10"
                                BorderBrush="#E0E0EC" BorderThickness="1.5">
                            <Grid>
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="8"/>
                                    <RowDefinition Height="Auto"/>
                                </Grid.RowDefinitions>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="*"/>
                                    <ColumnDefinition Width="8"/>
                                    <ColumnDefinition Width="*"/>
                                </Grid.ColumnDefinitions>
                                <!-- 행 1: 키워드 + 설명 -->
                                <TextBox Grid.Row="0" Grid.Column="0"
                                         Style="{StaticResource ModernTextBox}"
                                         Text="{Binding NewKey, UpdateSourceTrigger=PropertyChanged}"
                                         Tag="키워드 (예: vscode, gh)"
                                         ToolTip="AX Commander에서 입력할 단축 키워드"/>
                                <TextBox Grid.Row="0" Grid.Column="2"
                                         Style="{StaticResource ModernTextBox}"
                                         Text="{Binding NewDescription, UpdateSourceTrigger=PropertyChanged}"
                                         Tag="표시 이름 (예: Visual Studio Code)"
                                         ToolTip="AX Commander 결과에 표시될 이름"/>
                                <!-- 행 2: 경로 + 타입 + 찾아보기 + 추가 -->
                                <Grid Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="3">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="*"/>
                                        <ColumnDefinition Width="8"/>
                                        <ColumnDefinition Width="Auto"/>
                                        <ColumnDefinition Width="8"/>
                                        <ColumnDefinition Width="76"/>
                                        <ColumnDefinition Width="8"/>
                                        <ColumnDefinition Width="Auto"/>
                                    </Grid.ColumnDefinitions>
                                    <TextBox Grid.Column="0"
                                             Style="{StaticResource ModernTextBox}"
                                             Text="{Binding NewTarget, UpdateSourceTrigger=PropertyChanged}"
                                             Tag="경로 또는 URL (예: C:\...\app.exe, https://...)"
                                             ToolTip="앱 실행 파일 경로, URL, 또는 폴더 경로"/>
                                    <!-- 파일 선택 버튼 -->
                                    <Button Grid.Column="2" Style="{StaticResource IconButton}"
                                            Click="Browse_Click" ToolTip="앱 파일 선택 (.exe)">
                                        <TextBlock Text="&#xE8DA;" FontFamily="Segoe MDL2 Assets"
                                                   FontSize="13" Foreground="#555566"/>
                                    </Button>
                                    <!-- 타입 콤보 -->
                                    <ComboBox Grid.Column="4"
                                              SelectedValue="{Binding NewType}"
                                              SelectedValuePath="Tag"
                                              Height="32" FontSize="12"
                                              VerticalContentAlignment="Center">
                                        <ComboBoxItem Tag="app">
                                            <StackPanel Orientation="Horizontal">
                                                <TextBlock Text="&#xECAA;" FontFamily="Segoe MDL2 Assets" FontSize="12" Margin="0,0,6,0" VerticalAlignment="Center" Foreground="#4B5EFC"/>
                                                <TextBlock Text="앱"/>
                                            </StackPanel>
                                        </ComboBoxItem>
                                        <ComboBoxItem Tag="url">
                                            <StackPanel Orientation="Horizontal">
                                                <TextBlock Text="&#xE774;" FontFamily="Segoe MDL2 Assets" FontSize="12" Margin="0,0,6,0" VerticalAlignment="Center" Foreground="#0078D4"/>
                                                <TextBlock Text="URL"/>
                                            </StackPanel>
                                        </ComboBoxItem>
                                        <ComboBoxItem Tag="folder">
                                            <StackPanel Orientation="Horizontal">
                                                <TextBlock Text="&#xE8B7;" FontFamily="Segoe MDL2 Assets" FontSize="12" Margin="0,0,6,0" VerticalAlignment="Center" Foreground="#107C10"/>
                                                <TextBlock Text="폴더"/>
                                            </StackPanel>
                                        </ComboBoxItem>
                                    </ComboBox>
                                    <!-- 추가 버튼 -->
                                    <Button Grid.Column="6" Style="{StaticResource PrimaryButton}"
                                            Padding="14,0" Height="32" Click="AddShortcut_Click">
                                        <StackPanel Orientation="Horizontal">
                                            <TextBlock Text="&#xE710;" FontFamily="Segoe MDL2 Assets"
                                                       FontSize="12" Margin="0,0,5,0" VerticalAlignment="Center"/>
                                            <TextBlock Text="추가" VerticalAlignment="Center"/>
                                        </StackPanel>
                                    </Button>
                                </Grid>
                            </Grid>
                        </Border>

                        <!-- 목록 헤더 -->
                        <Grid Margin="4,2,4,4">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="38"/>
                                <ColumnDefinition Width="110"/>
                                <ColumnDefinition Width="150"/>
                                <ColumnDefinition Width="*"/>
                                <ColumnDefinition Width="32"/>
                            </Grid.ColumnDefinitions>
                            <TextBlock Grid.Column="1" Text="키워드"   Style="{StaticResource RowHint}"/>
                            <TextBlock Grid.Column="2" Text="설명"     Style="{StaticResource RowHint}"/>
                            <TextBlock Grid.Column="3" Text="실행 대상" Style="{StaticResource RowHint}"/>
                        </Grid>
                    </StackPanel>

                    <!-- 단축키 목록 -->
                    <ScrollViewer Grid.Row="1" VerticalScrollBarVisibility="Auto"
                                  HorizontalScrollBarVisibility="Disabled">
                        <ItemsControl ItemsSource="{Binding AppShortcuts}">
                            <ItemsControl.ItemTemplate>
                                <DataTemplate DataType="{x:Type vm:AppShortcutModel}">
                                    <Border Background="White" CornerRadius="9"
                                            Margin="0,0,0,2" Padding="10,10">
                                        <Grid>
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition Width="38"/>
                                                <ColumnDefinition Width="110"/>
                                                <ColumnDefinition Width="150"/>
                                                <ColumnDefinition Width="*"/>
                                                <ColumnDefinition Width="32"/>
                                            </Grid.ColumnDefinitions>
                                            <!-- 타입 아이콘 박스 -->
                                            <Border Grid.Column="0" Width="28" Height="28" CornerRadius="7"
                                                    Background="#EEF0FF" VerticalAlignment="Center">
                                                <TextBlock Text="{Binding TypeSymbol}"
                                                           FontFamily="Segoe MDL2 Assets" FontSize="13"
                                                           Foreground="#4B5EFC"
                                                           HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                            </Border>
                                            <!-- 키워드 -->
                                            <TextBlock Grid.Column="1"
                                                       Text="{Binding Key}"
                                                       FontSize="13" FontWeight="SemiBold"
                                                       Foreground="#1A1B2E"
                                                       VerticalAlignment="Center" Margin="8,0,6,0"/>
                                            <!-- 설명 -->
                                            <TextBlock Grid.Column="2"
                                                       Text="{Binding Description}"
                                                       FontSize="12" Foreground="#5A5C80"
                                                       VerticalAlignment="Center"
                                                       TextTrimming="CharacterEllipsis" Margin="0,0,8,0"/>
                                            <!-- 경로 -->
                                            <TextBlock Grid.Column="3"
                                                       Text="{Binding Target}"
                                                       FontSize="11" Foreground="#9999BB"
                                                       FontFamily="Consolas, Courier New"
                                                       VerticalAlignment="Center"
                                                       TextTrimming="CharacterEllipsis"/>
                                            <!-- 삭제 -->
                                            <Button Grid.Column="4"
                                                    Style="{StaticResource DeleteButton}"
                                                    Tag="{Binding}" Click="DeleteShortcut_Click"
                                                    ToolTip="삭제" VerticalAlignment="Center"/>
                                        </Grid>
                                    </Border>
                                </DataTemplate>
                            </ItemsControl.ItemTemplate>
                        </ItemsControl>
                    </ScrollViewer>

                </Grid>
            </TabItem>

            <!-- ════════════════════════════════════════════════════════════ -->
            <!-- 8. 배치 명령 탭                                               -->
            <!-- ════════════════════════════════════════════════════════════ -->
            <TabItem Header="배치 명령" Tag="&#xE756;" Style="{StaticResource SideNavItem}">
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="*"/>
                    </Grid.RowDefinitions>

                    <StackPanel Grid.Row="0">
                        <TextBlock Text="배치 명령 (&gt; 예약어)" Style="{StaticResource SectionHeader}"/>
                        <!-- 안내 배너 -->
                        <Border Background="White" CornerRadius="10" Padding="14,11" Margin="0,0,0,10">
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="*"/>
                                </Grid.ColumnDefinitions>
                                <Border Grid.Column="0" Width="36" Height="36" CornerRadius="9"
                                        Background="#323130" Margin="0,0,12,0" VerticalAlignment="Center">
                                    <TextBlock Text="&#xE756;" FontFamily="Segoe MDL2 Assets" FontSize="17"
                                               Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                </Border>
                                <TextBlock Grid.Column="1" FontSize="12" Foreground="#444466"
                                           TextWrapping="Wrap" VerticalAlignment="Center">
                                    <Run FontWeight="SemiBold" Foreground="#323130">&gt;키워드</Run>
                                    <Run>로 PowerShell/배치 명령을 빠르게 실행합니다. ShowWindow를 켜면 터미널 창이 표시됩니다.</Run>
                                </TextBlock>
                            </Grid>
                        </Border>

                        <!-- 입력 폼 -->
                        <Border Background="White" CornerRadius="10" Padding="16,14" Margin="0,0,0,10"
                                BorderBrush="#E0E0EC" BorderThickness="1.5">
                            <Grid>
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="8"/>
                                    <RowDefinition Height="Auto"/>
                                </Grid.RowDefinitions>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="130"/>
                                    <ColumnDefinition Width="8"/>
                                    <ColumnDefinition Width="*"/>
                                    <ColumnDefinition Width="8"/>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="8"/>
                                    <ColumnDefinition Width="Auto"/>
                                </Grid.ColumnDefinitions>
                                <!-- 키워드 -->
                                <TextBox Grid.Row="0" Grid.Column="0"
                                         Style="{StaticResource ModernTextBox}"
                                         Text="{Binding NewBatchKey, UpdateSourceTrigger=PropertyChanged}"
                                         ToolTip="키워드 (예: build, deploy, test)"/>
                                <!-- 명령어 -->
                                <TextBox Grid.Row="0" Grid.Column="2" Grid.ColumnSpan="5"
                                         Style="{StaticResource ModernTextBox}"
                                         Text="{Binding NewBatchCommand, UpdateSourceTrigger=PropertyChanged}"
                                         ToolTip="실행할 명령어 (예: powershell -File C:\build.ps1)"/>
                                <!-- ShowWindow 토글 + 추가 버튼 -->
                                <StackPanel Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="4"
                                            Orientation="Horizontal" VerticalAlignment="Center">
                                    <CheckBox Style="{StaticResource ToggleSwitch}"
                                              IsChecked="{Binding NewBatchShowWindow}"
                                              VerticalAlignment="Center"/>
                                    <TextBlock Text="창 표시 (ShowWindow)" FontSize="12"
                                               Foreground="#555577" VerticalAlignment="Center" Margin="10,0,0,0"/>
                                </StackPanel>
                                <Button Grid.Row="2" Grid.Column="6"
                                        Style="{StaticResource PrimaryButton}"
                                        Padding="14,0" Height="32"
                                        Click="AddBatchCommand_Click">
                                    <StackPanel Orientation="Horizontal">
                                        <TextBlock Text="&#xE710;" FontFamily="Segoe MDL2 Assets"
                                                   FontSize="12" Margin="0,0,5,0" VerticalAlignment="Center"/>
                                        <TextBlock Text="추가" VerticalAlignment="Center"/>
                                    </StackPanel>
                                </Button>
                            </Grid>
                        </Border>

                        <!-- 목록 헤더 -->
                        <Grid Margin="4,2,4,4">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="38"/>
                                <ColumnDefinition Width="130"/>
                                <ColumnDefinition Width="*"/>
                                <ColumnDefinition Width="60"/>
                                <ColumnDefinition Width="32"/>
                            </Grid.ColumnDefinitions>
                            <TextBlock Grid.Column="1" Text="키워드"  Style="{StaticResource RowHint}"/>
                            <TextBlock Grid.Column="2" Text="명령어"  Style="{StaticResource RowHint}"/>
                            <TextBlock Grid.Column="3" Text="창 표시" Style="{StaticResource RowHint}" HorizontalAlignment="Center"/>
                        </Grid>
                    </StackPanel>

                    <!-- 배치 명령 목록 -->
                    <ScrollViewer Grid.Row="1" VerticalScrollBarVisibility="Auto"
                                  HorizontalScrollBarVisibility="Disabled">
                        <ItemsControl ItemsSource="{Binding BatchCommands}">
                            <ItemsControl.ItemTemplate>
                                <DataTemplate DataType="{x:Type vm:BatchCommandModel}">
                                    <Border Background="White" CornerRadius="9"
                                            Margin="0,0,0,2" Padding="10,10">
                                        <Grid>
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition Width="38"/>
                                                <ColumnDefinition Width="130"/>
                                                <ColumnDefinition Width="*"/>
                                                <ColumnDefinition Width="60"/>
                                                <ColumnDefinition Width="32"/>
                                            </Grid.ColumnDefinitions>
                                            <!-- 아이콘 -->
                                            <Border Grid.Column="0" Width="28" Height="28" CornerRadius="7"
                                                    Background="#2A2A2F" VerticalAlignment="Center">
                                                <TextBlock Text="&#xE756;"
                                                           FontFamily="Segoe MDL2 Assets" FontSize="13"
                                                           Foreground="White"
                                                           HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                            </Border>
                                            <!-- 키워드 -->
                                            <TextBlock Grid.Column="1"
                                                       Text="{Binding Key}"
                                                       FontSize="13" FontWeight="SemiBold"
                                                       Foreground="#1A1B2E"
                                                       VerticalAlignment="Center" Margin="8,0,6,0"/>
                                            <!-- 명령어 -->
                                            <TextBlock Grid.Column="2"
                                                       Text="{Binding Command}"
                                                       FontSize="11" Foreground="#9999BB"
                                                       FontFamily="Consolas, Courier New"
                                                       VerticalAlignment="Center"
                                                       TextTrimming="CharacterEllipsis"/>
                                            <!-- ShowWindow -->
                                            <TextBlock Grid.Column="3"
                                                       FontFamily="Segoe MDL2 Assets" FontSize="14"
                                                       HorizontalAlignment="Center" VerticalAlignment="Center">
                                                <TextBlock.Style>
                                                    <Style TargetType="TextBlock">
                                                        <Setter Property="Text" Value="&#xE73C;"/>
                                                        <Setter Property="Foreground" Value="#CCCCDD"/>
                                                        <Style.Triggers>
                                                            <DataTrigger Binding="{Binding ShowWindow}" Value="True">
                                                                <Setter Property="Text" Value="&#xE73E;"/>
                                                                <Setter Property="Foreground" Value="#4B5EFC"/>
                                                            </DataTrigger>
                                                        </Style.Triggers>
                                                    </Style>
                                                </TextBlock.Style>
                                            </TextBlock>
                                            <!-- 삭제 -->
                                            <Button Grid.Column="4"
                                                    Style="{StaticResource DeleteButton}"
                                                    Tag="{Binding}" Click="DeleteBatchCommand_Click"
                                                    ToolTip="삭제" VerticalAlignment="Center"/>
                                        </Grid>
                                    </Border>
                                </DataTemplate>
                            </ItemsControl.ItemTemplate>
                        </ItemsControl>
                    </ScrollViewer>

                </Grid>
            </TabItem>

            <!-- ══════════════════════════════════════════════════════════════
                 전용 핫키 탭 — 어떤 앱에서든 항목별 글로벌 단축키 즉시 실행
            ══════════════════════════════════════════════════════════════ -->
            <TabItem Header="전용 핫키" Tag="&#xE7C3;" Style="{StaticResource SideNavItem}">
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="*"/>
                    </Grid.RowDefinitions>

                    <StackPanel Grid.Row="0">
                        <TextBlock Text="항목별 전용 핫키" Style="{StaticResource SectionHeader}"/>

                        <!-- 안내 배너 -->
                        <Border Background="White" CornerRadius="10" Padding="14,11" Margin="0,0,0,10">
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="*"/>
                                </Grid.ColumnDefinitions>
                                <Border Grid.Column="0" Width="36" Height="36" CornerRadius="9"
                                        Background="#4B5EFC" Margin="0,0,12,0" VerticalAlignment="Center">
                                    <TextBlock Text="&#xE7C3;" FontFamily="Segoe MDL2 Assets" FontSize="17"
                                               Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                </Border>
                                <TextBlock Grid.Column="1" FontSize="12" Foreground="#444466"
                                           TextWrapping="Wrap" VerticalAlignment="Center">
                                    어떤 앱이 포커스를 가져도 등록된 <Run FontWeight="SemiBold" Foreground="#4B5EFC">전용 핫키</Run>로 파일·폴더·앱·URL을 즉시 실행합니다.
                                    지원 형식: <Run FontWeight="SemiBold">Ctrl+Alt+1</Run>, <Run FontWeight="SemiBold">Ctrl+Shift+F2</Run> 등
                                </TextBlock>
                            </Grid>
                        </Border>

                        <!-- 입력 폼 -->
                        <Border Background="White" CornerRadius="10" Padding="16,14" Margin="0,0,0,10"
                                BorderBrush="#E0E0EC" BorderThickness="1.5">
                            <Grid>
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="8"/>
                                    <RowDefinition Height="Auto"/>
                                </Grid.RowDefinitions>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="150"/>
                                    <ColumnDefinition Width="8"/>
                                    <ColumnDefinition Width="*"/>
                                    <ColumnDefinition Width="8"/>
                                    <ColumnDefinition Width="*"/>
                                </Grid.ColumnDefinitions>

                                <!-- 행 1: 핫키 + 표시 이름 + 타입 -->
                                <Border Grid.Row="0" Grid.Column="0" CornerRadius="6" Padding="8,6"
                                        Background="#F5F5FA" BorderBrush="#D0D0E0" BorderThickness="1"
                                        Cursor="IBeam" x:Name="HotkeyRecordBorder"
                                        MouseLeftButtonUp="HotkeyRecord_Click"
                                        ToolTip="클릭 후 키를 누르면 자동 입력됩니다">
                                    <Grid>
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="*"/>
                                            <ColumnDefinition Width="Auto"/>
                                        </Grid.ColumnDefinitions>
                                        <TextBlock x:Name="HotkeyRecordText" Grid.Column="0"
                                                   Text="{Binding NewHotkeyStr, FallbackValue='핫키 클릭 후 입력'}"
                                                   FontSize="13" FontWeight="SemiBold" Foreground="#4B5EFC"
                                                   VerticalAlignment="Center"/>
                                        <TextBlock Grid.Column="1" Text="&#xE8AB;" FontFamily="Segoe MDL2 Assets"
                                                   FontSize="12" Foreground="#8888AA" Margin="6,0,0,0"
                                                   VerticalAlignment="Center"/>
                                    </Grid>
                                </Border>

                                <TextBox Grid.Row="0" Grid.Column="2"
                                         Style="{StaticResource ModernTextBox}"
                                         Text="{Binding NewHotkeyLabel, UpdateSourceTrigger=PropertyChanged}"
                                         Tag="표시 이름 (예: 내 문서 폴더)"
                                         ToolTip="AX Commander 결과에 표시될 이름 (비워두면 파일명 자동 사용)"/>

                                <!-- 타입 드롭다운 -->
                                <ComboBox Grid.Row="0" Grid.Column="4"
                                          SelectedValue="{Binding NewHotkeyType}"
                                          SelectedValuePath="Tag">
                                    <ComboBoxItem Tag="app">앱 (exe)</ComboBoxItem>
                                    <ComboBoxItem Tag="folder">폴더</ComboBoxItem>
                                    <ComboBoxItem Tag="url">URL</ComboBoxItem>
                                    <ComboBoxItem Tag="command">명령어</ComboBoxItem>
                                </ComboBox>

                                <!-- 행 2: 대상 경로 + 찾아보기 + 추가 -->
                                <Grid Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="5">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="*"/>
                                        <ColumnDefinition Width="8"/>
                                        <ColumnDefinition Width="Auto"/>
                                        <ColumnDefinition Width="8"/>
                                        <ColumnDefinition Width="Auto"/>
                                    </Grid.ColumnDefinitions>
                                    <TextBox Grid.Column="0"
                                             Style="{StaticResource ModernTextBox}"
                                             Text="{Binding NewHotkeyTarget, UpdateSourceTrigger=PropertyChanged}"
                                             Tag="대상 경로 또는 URL"
                                             ToolTip="앱 실행 파일 경로, 폴더 경로, 또는 URL"/>
                                    <Button Grid.Column="2" Style="{StaticResource IconButton}"
                                            Click="BrowseHotkeyTarget_Click" ToolTip="파일/폴더 선택">
                                        <TextBlock Text="&#xE8DA;" FontFamily="Segoe MDL2 Assets"
                                                   FontSize="13" Foreground="#555566"/>
                                    </Button>
                                    <Button Grid.Column="4" Style="{StaticResource PrimaryButton}"
                                            Click="AddHotkey_Click" ToolTip="전용 핫키 추가">
                                        <StackPanel Orientation="Horizontal">
                                            <TextBlock Text="&#xE710;" FontFamily="Segoe MDL2 Assets"
                                                       FontSize="12" Margin="0,0,5,0"/>
                                            <TextBlock Text="추가"/>
                                        </StackPanel>
                                    </Button>
                                </Grid>
                            </Grid>
                        </Border>
                    </StackPanel>

                    <!-- 핫키 목록 -->
                    <ScrollViewer Grid.Row="1" VerticalScrollBarVisibility="Auto">
                        <ItemsControl x:Name="HotkeyList"
                                      ItemsSource="{Binding CustomHotkeys}">
                            <ItemsControl.ItemTemplate>
                                <DataTemplate>
                                    <Border Background="White" CornerRadius="8" Padding="12,10"
                                            Margin="0,0,0,6" BorderBrush="#E8E8F0" BorderThickness="1">
                                        <Grid>
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition Width="Auto"/>
                                                <ColumnDefinition Width="8"/>
                                                <ColumnDefinition Width="Auto"/>
                                                <ColumnDefinition Width="12"/>
                                                <ColumnDefinition Width="*"/>
                                                <ColumnDefinition Width="Auto"/>
                                            </Grid.ColumnDefinitions>

                                            <!-- 타입 아이콘 -->
                                            <Border Grid.Column="0" Width="32" Height="32" CornerRadius="8"
                                                    Background="#EEF0FF">
                                                <TextBlock Text="{Binding TypeSymbol}"
                                                           FontFamily="Segoe MDL2 Assets" FontSize="14"
                                                           Foreground="#4B5EFC"
                                                           HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                            </Border>

                                            <!-- 핫키 배지 -->
                                            <Border Grid.Column="2" CornerRadius="5" Padding="7,3"
                                                    Background="#F3F0FF">
                                                <TextBlock Text="{Binding Hotkey}"
                                                           FontSize="12" FontWeight="Bold"
                                                           Foreground="#4B5EFC"
                                                           FontFamily="Consolas"/>
                                            </Border>

                                            <!-- 이름 + 경로 -->
                                            <StackPanel Grid.Column="4" VerticalAlignment="Center">
                                                <TextBlock Text="{Binding Label}" FontSize="13"
                                                           FontWeight="SemiBold" Foreground="#222244"/>
                                                <TextBlock Text="{Binding Target}" FontSize="11"
                                                           Foreground="#8888AA"
                                                           TextTrimming="CharacterEllipsis"/>
                                            </StackPanel>

                                            <!-- 삭제 버튼 -->
                                            <Border Grid.Column="5" Width="28" Height="28" CornerRadius="6"
                                                    Background="Transparent" Cursor="Hand"
                                                    MouseLeftButtonUp="RemoveHotkey_Click"
                                                    Tag="{Binding}"
                                                    ToolTip="핫키 제거">
                                                <TextBlock Text="&#xE74D;" FontFamily="Segoe MDL2 Assets"
                                                           FontSize="13" Foreground="#CC3333"
                                                           HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                            </Border>
                                        </Grid>
                                    </Border>
                                </DataTemplate>
                            </ItemsControl.ItemTemplate>
                        </ItemsControl>
                    </ScrollViewer>
                </Grid>
            </TabItem>

            <!-- ══════════════════════════════════════════════════════════════
                 기능 탭 — 단축키로 활성/비활성화 가능한 기능들의 ON/OFF 설정
            ══════════════════════════════════════════════════════════════ -->
            <TabItem Header="기능" Tag="&#xE713;" Style="{StaticResource SideNavItem}">
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="*"/>
                    </Grid.RowDefinitions>

                    <TextBlock Grid.Row="0" Text="기능 설정"
                               FontSize="16" FontWeight="SemiBold" Foreground="#1A1B2E"
                               Margin="0,0,0,2"/>

                    <!-- ── 기능 내부 서브탭 ── -->
                    <Border Grid.Row="1" Background="#EEEEF2" CornerRadius="8" Padding="3" Margin="0,4,0,8">
                        <StackPanel x:Name="FunctionSubTabBar" Orientation="Horizontal">
                            <RadioButton x:Name="FuncSubTab_AI" Content="AI 기능" IsChecked="True"
                                         GroupName="FuncSubTab" Style="{StaticResource AgentSubTabStyle}"
                                         Checked="FuncSubTab_Checked"/>
                            <RadioButton x:Name="FuncSubTab_Launcher" Content="AX Commander"
                                         GroupName="FuncSubTab" Style="{StaticResource AgentSubTabStyle}"
                                         Checked="FuncSubTab_Checked"/>
                            <RadioButton x:Name="FuncSubTab_Design" Content="디자인·기타"
                                         GroupName="FuncSubTab" Style="{StaticResource AgentSubTabStyle}"
                                         Checked="FuncSubTab_Checked"/>
                        </StackPanel>
                    </Border>

                    <!-- ═══ 서브탭: AI 기능 ═══ -->
                    <ScrollViewer x:Name="FuncPanel_AI" Grid.Row="2" VerticalScrollBarVisibility="Auto"
                                  HorizontalScrollBarVisibility="Disabled" Padding="0,0,8,0" Visibility="Visible">
                        <StackPanel>

                            <!-- ── 선택 텍스트 AI 명령 ── -->
                            <TextBlock Style="{StaticResource SectionHeader}" Text="선택 텍스트 AI 명령"/>

                            <Border Style="{StaticResource SettingsRow}">
                                <Grid>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="*"/>
                                        <ColumnDefinition Width="Auto"/>
                                    </Grid.ColumnDefinitions>
                                    <StackPanel Grid.Column="0" VerticalAlignment="Center">
                                        <StackPanel Orientation="Horizontal">
                                            <TextBlock Style="{StaticResource RowLabel}" Text="선택 텍스트 AI 명령 사용"/>
                                            <Border Width="16" Height="16" CornerRadius="8" Background="#EEF0FF" Margin="6,0,0,0" Cursor="Help" VerticalAlignment="Center">
                                                <TextBlock Text="?" FontSize="10" FontWeight="Bold" Foreground="#4B5EFC" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                                <Border.ToolTip>
                                                    <ToolTip Style="{StaticResource HelpTooltipStyle}">
                                                        <TextBlock TextWrapping="Wrap" Foreground="White" FontSize="12" LineHeight="18">
                                                            텍스트를 선택(드래그)한 상태에서 핫키를 누르면 커서 위치에 AI 명령 팝업이 나타납니다.
                                                            <LineBreak/>번역, 요약, 문법 교정, 설명, 다시 쓰기 중 선택하여 실행합니다.
                                                            <LineBreak/><LineBreak/>비활성화하면 항상 AX Commander가 열립니다.
                                                        </TextBlock>
                                                    </ToolTip>
                                                </Border.ToolTip>
                                            </Border>
                                        </StackPanel>
                                        <TextBlock Style="{StaticResource RowHint}" Text="텍스트를 선택한 상태에서 핫키를 누르면 AI 명령 팝업이 표시됩니다"/>
                                    </StackPanel>
                                    <CheckBox x:Name="ChkEnableTextAction" Grid.Column="1"
                                              Style="{StaticResource ToggleSwitch}"
                                              HorizontalAlignment="Right" VerticalAlignment="Center"
                                              IsChecked="{Binding EnableTextAction, Mode=TwoWay}"/>
                                </Grid>
                            </Border>

                            <Border Style="{StaticResource SettingsRow}">
                                <StackPanel>
                                    <TextBlock Style="{StaticResource RowLabel}" Text="활성화할 AI 명령"/>
                                    <TextBlock Style="{StaticResource RowHint}" Text="최소 1개 이상 선택해야 합니다. 1개만 선택하면 팝업 없이 바로 실행됩니다."/>
                                    <StackPanel x:Name="TextActionCommandsPanel" Margin="0,8,0,0"/>
                                </StackPanel>
                            </Border>

                            <!-- ── 파일 대화상자 통합 ── -->
                            <TextBlock Style="{StaticResource SectionHeader}" Text="파일 대화상자 연동"/>

                            <Border Style="{StaticResource SettingsRow}">
                                <Grid>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="*"/>
                                        <ColumnDefinition Width="Auto"/>
                                    </Grid.ColumnDefinitions>
                                    <StackPanel Grid.Column="0" VerticalAlignment="Center">
                                        <StackPanel Orientation="Horizontal">
                                            <TextBlock Style="{StaticResource RowLabel}" Text="열기/저장 대화상자에서 런처 자동 열기"/>
                                            <Border Width="16" Height="16" CornerRadius="8" Background="#EEF0FF" Margin="6,0,0,0" Cursor="Help" VerticalAlignment="Center">
                                                <TextBlock Text="?" FontSize="10" FontWeight="Bold" Foreground="#4B5EFC" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                                <Border.ToolTip>
                                                    <ToolTip Style="{StaticResource HelpTooltipStyle}">
                                                        <TextBlock TextWrapping="Wrap" Foreground="White" FontSize="12" LineHeight="18">
                                                            프로그램에서 파일 열기/저장 대화상자가 나타나면 AX Commander가 자동으로 열립니다.
                                                            <LineBreak/>cd 명령으로 원하는 폴더를 빠르게 찾아 이동할 수 있습니다.
                                                        </TextBlock>
                                                    </ToolTip>
                                                </Border.ToolTip>
                                            </Border>
                                        </StackPanel>
                                        <TextBlock Style="{StaticResource RowHint}" Text="Windows 열기/저장 대화상자가 나타나면 런처를 자동으로 엽니다. 브라우저 파일 업로드 시 런처가 열리는 현상이 발생하면 비활성화하세요"/>
                                    </StackPanel>
                                    <CheckBox x:Name="ChkEnableFileDialog" Grid.Column="1"
                                              Style="{StaticResource ToggleSwitch}"
                                              HorizontalAlignment="Right" VerticalAlignment="Center"
                                              IsChecked="{Binding EnableFileDialogIntegration, Mode=TwoWay}"/>
                                </Grid>
                            </Border>

                            <!-- ── 번역 기본 언어 ── -->
                            <Border Style="{StaticResource SettingsRow}">
                                <Grid>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="*"/>
                                        <ColumnDefinition Width="Auto"/>
                                    </Grid.ColumnDefinitions>
                                    <StackPanel Grid.Column="0" VerticalAlignment="Center">
                                        <TextBlock Style="{StaticResource RowLabel}" Text="번역 기본 언어"/>
                                        <TextBlock Style="{StaticResource RowHint}" Text="선택 텍스트 AI 번역 시 기본 대상 언어"/>
                                    </StackPanel>
                                    <ComboBox Grid.Column="1"
                                              SelectedValue="{Binding TextActionTranslateLanguage}"
                                              SelectedValuePath="Tag"
                                              Width="140" VerticalAlignment="Center">
                                        <ComboBoxItem Content="자동 감지" Tag="auto"/>
                                        <ComboBoxItem Content="한국어 → 영어" Tag="ko-en"/>
                                        <ComboBoxItem Content="영어 → 한국어" Tag="en-ko"/>
                                        <ComboBoxItem Content="한국어 → 일본어" Tag="ko-ja"/>
                                        <ComboBoxItem Content="한국어 → 중국어" Tag="ko-zh"/>
                                    </ComboBox>
                                </Grid>
                            </Border>

                        </StackPanel>
                    </ScrollViewer>

                    <!-- ═══ 서브탭: AX Commander ═══ -->
                    <ScrollViewer x:Name="FuncPanel_Launcher" Grid.Row="2" VerticalScrollBarVisibility="Auto"
                                  HorizontalScrollBarVisibility="Disabled" Padding="0,0,8,0" Visibility="Collapsed">
                        <StackPanel>

                            <!-- ── UI 표시 ── -->
                            <TextBlock Style="{StaticResource SectionHeader}" Text="UI 표시"/>

                            <!-- 번호 배지 -->
                            <Border Style="{StaticResource SettingsRow}">
                                <Grid>
                                    <StackPanel HorizontalAlignment="Left">
                                        <TextBlock Style="{StaticResource RowLabel}" Text="번호 배지 표시"/>
                                        <TextBlock Style="{StaticResource RowHint}"
                                                   Text="결과 항목 앞에 1~9 번호 표시. Ctrl+숫자로 바로 실행합니다."/>
                                    </StackPanel>
                                    <CheckBox Style="{StaticResource ToggleSwitch}"
                                              HorizontalAlignment="Right" VerticalAlignment="Center"
                                              IsChecked="{Binding ShowNumberBadges, Mode=TwoWay}"/>
                                </Grid>
                            </Border>

                            <!-- 예약어 배지 -->
                            <Border Style="{StaticResource SettingsRow}">
                                <Grid>
                                    <StackPanel HorizontalAlignment="Left">
                                        <TextBlock Style="{StaticResource RowLabel}" Text="예약어 배지 표시"/>
                                        <TextBlock Style="{StaticResource RowHint}"
                                                   Text="입력창 좌측에 현재 활성 예약어(cd / ~ / # 등) 배지를 표시합니다."/>
                                    </StackPanel>
                                    <CheckBox Style="{StaticResource ToggleSwitch}"
                                              HorizontalAlignment="Right" VerticalAlignment="Center"
                                              IsChecked="{Binding ShowPrefixBadge, Mode=TwoWay}"/>
                                </Grid>
                            </Border>

                            <!-- ── 런처 동작 ── -->
                            <TextBlock Style="{StaticResource SectionHeader}" Text="AX Commander 동작"/>

                            <!-- 포커스 잃으면 닫기 -->
                            <Border Style="{StaticResource SettingsRow}">
                                <Grid>
                                    <StackPanel HorizontalAlignment="Left">
                                        <TextBlock Style="{StaticResource RowLabel}" Text="포커스 잃으면 자동 닫기"/>
                                        <TextBlock Style="{StaticResource RowHint}"
                                                   Text="AX Commander 창이 포커스를 잃으면 자동으로 닫힙니다. 끄면 수동으로 닫아야 합니다."/>
                                    </StackPanel>
                                    <CheckBox Style="{StaticResource ToggleSwitch}"
                                              HorizontalAlignment="Right" VerticalAlignment="Center"
                                              IsChecked="{Binding CloseOnFocusLost, Mode=TwoWay}"/>
                                </Grid>
                            </Border>

                            <!-- 창 위치 기억 -->
                            <Border Style="{StaticResource SettingsRow}">
                                <Grid>
                                    <StackPanel HorizontalAlignment="Left">
                                        <TextBlock Style="{StaticResource RowLabel}" Text="마지막 위치 기억"/>
                                        <TextBlock Style="{StaticResource RowHint}"
                                                   Text="AX Commander를 닫은 위치를 기억하고 다음에 같은 위치에서 엽니다."/>
                                    </StackPanel>
                                    <CheckBox Style="{StaticResource ToggleSwitch}"
                                              HorizontalAlignment="Right" VerticalAlignment="Center"
                                              IsChecked="{Binding RememberPosition, Mode=TwoWay}"/>
                                </Grid>
                            </Border>

                            <!-- 액션 모드 -->
                            <Border Style="{StaticResource SettingsRow}">
                                <Grid>
                                    <StackPanel HorizontalAlignment="Left">
                                        <TextBlock Style="{StaticResource RowLabel}" Text="액션 모드 사용"/>
                                        <TextBlock Style="{StaticResource RowHint}"
                                                   Text="파일 선택 후 → 키 또는 Ctrl+Enter / Alt+Enter로 추가 동작(복사·열기·관리자 실행 등) 메뉴에 진입합니다."/>
                                    </StackPanel>
                                    <CheckBox Style="{StaticResource ToggleSwitch}"
                                              HorizontalAlignment="Right" VerticalAlignment="Center"
                                              IsChecked="{Binding EnableActionMode, Mode=TwoWay}"/>
                                </Grid>
                            </Border>

                            <!-- ── 기록 기능 ── -->
                            <TextBlock Style="{StaticResource SectionHeader}" Text="기록 기능"/>

                            <!-- 최근 실행 기록 -->
                            <Border Style="{StaticResource SettingsRow}">
                                <Grid>
                                    <StackPanel HorizontalAlignment="Left">
                                        <TextBlock Style="{StaticResource RowLabel}" Text="최근 실행 기록 저장"/>
                                        <TextBlock Style="{StaticResource RowHint}"
                                                   Text="실행한 항목을 recent 목록에 저장합니다. Ctrl+R 또는 'recent' 입력으로 조회합니다."/>
                                    </StackPanel>
                                    <CheckBox Style="{StaticResource ToggleSwitch}"
                                              HorizontalAlignment="Right" VerticalAlignment="Center"
                                              IsChecked="{Binding EnableRecent, Mode=TwoWay}"/>
                                </Grid>
                            </Border>

                            <!-- 즐겨찾기 -->
                            <Border Style="{StaticResource SettingsRow}">
                                <Grid>
                                    <StackPanel HorizontalAlignment="Left">
                                        <TextBlock Style="{StaticResource RowLabel}" Text="즐겨찾기 기능 사용"/>
                                        <TextBlock Style="{StaticResource RowHint}"
                                                   Text="자주 쓰는 파일·폴더를 즐겨찾기에 등록합니다. Ctrl+B 또는 'fav' 입력, Ctrl+P로 현재 항목을 즉시 추가/제거합니다."/>
                                    </StackPanel>
                                    <CheckBox Style="{StaticResource ToggleSwitch}"
                                              HorizontalAlignment="Right" VerticalAlignment="Center"
                                              IsChecked="{Binding EnableFavorites, Mode=TwoWay}"/>
                                </Grid>
                            </Border>

                        </StackPanel>
                    </ScrollViewer>

                    <!-- ═══ 서브탭: 디자인·기타 ═══ -->
                    <ScrollViewer x:Name="FuncPanel_Design" Grid.Row="2" VerticalScrollBarVisibility="Auto"
                                  HorizontalScrollBarVisibility="Disabled" Padding="0,0,8,0" Visibility="Collapsed">
                        <StackPanel>

                            <!-- ── 클립보드 확장 ── -->
                            <TextBlock Style="{StaticResource SectionHeader}" Text="클립보드 확장"/>

                            <Border Style="{StaticResource SettingsRow}">
                                <Grid>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="*"/>
                                        <ColumnDefinition Width="Auto"/>
                                    </Grid.ColumnDefinitions>
                                    <StackPanel Grid.Column="0" VerticalAlignment="Center">
                                        <StackPanel Orientation="Horizontal">
                                            <TextBlock Style="{StaticResource RowLabel}" Text="자동 카테고리 분류"/>
                                            <Border Width="16" Height="16" CornerRadius="8" Background="#EEF0FF" Margin="6,0,0,0" Cursor="Help" VerticalAlignment="Center">
                                                <TextBlock Text="?" FontSize="10" FontWeight="Bold" Foreground="#4B5EFC" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                                <Border.ToolTip>
                                                    <ToolTip Style="{StaticResource HelpTooltipStyle}">
                                                        <TextBlock TextWrapping="Wrap" Foreground="White" FontSize="12" LineHeight="18">
                                                            복사한 텍스트를 자동으로 분류합니다:
                                                            <LineBreak/>• URL — http/https 링크
                                                            <LineBreak/>• 코드 — class, function, import 등 포함
                                                            <LineBreak/>• 경로 — C:\, \\서버\ 형태의 파일 경로
                                                            <LineBreak/>• 일반 — 위에 해당하지 않는 텍스트
                                                            <LineBreak/><LineBreak/>#url, #코드, #경로 로 필터링 가능합니다.
                                                        </TextBlock>
                                                    </ToolTip>
                                                </Border.ToolTip>
                                            </Border>
                                        </StackPanel>
                                        <TextBlock Style="{StaticResource RowHint}" Text="복사한 텍스트를 URL/코드/경로/일반으로 자동 분류합니다"/>
                                    </StackPanel>
                                    <CheckBox x:Name="ChkEnableAutoCategory" Grid.Column="1"
                                              Style="{StaticResource ToggleSwitch}"
                                              HorizontalAlignment="Right" VerticalAlignment="Center"
                                              IsChecked="{Binding EnableClipboardAutoCategory, Mode=TwoWay}"/>
                                </Grid>
                            </Border>

                            <Border Style="{StaticResource SettingsRow}">
                                <Grid>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="*"/>
                                        <ColumnDefinition Width="Auto"/>
                                    </Grid.ColumnDefinitions>
                                    <StackPanel Grid.Column="0" VerticalAlignment="Center">
                                        <TextBlock Style="{StaticResource RowLabel}" Text="최대 핀 고정 개수"/>
                                        <TextBlock Style="{StaticResource RowHint}" Text="핀 고정할 수 있는 클립보드 항목의 최대 수"/>
                                    </StackPanel>
                                    <ComboBox Grid.Column="1"
                                              SelectedValue="{Binding MaxPinnedClipboardItems}"
                                              SelectedValuePath="Tag"
                                              Width="100" VerticalAlignment="Center">
                                        <ComboBoxItem Content="10개" Tag="10"/>
                                        <ComboBoxItem Content="20개" Tag="20"/>
                                        <ComboBoxItem Content="30개" Tag="30"/>
                                        <ComboBoxItem Content="50개" Tag="50"/>
                                    </ComboBox>
                                </Grid>
                            </Border>

                            <!-- ── 디자인 ── -->
                            <TextBlock Style="{StaticResource SectionHeader}" Text="디자인"/>

                            <!-- 아이콘 애니메이션 -->
                            <Border Style="{StaticResource SettingsRow}">
                                <Grid>
                                    <StackPanel HorizontalAlignment="Left">
                                        <TextBlock Style="{StaticResource RowLabel}" Text="아이콘 애니메이션 효과"/>
                                        <TextBlock Style="{StaticResource RowHint}"
                                                   Text="AX Commander 입력창 왼쪽 다이아몬드 픽셀 아이콘에 점멸·회전 등 애니메이션 효과를 적용합니다."/>
                                    </StackPanel>
                                    <CheckBox Style="{StaticResource ToggleSwitch}"
                                              HorizontalAlignment="Right" VerticalAlignment="Center"
                                              IsChecked="{Binding EnableIconAnimation, Mode=TwoWay}"/>
                                </Grid>
                            </Border>

                            <!-- 안내 문구 랜덤 -->
                            <Border Style="{StaticResource SettingsRow}">
                                <Grid>
                                    <StackPanel HorizontalAlignment="Left">
                                        <TextBlock Style="{StaticResource RowLabel}" Text="안내 문구 랜덤 출력"/>
                                        <TextBlock Style="{StaticResource RowHint}"
                                                   Text="AX Commander 입력창 플레이스홀더 문구를 열 때마다 다양하게 표시합니다. 끄면 기본 문구만 표시됩니다."/>
                                    </StackPanel>
                                    <CheckBox Style="{StaticResource ToggleSwitch}"
                                              HorizontalAlignment="Right" VerticalAlignment="Center"
                                              IsChecked="{Binding EnableRandomPlaceholder, Mode=TwoWay}"/>
                                </Grid>
                            </Border>

                            <!-- 런처 테두리 표시 -->
                            <Border Style="{StaticResource SettingsRow}">
                                <Grid>
                                    <StackPanel HorizontalAlignment="Left">
                                        <TextBlock Style="{StaticResource RowLabel}" Text="AX Commander 창 테두리"/>
                                        <TextBlock Style="{StaticResource RowHint}"
                                                   Text="AX Commander 창 가장자리에 테마 색상 테두리를 표시합니다"/>
                                    </StackPanel>
                                    <CheckBox Style="{StaticResource ToggleSwitch}"
                                              HorizontalAlignment="Right" VerticalAlignment="Center"
                                              IsChecked="{Binding ShowLauncherBorder, Mode=TwoWay}"/>
                                </Grid>
                            </Border>

                            <!-- 단축키 도움말 테마 색상 -->
                            <Border Style="{StaticResource SettingsRow}">
                                <Grid>
                                    <StackPanel HorizontalAlignment="Left">
                                        <TextBlock Style="{StaticResource RowLabel}" Text="도움말 창 테마 색상"/>
                                        <TextBlock Style="{StaticResource RowHint}"
                                                   Text="단축키 도움말(Ctrl+K)의 아이콘 색상을 테마 액센트 색상으로 통일합니다"/>
                                    </StackPanel>
                                    <CheckBox Style="{StaticResource ToggleSwitch}"
                                              HorizontalAlignment="Right" VerticalAlignment="Center"
                                              IsChecked="{Binding ShortcutHelpUseThemeColor, Mode=TwoWay}"/>
                                </Grid>
                            </Border>

                            <!-- ── 스니펫 ── -->
                            <TextBlock Style="{StaticResource SectionHeader}" Text="스니펫"/>

                            <!-- 스니펫 자동 확장 -->
                            <Border Style="{StaticResource SettingsRow}">
                                <Grid>
                                    <StackPanel HorizontalAlignment="Left">
                                        <TextBlock Style="{StaticResource RowLabel}" Text="스니펫 자동 확장"/>
                                        <TextBlock Style="{StaticResource RowHint}"
                                                   Text="등록된 키워드를 입력하면 전체 텍스트로 즉시 확장합니다. 스니펫 탭에서 키워드·내용을 관리합니다."/>
                                    </StackPanel>
                                    <CheckBox Style="{StaticResource ToggleSwitch}"
                                              HorizontalAlignment="Right" VerticalAlignment="Center"
                                              IsChecked="{Binding SnippetAutoExpand, Mode=TwoWay}"/>
                                </Grid>
                            </Border>

                            <!-- ── 단축키 참조 ── -->
                            <TextBlock Style="{StaticResource SectionHeader}" Text="단축키 참조"/>

                            <Border Background="#F5F7FF" CornerRadius="10" Padding="16,14" Margin="0,0,0,3">
                                <StackPanel>
                                    <TextBlock FontSize="11" Foreground="#4B5EFC" FontWeight="SemiBold"
                                               Margin="0,0,0,8">주요 기능 단축키 목록</TextBlock>
                                    <Grid>
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="130"/>
                                            <ColumnDefinition Width="*"/>
                                        </Grid.ColumnDefinitions>
                                        <Grid.RowDefinitions>
                                            <RowDefinition Height="22"/>
                                            <RowDefinition Height="22"/>
                                            <RowDefinition Height="22"/>
                                            <RowDefinition Height="22"/>
                                            <RowDefinition Height="22"/>
                                            <RowDefinition Height="22"/>
                                            <RowDefinition Height="22"/>
                                            <RowDefinition Height="22"/>
                                            <RowDefinition Height="22"/>
                                            <RowDefinition Height="22"/>
                                        </Grid.RowDefinitions>
                                        <!-- 행 1 -->
                                        <Border Grid.Row="0" Grid.Column="0" Background="#E8EAFF" CornerRadius="4" Padding="6,2" Margin="0,1,6,1" HorizontalAlignment="Left">
                                            <TextBlock Text="Ctrl+B" FontFamily="Consolas" FontSize="11" Foreground="#2B3280"/>
                                        </Border>
                                        <TextBlock Grid.Row="0" Grid.Column="1" Text="즐겨찾기 목록 보기 / 숨기기" FontSize="11" Foreground="#555577" VerticalAlignment="Center"/>
                                        <!-- 행 2 -->
                                        <Border Grid.Row="1" Grid.Column="0" Background="#E8EAFF" CornerRadius="4" Padding="6,2" Margin="0,1,6,1" HorizontalAlignment="Left">
                                            <TextBlock Text="Ctrl+P" FontFamily="Consolas" FontSize="11" Foreground="#2B3280"/>
                                        </Border>
                                        <TextBlock Grid.Row="1" Grid.Column="1" Text="현재 선택 항목 즐겨찾기 추가/제거" FontSize="11" Foreground="#555577" VerticalAlignment="Center"/>
                                        <!-- 행 3 -->
                                        <Border Grid.Row="2" Grid.Column="0" Background="#E8EAFF" CornerRadius="4" Padding="6,2" Margin="0,1,6,1" HorizontalAlignment="Left">
                                            <TextBlock Text="Ctrl+R" FontFamily="Consolas" FontSize="11" Foreground="#2B3280"/>
                                        </Border>
                                        <TextBlock Grid.Row="2" Grid.Column="1" Text="최근 실행 목록 보기 / 숨기기" FontSize="11" Foreground="#555577" VerticalAlignment="Center"/>
                                        <!-- 행 4 -->
                                        <Border Grid.Row="3" Grid.Column="0" Background="#E8EAFF" CornerRadius="4" Padding="6,2" Margin="0,1,6,1" HorizontalAlignment="Left">
                                            <TextBlock Text="Ctrl+T" FontFamily="Consolas" FontSize="11" Foreground="#2B3280"/>
                                        </Border>
                                        <TextBlock Grid.Row="3" Grid.Column="1" Text="선택 항목 위치에서 터미널 열기" FontSize="11" Foreground="#555577" VerticalAlignment="Center"/>
                                        <!-- 행 5 -->
                                        <Border Grid.Row="4" Grid.Column="0" Background="#E8EAFF" CornerRadius="4" Padding="6,2" Margin="0,1,6,1" HorizontalAlignment="Left">
                                            <TextBlock Text="Ctrl+W" FontFamily="Consolas" FontSize="11" Foreground="#2B3280"/>
                                        </Border>
                                        <TextBlock Grid.Row="4" Grid.Column="1" Text="AX Commander 창 닫기" FontSize="11" Foreground="#555577" VerticalAlignment="Center"/>
                                        <!-- 행 6 -->
                                        <Border Grid.Row="5" Grid.Column="0" Background="#E8EAFF" CornerRadius="4" Padding="6,2" Margin="0,1,6,1" HorizontalAlignment="Left">
                                            <TextBlock Text="Ctrl+D" FontFamily="Consolas" FontSize="11" Foreground="#2B3280"/>
                                        </Border>
                                        <TextBlock Grid.Row="5" Grid.Column="1" Text="다운로드 폴더 바로가기" FontSize="11" Foreground="#555577" VerticalAlignment="Center"/>
                                        <!-- 행 7 -->
                                        <Border Grid.Row="6" Grid.Column="0" Background="#E8EAFF" CornerRadius="4" Padding="6,2" Margin="0,1,6,1" HorizontalAlignment="Left">
                                            <TextBlock Text="Ctrl+F" FontFamily="Consolas" FontSize="11" Foreground="#2B3280"/>
                                        </Border>
                                        <TextBlock Grid.Row="6" Grid.Column="1" Text="파일 검색 모드로 전환" FontSize="11" Foreground="#555577" VerticalAlignment="Center"/>
                                        <!-- 행 8 -->
                                        <Border Grid.Row="7" Grid.Column="0" Background="#E8EAFF" CornerRadius="4" Padding="6,2" Margin="0,1,6,1" HorizontalAlignment="Left">
                                            <TextBlock Text="Ctrl+K" FontFamily="Consolas" FontSize="11" Foreground="#2B3280"/>
                                        </Border>
                                        <TextBlock Grid.Row="7" Grid.Column="1" Text="단축키 모달 창 열기" FontSize="11" Foreground="#555577" VerticalAlignment="Center"/>
                                        <!-- 행 9 -->
                                        <Border Grid.Row="8" Grid.Column="0" Background="#E8EAFF" CornerRadius="4" Padding="6,2" Margin="0,1,6,1" HorizontalAlignment="Left">
                                            <TextBlock Text="Home / End" FontFamily="Consolas" FontSize="11" Foreground="#2B3280"/>
                                        </Border>
                                        <TextBlock Grid.Row="8" Grid.Column="1" Text="목록 처음 / 마지막 항목으로 이동" FontSize="11" Foreground="#555577" VerticalAlignment="Center"/>
                                        <!-- 행 10 -->
                                        <Border Grid.Row="9" Grid.Column="0" Background="#E8EAFF" CornerRadius="4" Padding="6,2" Margin="0,1,6,1" HorizontalAlignment="Left">
                                            <TextBlock Text="Ctrl+1~9" FontFamily="Consolas" FontSize="11" Foreground="#2B3280"/>
                                        </Border>
                                        <TextBlock Grid.Row="9" Grid.Column="1" Text="n번째 결과 항목 바로 실행" FontSize="11" Foreground="#555577" VerticalAlignment="Center"/>
                                    </Grid>
                                </StackPanel>
                            </Border>

                        </StackPanel>
                    </ScrollViewer>
                </Grid>
            </TabItem>

            <!-- ═══════════════════════════════════════════════════════════════ -->
            <!-- 고급 에이전트 설정 탭 (MCP/훅/권한 전문 설정)                     -->
            <!-- ═══════════════════════════════════════════════════════════════ -->
            <TabItem x:Name="AdvancedAgentTabItem" Header="고급 에이전트" Tag="&#xE8EF;" Style="{StaticResource SideNavItem}">
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="*"/>
                    </Grid.RowDefinitions>

                    <!-- 안내 배너 -->
                    <Border Grid.Row="0" Background="{DynamicResource ItemBackground}"
                            CornerRadius="8" Margin="20,16,20,0" Padding="14,10">
                        <StackPanel Orientation="Horizontal">
                            <TextBlock Text="&#xE8BD;" FontFamily="Segoe MDL2 Assets" FontSize="16"
                                       Foreground="{DynamicResource AccentColor}" VerticalAlignment="Center"/>
                            <StackPanel Margin="10,0,0,0">
                                <TextBlock Text="기본 에이전트 설정은 채팅 화면에서"
                                           FontSize="13" FontWeight="SemiBold"
                                           Foreground="{DynamicResource PrimaryText}"/>
                                <TextBlock Text="AX Agent 채팅 창의 ⚙ 아이콘을 클릭하면 모델·반복횟수·도구 등을 바로 설정할 수 있습니다."
                                           FontSize="11" Foreground="{DynamicResource SecondaryText}"
                                           TextWrapping="Wrap" Margin="0,2,0,0"/>
                            </StackPanel>
                        </StackPanel>
                    </Border>

                    <ScrollViewer Grid.Row="1" VerticalScrollBarVisibility="Auto"
                                  HorizontalScrollBarVisibility="Disabled">
                        <StackPanel Margin="20,16,20,20">

                            <!-- MCP 서버 등록 안내 -->
                            <TextBlock Text="MCP 서버 등록" FontSize="15" FontWeight="SemiBold"
                                       Foreground="{DynamicResource PrimaryText}" Margin="0,0,0,8"/>
                            <TextBlock Text="외부 도구 연결(MCP 서버) 등록/삭제는 AX Agent 탭(개발자 모드 ON)에서 가능합니다. 기본 설정은 채팅 화면 ⚙ 패널의 MCP 섹션을 이용하세요."
                                       FontSize="12" Foreground="{DynamicResource SecondaryText}"
                                       TextWrapping="Wrap" Margin="0,0,0,16"/>

                            <!-- 훅/권한 규칙 안내 -->
                            <TextBlock Text="훅 · 권한 규칙 편집" FontSize="15" FontWeight="SemiBold"
                                       Foreground="{DynamicResource PrimaryText}" Margin="0,0,0,8"/>
                            <TextBlock Text="훅 스크립트 및 권한 패턴 규칙은 개발자 모드를 활성화한 후 AX Agent 탭 고급 설정에서 편집할 수 있습니다."
                                       FontSize="12" Foreground="{DynamicResource SecondaryText}"
                                       TextWrapping="Wrap" Margin="0,0,0,16"/>

                        </StackPanel>
                    </ScrollViewer>
                </Grid>
            </TabItem>

            <!-- ═════════════════════════════════════════════════════════════ -->
            <!-- AX Agent 탭 (숨김 — 설정은 ChatWindow 내 AgentSettingsPanel로 이관) -->
            <!-- ═════════════════════════════════════════════════════════════ -->
            <TabItem x:Name="AgentTabItem" Header="AX Agent" Tag="&#xE8BD;" Style="{StaticResource SideNavItem}" Visibility="Collapsed">
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="*"/>
                    </Grid.RowDefinitions>

                    <TextBlock Grid.Row="0" Text="AX Agent 설정"
                               FontSize="16" FontWeight="SemiBold" Foreground="#1A1B2E"
                               Margin="0,0,0,2"/>

                    <!-- ── 서브탭 헤더 (공통 / 채팅 / 코워크 / 코드) ── -->
                    <Border Grid.Row="1" Background="#EEEEF2" CornerRadius="8" Padding="3" Margin="0,4,0,8">
                        <StackPanel x:Name="AgentSubTabs" Orientation="Horizontal">
                            <RadioButton x:Name="AgentTabCommon"  Content="공통"   IsChecked="True"
                                         GroupName="AgentSubTab" Style="{StaticResource AgentSubTabStyle}"
                                         Checked="AgentSubTab_Checked"/>
                            <RadioButton x:Name="AgentTabChat"    Content="채팅"
                                         GroupName="AgentSubTab" Style="{StaticResource AgentSubTabStyle}"
                                         Checked="AgentSubTab_Checked"/>
                            <RadioButton x:Name="AgentTabCoworkCode" Content="코워크/코드"
                                         GroupName="AgentSubTab" Style="{StaticResource AgentSubTabStyle}"
                                         Checked="AgentSubTab_Checked"/>
                            <RadioButton x:Name="AgentTabCowork"  Content="코워크"
                                         GroupName="AgentSubTab" Style="{StaticResource AgentSubTabStyle}"
                                         Checked="AgentSubTab_Checked"/>
                            <RadioButton x:Name="AgentTabCode"    Content="코드"
                                         GroupName="AgentSubTab" Style="{StaticResource AgentSubTabStyle}"
                                         Checked="AgentSubTab_Checked"/>
                            <RadioButton x:Name="AgentTabDev"     Content="개발자"
                                         GroupName="AgentSubTab" Style="{StaticResource AgentSubTabStyle}"
                                         Checked="AgentSubTab_Checked"/>
                            <RadioButton x:Name="AgentTabTools"   Content="도구"
                                         GroupName="AgentSubTab" Style="{StaticResource AgentSubTabStyle}"
                                         Checked="AgentSubTab_Checked"/>
                            <RadioButton x:Name="AgentTabEtc"     Content="스킬/차단"
                                         GroupName="AgentSubTab" Style="{StaticResource AgentSubTabStyle}"
                                         Checked="AgentSubTab_Checked"/>
                        </StackPanel>
                    </Border>

                    <!-- ══════════════════════════════════════════════════
                         공통 탭 (Common)
                         ══════════════════════════════════════════════════ -->
                    <ScrollViewer x:Name="AgentPanelCommon" Grid.Row="2"
                                  VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled"
                                  Padding="0,0,8,0">
                        <StackPanel>

                            <!-- ── 활성 서비스 선택 ── -->
                            <TextBlock Style="{StaticResource SectionHeader}" Text="활성 서비스"/>
                            <Border Style="{StaticResource SettingsRow}">
                                <Grid>
                                    <StackPanel HorizontalAlignment="Left">
                                        <TextBlock Style="{StaticResource RowLabel}" Text="사용할 서비스"/>
                                        <TextBlock Style="{StaticResource RowHint}" Text="AI 대화에 사용할 LLM 백엔드를 선택합니다."/>
                                    </StackPanel>
                                    <ComboBox HorizontalAlignment="Right" VerticalAlignment="Center"
                                              Width="180" SelectedValue="{Binding LlmService, Mode=TwoWay}"
                                              SelectedValuePath="Tag">
                                        <ComboBoxItem Content="Ollama (사내 로컬)" Tag="ollama"/>
                                        <ComboBoxItem Content="vLLM (사내 OpenAI)" Tag="vllm"/>
                                        <ComboBoxItem Content="Google Gemini" Tag="gemini"/>
                                        <ComboBoxItem Content="Anthropic Claude" Tag="claude"/>
                                    </ComboBox>
                                </Grid>
                            </Border>

                            <!-- ── LLM 서비스별 탭 ── -->
                            <TextBlock Style="{StaticResource SectionHeader}" Text="서비스별 설정"/>
                            <Border Background="#EEEEF2" CornerRadius="8" Padding="3" Margin="0,0,0,6">
                                <StackPanel x:Name="ServiceSubTabs" Orientation="Horizontal">
                                    <RadioButton x:Name="SvcTabOllama" Content="Ollama" IsChecked="True"
                                                 GroupName="ServiceSubTab" Style="{StaticResource AgentSubTabStyle}"
                                                 Checked="ServiceSubTab_Checked"/>
                                    <RadioButton x:Name="SvcTabVllm"   Content="vLLM"
                                                 GroupName="ServiceSubTab" Style="{StaticResource AgentSubTabStyle}"
                                                 Checked="ServiceSubTab_Checked"/>
                                    <RadioButton x:Name="SvcTabGemini" Content="Gemini"
                                                 GroupName="ServiceSubTab" Style="{StaticResource AgentSubTabStyle}"
                                                 Checked="ServiceSubTab_Checked"/>
                                    <RadioButton x:Name="SvcTabClaude" Content="Claude"
                                                 GroupName="ServiceSubTab" Style="{StaticResource AgentSubTabStyle}"
                                                 Checked="ServiceSubTab_Checked"/>
                                </StackPanel>
                            </Border>

                            <!-- Ollama 패널 -->
                            <StackPanel x:Name="SvcPanelOllama">
                                <Border Style="{StaticResource SettingsRow}">
                                    <Grid>
                                        <StackPanel HorizontalAlignment="Left" MaxWidth="380">
                                            <TextBlock Style="{StaticResource RowLabel}" Text="기본 서버 주소"/>
                                            <TextBlock Style="{StaticResource RowHint}" Text="Ollama 기본 서버 주소. 모델별 개별 서버는 모델 추가 시 입력합니다."/>
                                        </StackPanel>
                                        <TextBox HorizontalAlignment="Right" VerticalAlignment="Center"
                                                 Width="280" FontSize="12" Padding="6,4"
                                                 Text="{Binding OllamaEndpoint, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
                                    </Grid>
                                </Border>
                                <Border Style="{StaticResource SettingsRow}">
                                    <Grid>
                                        <StackPanel HorizontalAlignment="Left">
                                            <TextBlock Style="{StaticResource RowLabel}" Text="등록 모델"/>
                                            <TextBlock Style="{StaticResource RowHint}" Text="사내 모델을 별칭으로 등록합니다."/>
                                        </StackPanel>
                                        <Button x:Name="BtnAddModel" HorizontalAlignment="Right" VerticalAlignment="Center"
                                                Content="+ 모델 추가" Padding="12,6" Cursor="Hand"
                                                Click="BtnAddModel_Click"/>
                                    </Grid>
                                </Border>
                                <ItemsControl ItemsSource="{Binding RegisteredModels}" Margin="0,2,0,8">
                                    <ItemsControl.ItemTemplate>
                                        <DataTemplate>
                                            <Border Background="{DynamicResource ItemBackground}"
                                                    CornerRadius="10" Padding="14,10" Margin="0,4,0,0"
                                                    BorderBrush="{DynamicResource BorderColor}" BorderThickness="1">
                                                <Grid>
                                                    <Grid.ColumnDefinitions>
                                                        <ColumnDefinition Width="*"/>
                                                        <ColumnDefinition Width="Auto"/>
                                                    </Grid.ColumnDefinitions>
                                                    <StackPanel Grid.Column="0" VerticalAlignment="Center">
                                                        <TextBlock Text="{Binding Alias}" FontSize="13.5" FontWeight="SemiBold"
                                                                   Foreground="{DynamicResource PrimaryText}"/>
                                                        <StackPanel Orientation="Horizontal" Margin="0,3,0,0">
                                                            <Border Background="{DynamicResource AccentColor}" CornerRadius="4"
                                                                    Padding="6,1,6,1" Margin="0,0,8,0" Opacity="0.8">
                                                                <TextBlock Text="{Binding ServiceLabel}" FontSize="10"
                                                                           Foreground="White" FontWeight="SemiBold"/>
                                                            </Border>
                                                            <TextBlock Text="{Binding MaskedModelName}" FontSize="11"
                                                                       Foreground="{DynamicResource SecondaryText}"
                                                                       VerticalAlignment="Center"/>
                                                            <TextBlock Text=" · " FontSize="11" Foreground="{DynamicResource SecondaryText}"
                                                                       VerticalAlignment="Center"/>
                                                            <TextBlock Text="{Binding EndpointDisplay}" FontSize="10.5"
                                                                       Foreground="{DynamicResource SecondaryText}"
                                                                       VerticalAlignment="Center" Opacity="0.7"/>
                                                        </StackPanel>
                                                    </StackPanel>
                                                    <StackPanel Grid.Column="1" Orientation="Horizontal" VerticalAlignment="Center">
                                                        <Button Content="&#xE70F;" FontFamily="Segoe MDL2 Assets"
                                                                FontSize="12" ToolTip="편집" Cursor="Hand"
                                                                Background="Transparent" BorderThickness="0"
                                                                Foreground="{DynamicResource SecondaryText}"
                                                                Padding="6,4" Margin="0,0,4,0"
                                                                Tag="{Binding}" Click="BtnEditModel_Click"/>
                                                        <Button Content="&#xE74D;" FontFamily="Segoe MDL2 Assets"
                                                                FontSize="12" ToolTip="삭제" Cursor="Hand"
                                                                Background="Transparent" BorderThickness="0"
                                                                Foreground="#DD4444" Padding="6,4"
                                                                Tag="{Binding}" Click="BtnDeleteModel_Click"/>
                                                    </StackPanel>
                                                </Grid>
                                            </Border>
                                        </DataTemplate>
                                    </ItemsControl.ItemTemplate>
                                </ItemsControl>
                                <Border Style="{StaticResource SettingsRow}">
                                    <Grid>
                                        <StackPanel HorizontalAlignment="Left">
                                            <TextBlock Style="{StaticResource RowLabel}" Text="사용할 모델"/>
                                            <TextBlock Style="{StaticResource RowHint}" Text="등록된 모델 중 기본으로 사용할 모델"/>
                                        </StackPanel>
                                        <ComboBox x:Name="CboActiveModel" HorizontalAlignment="Right" VerticalAlignment="Center"
                                                  Width="220" DisplayMemberPath="Alias"
                                                  SelectedValuePath="EncryptedModelName"
                                                  SelectedValue="{Binding OllamaModel, Mode=TwoWay}"
                                                  ItemsSource="{Binding RegisteredModels}"/>
                                    </Grid>
                                </Border>
                                <Border Style="{StaticResource SettingsRow}">
                                    <Grid>
                                        <StackPanel HorizontalAlignment="Left" MaxWidth="380">
                                            <TextBlock Style="{StaticResource RowLabel}" Text="API 키 (선택)"/>
                                            <TextBlock Style="{StaticResource RowHint}" Text="접근 제어가 설정된 경우에만 입력합니다."/>
                                        </StackPanel>
                                        <TextBox HorizontalAlignment="Right" VerticalAlignment="Center"
                                                 Width="280" FontSize="12" Padding="6,4"
                                                 Text="{Binding OllamaApiKey, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
                                    </Grid>
                                </Border>
                            </StackPanel>

                            <!-- vLLM 패널 -->
                            <StackPanel x:Name="SvcPanelVllm" Visibility="Collapsed">
                                <Border Style="{StaticResource SettingsRow}">
                                    <Grid>
                                        <StackPanel HorizontalAlignment="Left" MaxWidth="380">
                                            <TextBlock Style="{StaticResource RowLabel}" Text="기본 서버 주소"/>
                                            <TextBlock Style="{StaticResource RowHint}" Text="vLLM(OpenAI 호환) 기본 서버 주소. 모델별 개별 서버는 모델 추가 시 입력합니다."/>
                                        </StackPanel>
                                        <TextBox HorizontalAlignment="Right" VerticalAlignment="Center"
                                                 Width="280" FontSize="12" Padding="6,4"
                                                 Text="{Binding VllmEndpoint, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
                                    </Grid>
                                </Border>
                                <Border Style="{StaticResource SettingsRow}">
                                    <Grid>
                                        <StackPanel HorizontalAlignment="Left">
                                            <TextBlock Style="{StaticResource RowLabel}" Text="등록 모델"/>
                                            <TextBlock Style="{StaticResource RowHint}" Text="사내 vLLM 서버에 배포된 모델을 등록합니다. 모델별로 다른 서버를 지정할 수 있습니다."/>
                                        </StackPanel>
                                        <Button x:Name="BtnAddVllmModel" HorizontalAlignment="Right" VerticalAlignment="Center"
                                                Content="+ 모델 추가" Padding="12,6" Cursor="Hand"
                                                Click="BtnAddModel_Click"/>
                                    </Grid>
                                </Border>
                                <ItemsControl ItemsSource="{Binding RegisteredModels}" Margin="0,2,0,8">
                                    <ItemsControl.ItemTemplate>
                                        <DataTemplate>
                                            <Border Background="{DynamicResource ItemBackground}"
                                                    CornerRadius="10" Padding="14,10" Margin="0,4,0,0"
                                                    BorderBrush="{DynamicResource BorderColor}" BorderThickness="1">
                                                <Grid>
                                                    <Grid.ColumnDefinitions>
                                                        <ColumnDefinition Width="*"/>
                                                        <ColumnDefinition Width="Auto"/>
                                                    </Grid.ColumnDefinitions>
                                                    <StackPanel Grid.Column="0" VerticalAlignment="Center">
                                                        <TextBlock Text="{Binding Alias}" FontSize="13.5" FontWeight="SemiBold"
                                                                   Foreground="{DynamicResource PrimaryText}"/>
                                                        <StackPanel Orientation="Horizontal" Margin="0,3,0,0">
                                                            <Border Background="{DynamicResource AccentColor}" CornerRadius="4"
                                                                    Padding="6,1,6,1" Margin="0,0,8,0" Opacity="0.8">
                                                                <TextBlock Text="{Binding ServiceLabel}" FontSize="10"
                                                                           Foreground="White" FontWeight="SemiBold"/>
                                                            </Border>
                                                            <TextBlock Text="{Binding MaskedModelName}" FontSize="11"
                                                                       Foreground="{DynamicResource SecondaryText}"
                                                                       VerticalAlignment="Center"/>
                                                            <TextBlock Text=" · " FontSize="11" Foreground="{DynamicResource SecondaryText}"
                                                                       VerticalAlignment="Center"/>
                                                            <TextBlock Text="{Binding EndpointDisplay}" FontSize="10.5"
                                                                       Foreground="{DynamicResource SecondaryText}"
                                                                       VerticalAlignment="Center" Opacity="0.7"/>
                                                        </StackPanel>
                                                    </StackPanel>
                                                    <StackPanel Grid.Column="1" Orientation="Horizontal" VerticalAlignment="Center">
                                                        <Button Content="&#xE70F;" FontFamily="Segoe MDL2 Assets"
                                                                FontSize="12" ToolTip="편집" Cursor="Hand"
                                                                Background="Transparent" BorderThickness="0"
                                                                Foreground="{DynamicResource SecondaryText}"
                                                                Padding="6,4" Margin="0,0,4,0"
                                                                Tag="{Binding}" Click="BtnEditModel_Click"/>
                                                        <Button Content="&#xE74D;" FontFamily="Segoe MDL2 Assets"
                                                                FontSize="12" ToolTip="삭제" Cursor="Hand"
                                                                Background="Transparent" BorderThickness="0"
                                                                Foreground="#DD4444" Padding="6,4"
                                                                Tag="{Binding}" Click="BtnDeleteModel_Click"/>
                                                    </StackPanel>
                                                </Grid>
                                            </Border>
                                        </DataTemplate>
                                    </ItemsControl.ItemTemplate>
                                </ItemsControl>
                                <Border Style="{StaticResource SettingsRow}">
                                    <Grid>
                                        <StackPanel HorizontalAlignment="Left">
                                            <TextBlock Style="{StaticResource RowLabel}" Text="사용할 모델"/>
                                            <TextBlock Style="{StaticResource RowHint}" Text="등록된 모델 중 기본으로 사용할 모델"/>
                                        </StackPanel>
                                        <ComboBox x:Name="CboActiveVllmModel" HorizontalAlignment="Right" VerticalAlignment="Center"
                                                  Width="220" DisplayMemberPath="Alias"
                                                  SelectedValuePath="EncryptedModelName"
                                                  SelectedValue="{Binding VllmModel, Mode=TwoWay}"
                                                  ItemsSource="{Binding RegisteredModels}"/>
                                    </Grid>
                                </Border>
                                <Border Style="{StaticResource SettingsRow}">
                                    <Grid>
                                        <StackPanel HorizontalAlignment="Left" MaxWidth="380">
                                            <TextBlock Style="{StaticResource RowLabel}" Text="기본 API 키 (선택)"/>
                                            <TextBlock Style="{StaticResource RowHint}" Text="모델별 API 키가 없을 때 사용되는 기본 키입니다."/>
                                        </StackPanel>
                                        <TextBox HorizontalAlignment="Right" VerticalAlignment="Center"
                                                 Width="280" FontSize="12" Padding="6,4"
                                                 Text="{Binding VllmApiKey, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
                                    </Grid>
                                </Border>
                            </StackPanel>

                            <!-- Gemini 패널 -->
                            <StackPanel x:Name="SvcPanelGemini" Visibility="Collapsed">
                                <Border Style="{StaticResource SettingsRow}">
                                    <Grid>
                                        <StackPanel HorizontalAlignment="Left">
                                            <TextBlock Style="{StaticResource RowLabel}" Text="모델"/>
                                            <TextBlock Style="{StaticResource RowHint}" Text="Google Gemini 모델 선택"/>
                                        </StackPanel>
                                        <ComboBox HorizontalAlignment="Right" VerticalAlignment="Center" Width="260"
                                                  SelectedValue="{Binding GeminiModel, Mode=TwoWay}" SelectedValuePath="Tag">
                                            <ComboBoxItem Content="gemini-3.1-pro-preview" Tag="gemini-3.1-pro-preview"/>
                                            <ComboBoxItem Content="gemini-3-flash" Tag="gemini-3-flash"/>
                                            <ComboBoxItem Content="gemini-3.1-flash-lite-preview" Tag="gemini-3.1-flash-lite-preview"/>
                                            <ComboBoxItem Content="gemini-2.5-flash" Tag="gemini-2.5-flash"/>
                                            <ComboBoxItem Content="gemini-2.5-flash-lite" Tag="gemini-2.5-flash-lite"/>
                                        </ComboBox>
                                    </Grid>
                                </Border>
                                <Border Style="{StaticResource SettingsRow}">
                                    <Grid>
                                        <StackPanel HorizontalAlignment="Left" MaxWidth="380">
                                            <TextBlock Style="{StaticResource RowLabel}" Text="API 키"/>
                                            <TextBlock Style="{StaticResource RowHint}" Text="Google AI Studio에서 발급받은 API 키"/>
                                        </StackPanel>
                                        <TextBox HorizontalAlignment="Right" VerticalAlignment="Center"
                                                 Width="280" FontSize="12" Padding="6,4"
                                                 Text="{Binding GeminiApiKey, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
                                    </Grid>
                                </Border>
                            </StackPanel>

                            <!-- Claude 패널 -->
                            <StackPanel x:Name="SvcPanelClaude" Visibility="Collapsed">
                                <Border Style="{StaticResource SettingsRow}">
                                    <Grid>
                                        <StackPanel HorizontalAlignment="Left">
                                            <TextBlock Style="{StaticResource RowLabel}" Text="모델"/>
                                            <TextBlock Style="{StaticResource RowHint}" Text="Anthropic Claude 모델 선택"/>
                                        </StackPanel>
                                        <ComboBox HorizontalAlignment="Right" VerticalAlignment="Center" Width="280"
                                                  SelectedValue="{Binding ClaudeModel, Mode=TwoWay}" SelectedValuePath="Tag">
                                            <ComboBoxItem Content="claude-opus-4-6 (최신, 최고 성능)" Tag="claude-opus-4-6"/>
                                            <ComboBoxItem Content="claude-sonnet-4-6 (최신, 균형)" Tag="claude-sonnet-4-6"/>
                                            <ComboBoxItem Content="claude-haiku-4-5-20251001 (경량)" Tag="claude-haiku-4-5-20251001"/>
                                            <ComboBoxItem Content="claude-sonnet-4-5-20250929" Tag="claude-sonnet-4-5-20250929"/>
                                            <ComboBoxItem Content="claude-opus-4-20250514" Tag="claude-opus-4-20250514"/>
                                        </ComboBox>
                                    </Grid>
                                </Border>
                                <Border Style="{StaticResource SettingsRow}">
                                    <Grid>
                                        <StackPanel HorizontalAlignment="Left" MaxWidth="380">
                                            <TextBlock Style="{StaticResource RowLabel}" Text="API 키"/>
                                            <TextBlock Style="{StaticResource RowHint}" Text="Anthropic Console에서 발급받은 API 키"/>
                                        </StackPanel>
                                        <TextBox HorizontalAlignment="Right" VerticalAlignment="Center"
                                                 Width="280" FontSize="12" Padding="6,4"
                                                 Text="{Binding ClaudeApiKey, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
                                    </Grid>
                                </Border>
                            </StackPanel>

                            <!-- 연결 테스트 -->
                            <Border Style="{StaticResource SettingsRow}" Margin="0,6,0,0">
                                <Grid>
                                    <StackPanel HorizontalAlignment="Left">
                                        <TextBlock Style="{StaticResource RowLabel}" Text="연결 테스트"/>
                                        <TextBlock Style="{StaticResource RowHint}" Text="활성 서비스에 연결을 테스트합니다."/>
                                    </StackPanel>
                                    <Button x:Name="BtnTestConnection"
                                            HorizontalAlignment="Right" VerticalAlignment="Center"
                                            Content="테스트" Padding="16,6" Cursor="Hand"
                                            Click="BtnTestConnection_Click"/>
                                </Grid>
                            </Border>

                            <!-- ── 응답 설정 ── -->
                            <TextBlock Style="{StaticResource SectionHeader}" Text="응답 설정"/>

                            <Border Style="{StaticResource SettingsRow}">
                                <Grid>
                                    <StackPanel HorizontalAlignment="Left">
                                        <TextBlock Style="{StaticResource RowLabel}" Text="스트리밍 응답"/>
                                        <TextBlock Style="{StaticResource RowHint}" Text="AI 응답이 실시간으로 한 글자씩 표시됩니다."/>
                                    </StackPanel>
                                    <CheckBox Style="{StaticResource ToggleSwitch}"
                                              HorizontalAlignment="Right" VerticalAlignment="Center"
                                              IsChecked="{Binding LlmStreaming, Mode=TwoWay}"/>
                                </Grid>
                            </Border>
                            <Border Style="{StaticResource SettingsRow}">
                                <Grid>
                                    <StackPanel HorizontalAlignment="Left">
                                        <StackPanel Orientation="Horizontal">
                                            <TextBlock Style="{StaticResource RowLabel}" Text="Temperature"/>
                                            <Border Width="16" Height="16" CornerRadius="8" Background="#EEF0FF" Margin="6,0,0,0" Cursor="Help" VerticalAlignment="Center">
                                                <TextBlock Text="?" FontSize="10" FontWeight="Bold" Foreground="#4B5EFC" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                                <Border.ToolTip>
                                                    <ToolTip Style="{StaticResource HelpTooltipStyle}">
                                                        <TextBlock TextWrapping="Wrap" Foreground="White" FontSize="12" LineHeight="18">
                                                            AI 응답의 창의성을 조절합니다.
                                                            <LineBreak/>• 0.0 — 가장 정확하고 일관된 답변 (코딩 추천)
                                                            <LineBreak/>• 0.7 — 적당한 균형 (기본값)
                                                            <LineBreak/>• 1.0+ — 창의적이지만 부정확할 수 있음
                                                        </TextBlock>
                                                    </ToolTip>
                                                </Border.ToolTip>
                                            </Border>
                                        </StackPanel>
                                        <TextBlock Style="{StaticResource RowHint}" Text="낮을수록 정확하고, 높을수록 창의적입니다. (0.0 ~ 2.0)"/>
                                    </StackPanel>
                                    <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Center">
                                        <Slider Width="120" Minimum="0" Maximum="2" TickFrequency="0.1"
                                                IsSnapToTickEnabled="True"
                                                Value="{Binding LlmTemperature, Mode=TwoWay}"
                                                VerticalAlignment="Center"/>
                                        <TextBlock Text="{Binding LlmTemperature, StringFormat={}{0:F1}}"
                                                   FontSize="13" FontWeight="SemiBold" Foreground="#4B5EFC"
                                                   Width="32" TextAlignment="Center" VerticalAlignment="Center"
                                                   Margin="8,0,0,0"/>
                                    </StackPanel>
                                </Grid>
                            </Border>
                            <Border Style="{StaticResource SettingsRow}">
                                <Grid>
                                    <StackPanel HorizontalAlignment="Left">
                                        <TextBlock Style="{StaticResource RowLabel}" Text="최대 컨텍스트 토큰"/>
                                        <TextBlock Style="{StaticResource RowHint}" Text="한 번의 요청에 포함할 최대 토큰 수."/>
                                    </StackPanel>
                                    <ComboBox HorizontalAlignment="Right" VerticalAlignment="Center"
                                              Width="120" SelectedValue="{Binding LlmMaxContextTokens, Mode=TwoWay}"
                                              SelectedValuePath="Tag">
                                        <ComboBoxItem Content="2,048" Tag="2048"/>
                                        <ComboBoxItem Content="4,096" Tag="4096"/>
                                        <ComboBoxItem Content="8,192" Tag="8192"/>
                                        <ComboBoxItem Content="16,384" Tag="16384"/>
                                    </ComboBox>
                                </Grid>
                            </Border>

                            <!-- ── 대화 관리 ── -->
                            <TextBlock Style="{StaticResource SectionHeader}" Text="대화 관리"/>
                            <Border Style="{StaticResource SettingsRow}">
                                <Grid>
                                    <StackPanel HorizontalAlignment="Left">
                                        <StackPanel Orientation="Horizontal">
                                            <TextBlock Style="{StaticResource RowLabel}" Text="대화 보관 기간"/>
                                            <Border Width="16" Height="16" CornerRadius="8" Background="#EEF0FF" Margin="6,0,0,0" Cursor="Help" VerticalAlignment="Center">
                                                <TextBlock Text="?" FontSize="10" FontWeight="Bold" Foreground="#4B5EFC" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                                <Border.ToolTip>
                                                    <ToolTip Style="{StaticResource HelpTooltipStyle}">
                                                        <TextBlock TextWrapping="Wrap" Foreground="White" FontSize="12" LineHeight="18">
                                                            설정 기간이 지난 대화는 자동으로 삭제됩니다.
                                                            <LineBreak/>대화 파일은 암호화(AES-256-GCM)되어 저장되며
                                                            <LineBreak/>해당 PC/사용자만 열람 가능합니다.
                                                            <LineBreak/><LineBreak/>무제한(0)으로 설정하면 자동 삭제되지 않습니다.
                                                        </TextBlock>
                                                    </ToolTip>
                                                </Border.ToolTip>
                                            </Border>
                                        </StackPanel>
                                        <TextBlock Style="{StaticResource RowHint}" Text="설정 기간이 지난 대화는 자동 삭제됩니다."/>
                                    </StackPanel>
                                    <ComboBox HorizontalAlignment="Right" VerticalAlignment="Center"
                                              Width="120" SelectedValue="{Binding LlmRetentionDays, Mode=TwoWay}"
                                              SelectedValuePath="Tag">
                                        <ComboBoxItem Content="7일" Tag="7"/>
                                        <ComboBoxItem Content="30일" Tag="30"/>
                                        <ComboBoxItem Content="90일" Tag="90"/>
                                        <ComboBoxItem Content="무제한" Tag="0"/>
                                    </ComboBox>
                                </Grid>
                            </Border>

                            <!-- ── 접근 차단은 기타 탭에 표시 (런타임 이동) ── -->
                            <!-- ── 저장 공간 ── -->
                            <TextBlock Style="{StaticResource SectionHeader}" Text="저장 공간"/>
                            <Border Style="{StaticResource SettingsRow}">
                                <StackPanel>
                                    <Grid>
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="*"/>
                                            <ColumnDefinition Width="Auto"/>
                                        </Grid.ColumnDefinitions>
                                        <StackPanel Grid.Column="0">
                                            <TextBlock x:Name="StorageSummaryText" Style="{StaticResource RowLabel}" Text="분석 중..."/>
                                            <TextBlock x:Name="StorageDriveText" Style="{StaticResource RowHint}" Text=""/>
                                        </StackPanel>
                                        <StackPanel Grid.Column="1" Orientation="Horizontal">
                                            <Button Content="새로고침" Click="BtnStorageRefresh_Click"
                                                    Background="Transparent" BorderThickness="0"
                                                    Foreground="#4B5EFC" FontSize="12" Cursor="Hand" Padding="8,4" Margin="0,0,8,0"/>
                                            <Button Content="저장 공간 줄이기" Click="BtnStorageCleanup_Click"
                                                    Background="#DC2626" Foreground="White" FontSize="12"
                                                    Padding="14,6" Cursor="Hand" BorderThickness="0">
                                                <Button.Template>
                                                    <ControlTemplate TargetType="Button">
                                                        <Border Background="{TemplateBinding Background}" CornerRadius="8"
                                                                Padding="{TemplateBinding Padding}">
                                                            <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                                        </Border>
                                                    </ControlTemplate>
                                                </Button.Template>
                                            </Button>
                                        </StackPanel>
                                    </Grid>
                                    <StackPanel x:Name="StorageDetailPanel" Margin="0,10,0,0"/>
                                </StackPanel>
                            </Border>

                            <StackPanel x:Name="AgentBlockSection">
                            <TextBlock Style="{StaticResource SectionHeader}" Text="에이전트 접근 차단"/>
                            <Border Style="{StaticResource SettingsRow}">
                                <StackPanel>
                                    <TextBlock Style="{StaticResource RowLabel}" Text="차단 경로 패턴"/>
                                    <TextBlock Style="{StaticResource RowHint}" Text="에이전트가 접근할 수 없는 경로입니다. (시스템 보호)" Margin="0,2,0,6"/>
                                    <ItemsControl ItemsSource="{Binding BlockedPaths}">
                                        <ItemsControl.ItemTemplate>
                                            <DataTemplate>
                                                <Border Background="#F0F0F5" CornerRadius="4" Padding="8,3" Margin="0,1,0,1">
                                                    <TextBlock Text="{Binding}" FontSize="11.5" Foreground="#666688"
                                                               FontFamily="Consolas, Malgun Gothic"/>
                                                </Border>
                                            </DataTemplate>
                                        </ItemsControl.ItemTemplate>
                                    </ItemsControl>
                                </StackPanel>
                            </Border>
                            <Border Style="{StaticResource SettingsRow}">
                                <StackPanel>
                                    <TextBlock Style="{StaticResource RowLabel}" Text="차단 확장자"/>
                                    <TextBlock Style="{StaticResource RowHint}" Text="에이전트가 수정할 수 없는 파일 형식입니다." Margin="0,2,0,6"/>
                                    <WrapPanel>
                                        <ItemsControl ItemsSource="{Binding BlockedExtensions}">
                                            <ItemsControl.ItemsPanel>
                                                <ItemsPanelTemplate>
                                                    <WrapPanel/>
                                                </ItemsPanelTemplate>
                                            </ItemsControl.ItemsPanel>
                                            <ItemsControl.ItemTemplate>
                                                <DataTemplate>
                                                    <Border Background="#F0F0F5" CornerRadius="4" Padding="8,3" Margin="0,1,4,1">
                                                        <TextBlock Text="{Binding}" FontSize="11.5" Foreground="#666688"
                                                                   FontFamily="Consolas, Malgun Gothic"/>
                                                    </Border>
                                                </DataTemplate>
                                            </ItemsControl.ItemTemplate>
                                        </ItemsControl>
                                    </WrapPanel>
                                </StackPanel>
                            </Border>

                            </StackPanel>

                            <!-- ── 알림 ── -->
                            <TextBlock Style="{StaticResource SectionHeader}" Text="알림"/>
                            <Border Style="{StaticResource SettingsRow}">
                                <Grid>
                                    <StackPanel HorizontalAlignment="Left" Margin="0,0,60,0">
                                        <TextBlock Style="{StaticResource RowLabel}" Text="작업 완료 알림"/>
                                        <TextBlock Style="{StaticResource RowHint}" Text="Cowork/Code 에이전트 작업 완료 시 시스템 트레이 알림을 표시합니다. (기본: 꺼짐)"/>
                                    </StackPanel>
                                    <CheckBox Style="{StaticResource ToggleSwitch}" HorizontalAlignment="Right" VerticalAlignment="Center"
                                              IsChecked="{Binding NotifyOnComplete, Mode=TwoWay}"/>
                                </Grid>
                            </Border>
                            <Border Style="{StaticResource SettingsRow}">
                                <Grid>
                                    <StackPanel HorizontalAlignment="Left" Margin="0,0,60,0">
                                        <TextBlock Style="{StaticResource RowLabel}" Text="팁 알림 받기"/>
                                        <TextBlock Style="{StaticResource RowHint}" Text="탭 전환 시 유용한 사용 팁을 대화창에 표시합니다. (기본: 꺼짐)"/>
                                    </StackPanel>
                                    <CheckBox Style="{StaticResource ToggleSwitch}" HorizontalAlignment="Right" VerticalAlignment="Center"
                                              IsChecked="{Binding ShowTips, Mode=TwoWay}"/>
                                </Grid>
                            </Border>

                            <!-- ── 에이전트 훅 ── -->
                            <TextBlock Style="{StaticResource SectionHeader}" Text="에이전트 훅"/>
                            <Border Style="{StaticResource SettingsRow}">
                                <Grid>
                                    <StackPanel HorizontalAlignment="Left" Margin="0,0,60,0">
                                        <StackPanel Orientation="Horizontal">
                                            <TextBlock Style="{StaticResource RowLabel}" Text="훅 시스템 활성화"/>
                                            <Border Width="16" Height="16" CornerRadius="8" Background="#EEF0FF" Margin="6,0,0,0" Cursor="Help" VerticalAlignment="Center">
                                                <TextBlock Text="?" FontSize="10" FontWeight="Bold" Foreground="#4B5EFC" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                                <Border.ToolTip>
                                                    <ToolTip Style="{StaticResource HelpTooltipStyle}">
                                                        <TextBlock TextWrapping="Wrap" Foreground="White" FontSize="12" LineHeight="18" MaxWidth="340">
                                                            AI가 도구(파일 읽기/쓰기, 검색, Git 등)를 실행할 때
                                                            <LineBreak/>그 전(Pre) 또는 후(Post)에 사용자가 등록한
                                                            <LineBreak/>스크립트를 자동으로 실행하는 확장 기능입니다.
                                                            <LineBreak/>
                                                            <LineBreak/>■ 동작 흐름
                                                            <LineBreak/>  AI 판단 → [Pre 훅] → 도구 실행 → [Post 훅] → 다음 단계
                                                            <LineBreak/>
                                                            <LineBreak/>■ 활용 예시
                                                            <LineBreak/>• 파일 수정 후 자동 백업 스크립트 실행
                                                            <LineBreak/>• Git 커밋 전 린트/테스트 자동 검사
                                                            <LineBreak/>• 모든 도구 호출을 로그 파일에 기록
                                                            <LineBreak/>• 특정 도구 실행 시 알림 표시
                                                            <LineBreak/>
                                                            <LineBreak/>■ 안전 설계
                                                            <LineBreak/>• 훅 실패 시에도 AI 작업은 정상 진행됩니다
                                                            <LineBreak/>• 타임아웃 초과 시 스크립트가 자동 종료됩니다
                                                            <LineBreak/>• 각 훅을 개별적으로 켜고 끌 수 있습니다
                                                            <LineBreak/>
                                                            <LineBreak/>지원 스크립트: .bat, .cmd, .ps1
                                                        </TextBlock>
                                                    </ToolTip>
                                                </Border.ToolTip>
                                            </Border>
                                        </StackPanel>
                                        <TextBlock Style="{StaticResource RowHint}" Text="도구 실행 전/후 사용자 정의 스크립트(.bat/.ps1)를 자동 실행합니다."/>
                                    </StackPanel>
                                    <CheckBox Style="{StaticResource ToggleSwitch}"
                                              IsChecked="{Binding EnableToolHooks}"
                                              HorizontalAlignment="Right" VerticalAlignment="Center"/>
                                </Grid>
                            </Border>
                            <Border Style="{StaticResource SettingsRow}">
                                <StackPanel>
                                    <StackPanel Orientation="Horizontal">
                                        <TextBlock Style="{StaticResource RowLabel}" Text="훅 실행 타임아웃"/>
                                        <TextBlock Text="{Binding ToolHookTimeoutMs, StringFormat={}{0:#,0}ms}"
                                                   Foreground="{DynamicResource SecondaryText}" FontSize="12" Margin="8,0,0,0" VerticalAlignment="Center"/>
                                        <Border Width="16" Height="16" CornerRadius="8" Background="#EEF0FF" Margin="6,0,0,0" Cursor="Help" VerticalAlignment="Center">
                                            <TextBlock Text="?" FontSize="10" FontWeight="Bold" Foreground="#4B5EFC" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                            <Border.ToolTip>
                                                <ToolTip Style="{StaticResource HelpTooltipStyle}">
                                                    <TextBlock TextWrapping="Wrap" Foreground="White" FontSize="12" LineHeight="18" MaxWidth="300">
                                                        훅 스크립트가 이 시간 내에 완료되지 않으면
                                                        <LineBreak/>자동으로 강제 종료됩니다.
                                                        <LineBreak/>
                                                        <LineBreak/>• 간단한 로깅: 3~5초 권장
                                                        <LineBreak/>• 린트/테스트 실행: 10~20초 권장
                                                        <LineBreak/>• 타임아웃 시 AI 작업은 정상 진행됩니다
                                                    </TextBlock>
                                                </ToolTip>
                                            </Border.ToolTip>
                                        </Border>
                                    </StackPanel>
                                    <Slider Minimum="3000" Maximum="30000" TickFrequency="1000"
                                            IsSnapToTickEnabled="True"
                                            Value="{Binding ToolHookTimeoutMs}"
                                            Margin="0,6,0,0"/>
                                </StackPanel>
                            </Border>
                            <Border Style="{StaticResource SettingsRow}">
                                <StackPanel>
                                    <StackPanel Orientation="Horizontal">
                                        <TextBlock Style="{StaticResource RowLabel}" Text="등록된 훅 목록"/>
                                        <Border Width="16" Height="16" CornerRadius="8" Background="#EEF0FF" Margin="6,0,0,0" Cursor="Help" VerticalAlignment="Center">
                                            <TextBlock Text="?" FontSize="10" FontWeight="Bold" Foreground="#4B5EFC" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                            <Border.ToolTip>
                                                <ToolTip Style="{StaticResource HelpTooltipStyle}">
                                                    <TextBlock TextWrapping="Wrap" Foreground="White" FontSize="12" LineHeight="18" MaxWidth="380">
                                                        스크립트에 환경 변수로 도구 실행 정보가 전달됩니다.
                                                        <LineBreak/>스크립트 내에서 이 값을 읽어 원하는 작업을 수행하세요.
                                                        <LineBreak/>
                                                        <LineBreak/>■ 공통 (Pre/Post 모두)
                                                        <LineBreak/>  AX_TOOL_NAME — 실행된 도구 이름 (예: file_write)
                                                        <LineBreak/>  AX_TOOL_TIMING — 실행 시점 (pre 또는 post)
                                                        <LineBreak/>  AX_TOOL_INPUT — 도구에 전달된 입력 (JSON)
                                                        <LineBreak/>  AX_WORK_FOLDER — 현재 작업 폴더 경로
                                                        <LineBreak/>
                                                        <LineBreak/>■ Post 전용 (도구 실행 후에만)
                                                        <LineBreak/>  AX_TOOL_OUTPUT — 도구 실행 결과 텍스트
                                                        <LineBreak/>  AX_TOOL_SUCCESS — 성공 여부 (true / false)
                                                        <LineBreak/>
                                                        <LineBreak/>■ 훅 설정 항목
                                                        <LineBreak/>  • 대상 도구: * (전체) 또는 특정 도구명
                                                        <LineBreak/>  • 타이밍: Pre (실행 전) / Post (실행 후)
                                                        <LineBreak/>  • 스크립트: 실행할 .bat/.cmd/.ps1 파일 경로
                                                        <LineBreak/>
                                                        <LineBreak/>■ 스크립트 예시 (backup.bat)
                                                        <LineBreak/>  @echo off
                                                        <LineBreak/>  echo [%date%] %AX_TOOL_NAME% >> log.txt
                                                    </TextBlock>
                                                </ToolTip>
                                            </Border.ToolTip>
                                        </Border>
                                    </StackPanel>
                                    <StackPanel x:Name="HookListPanel" Margin="0,8,0,0"/>
                                    <Border Background="{DynamicResource ItemHoverBackground}" CornerRadius="8"
                                            Padding="10,8" Margin="0,6,0,0" Cursor="Hand"
                                            MouseLeftButtonUp="AddHookBtn_Click">
                                        <StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
                                            <TextBlock Text="&#xE710;" FontFamily="Segoe MDL2 Assets" FontSize="12"
                                                       Foreground="{DynamicResource AccentColor}" VerticalAlignment="Center" Margin="0,0,6,0"/>
                                            <TextBlock Text="훅 추가" FontSize="13" Foreground="{DynamicResource AccentColor}"/>
                                        </StackPanel>
                                    </Border>
                                </StackPanel>
                            </Border>

                            <!-- ── 스킬 시스템 ── -->
                            <TextBlock Style="{StaticResource SectionHeader}" Text="스킬 시스템"/>
                            <Border Style="{StaticResource SettingsRow}">
                                <Grid>
                                    <StackPanel HorizontalAlignment="Left" Margin="0,0,60,0">
                                        <StackPanel Orientation="Horizontal">
                                            <TextBlock Style="{StaticResource RowLabel}" Text="스킬 시스템 활성화"/>
                                            <Border Width="16" Height="16" CornerRadius="8" Background="#EEF0FF" Margin="6,0,0,0" Cursor="Help" VerticalAlignment="Center">
                                                <TextBlock Text="?" FontSize="10" FontWeight="Bold" Foreground="#4B5EFC" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                                <Border.ToolTip>
                                                    <ToolTip Style="{StaticResource HelpTooltipStyle}">
                                                        <TextBlock TextWrapping="Wrap" Foreground="White" FontSize="12" LineHeight="18" MaxWidth="320">
                                                            마크다운 기반 재사용 워크플로우 시스템입니다.
                                                            <LineBreak/>*.skill.md 파일로 스킬을 정의하면 슬래시 명령어(/)로 호출할 수 있습니다.
                                                            <LineBreak/>
                                                            <LineBreak/>스킬 폴더: %APPDATA%\AxCopilot\skills\
                                                            <LineBreak/>예: /daily-standup, /bug-hunt, /code-explain
                                                        </TextBlock>
                                                    </ToolTip>
                                                </Border.ToolTip>
                                            </Border>
                                        </StackPanel>
                                        <TextBlock Style="{StaticResource RowHint}" Text="마크다운 기반 재사용 워크플로우. 슬래시 명령어(/)로 호출합니다."/>
                                    </StackPanel>
                                    <CheckBox Style="{StaticResource ToggleSwitch}" HorizontalAlignment="Right" VerticalAlignment="Center"
                                              IsChecked="{Binding EnableSkillSystem, Mode=TwoWay}"/>
                                </Grid>
                            </Border>

                            <Border Style="{StaticResource SettingsRow}">
                                <StackPanel>
                                    <TextBlock Style="{StaticResource RowLabel}" Text="추가 스킬 폴더"/>
                                    <TextBlock Style="{StaticResource RowHint}" Text="외부 스킬 파일(*.skill.md, SKILL.md)을 불러올 추가 폴더를 지정합니다." Margin="0,0,0,6"/>
                                    <Grid>
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="*"/>
                                            <ColumnDefinition Width="Auto"/>
                                            <ColumnDefinition Width="Auto"/>
                                        </Grid.ColumnDefinitions>
                                        <TextBox Grid.Column="0" Style="{StaticResource ModernTextBox}"
                                                 Text="{Binding SkillsFolderPath, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                                                 VerticalAlignment="Center"/>
                                        <Button Grid.Column="1" Content="찾아보기" Margin="8,0,0,0" Padding="12,6" FontSize="12"
                                                x:Name="BtnBrowseSkillFolder" Click="BtnBrowseSkillFolder_Click"
                                                Background="#EEF0FF" Foreground="#4B5EFC" BorderBrush="#D0D4FF"
                                                Cursor="Hand" FontWeight="SemiBold"/>
                                        <Button Grid.Column="2" Content="열기" Margin="6,0,0,0" Padding="12,6" FontSize="12"
                                                x:Name="BtnOpenSkillFolder" Click="BtnOpenSkillFolder_Click"
                                                Background="#F0FDF4" Foreground="#059669" BorderBrush="#BBF7D0"
                                                Cursor="Hand" FontWeight="SemiBold"/>
                                    </Grid>
                                </StackPanel>
                            </Border>

                            <Border Style="{StaticResource SettingsRow}">
                                <Grid>
                                    <StackPanel HorizontalAlignment="Left">
                                        <TextBlock Style="{StaticResource RowLabel}" Text="슬래시 팝업 표시 개수"/>
                                        <TextBlock Style="{StaticResource RowHint}" Text="/ 입력 시 한 번에 보여줄 명령어 개수입니다. (최소 3 ~ 최대 20)"/>
                                    </StackPanel>
                                    <StackPanel HorizontalAlignment="Right" VerticalAlignment="Center"
                                                Orientation="Horizontal">
                                        <TextBlock Text="{Binding SlashPopupPageSize}"
                                                   FontSize="13" FontWeight="SemiBold"
                                                   Foreground="{DynamicResource AccentColor}"
                                                   VerticalAlignment="Center"
                                                   MinWidth="24" TextAlignment="Right"
                                                   Margin="0,0,8,0"/>
                                        <Slider Width="140" Minimum="3" Maximum="20" TickFrequency="1"
                                                IsSnapToTickEnabled="True"
                                                Value="{Binding SlashPopupPageSize, Mode=TwoWay}"/>
                                    </StackPanel>
                                </Grid>
                            </Border>

                            <!-- ── 드래그 앤 드롭 AI ── -->
                            <TextBlock Style="{StaticResource SectionHeader}" Text="드래그 앤 드롭 AI"/>
                            <Border Style="{StaticResource SettingsRow}">
                                <Grid>
                                    <StackPanel HorizontalAlignment="Left" Margin="0,0,60,0">
                                        <StackPanel Orientation="Horizontal">
                                            <TextBlock Style="{StaticResource RowLabel}" Text="AI 액션 팝업 표시"/>
                                            <Border Width="16" Height="16" CornerRadius="8" Background="#EEF0FF" Margin="6,0,0,0" Cursor="Help" VerticalAlignment="Center">
                                                <TextBlock Text="?" FontSize="10" FontWeight="Bold" Foreground="#4B5EFC" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                                <Border.ToolTip>
                                                    <ToolTip Style="{StaticResource HelpTooltipStyle}">
                                                        <TextBlock TextWrapping="Wrap" Foreground="White" FontSize="12" LineHeight="18" MaxWidth="320">
                                                            파일을 입력창에 드래그하면 파일 유형에 맞는 AI 액션 메뉴가 표시됩니다.
                                                            <LineBreak/>
                                                            <LineBreak/>• 코드 파일: 코드 리뷰, 설명, 리팩토��, 테스트 생성
                                                            <LineBreak/>• 문서 파일: 요약, 분석, 번역
                                                            <LineBreak/>• 데이터 파일: 분석, 시각��, 변환
                                                            <LineBreak/>• 이미지: 설명, UI 리뷰
                                                            <LineBreak/>
                                                            <LineBreak/>끄면 기존처럼 파일만 첨부합니다.
                                                        </TextBlock>
                                                    </ToolTip>
                                                </Border.ToolTip>
                                            </Border>
                                        </StackPanel>
                                        <TextBlock Style="{StaticResource RowHint}" Text="파일 드래그 시 유형별 AI 분석/변환/요약 액션을 제안합니다."/>
                                    </StackPanel>
                                    <CheckBox Style="{StaticResource ToggleSwitch}" HorizontalAlignment="Right" VerticalAlignment="Center"
                                              IsChecked="{Binding EnableDragDropAiActions, Mode=TwoWay}"/>
                                </Grid>
                            </Border>
                            <Border Style="{StaticResource SettingsRow}">
                                <Grid>
                                    <StackPanel HorizontalAlignment="Left" Margin="0,0,60,0">
                                        <TextBlock Style="{StaticResource RowLabel}" Text="선택 시 자동 전송"/>
                                        <TextBlock Style="{StaticResource RowHint}" Text="AI 액션 선택 시 입력 없이 바로 전송합니다. (기본: 꺼짐)"/>
                                    </StackPanel>
                                    <CheckBox Style="{StaticResource ToggleSwitch}" HorizontalAlignment="Right" VerticalAlignment="Center"
                                              IsChecked="{Binding DragDropAutoSend, Mode=TwoWay}"/>
                                </Grid>
                            </Border>

                            <!-- ── 코드 리뷰 ── -->
                            <TextBlock Style="{StaticResource SectionHeader}" Text="AI 코드 리뷰"/>
                            <Border Style="{StaticResource SettingsRow}">
                                <Grid>
                                    <StackPanel HorizontalAlignment="Left" Margin="0,0,60,0">
                                        <StackPanel Orientation="Horizontal">
                                            <TextBlock Style="{StaticResource RowLabel}" Text="코드 리뷰 도구 활성화"/>
                                            <Border Width="16" Height="16" CornerRadius="8" Background="#EEF0FF" Margin="6,0,0,0" Cursor="Help" VerticalAlignment="Center">
                                                <TextBlock Text="?" FontSize="10" FontWeight="Bold" Foreground="#4B5EFC" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                                <Border.ToolTip>
                                                    <ToolTip Style="{StaticResource HelpTooltipStyle}">
                                                        <TextBlock TextWrapping="Wrap" Foreground="White" FontSize="12" LineHeight="18" MaxWidth="320">
                                                            AI가 Git diff, 파일 정적 검사, PR 요약을 수행합니다.
                                                            <LineBreak/>
                                                            <LineBreak/>• diff_review: 변경사항 분석 (버그, 보안, 성능)
                                                            <LineBreak/>• file_review: 파일 품질 검사
                                                            <LineBreak/>• pr_summary: PR 설명 자동 생성
                                                            <LineBreak/>
                                                            <LineBreak/>Cowork/Code 탭에서 에이전트가 자동으로 사용합니다.
                                                        </TextBlock>
                                                    </ToolTip>
                                                </Border.ToolTip>
                                            </Border>
                                        </StackPanel>
                                        <TextBlock Style="{StaticResource RowHint}" Text="Git diff 분석, 정적 코드 검사, PR 요약 생성을 지원합니다."/>
                                    </StackPanel>
                                    <CheckBox Style="{StaticResource ToggleSwitch}" HorizontalAlignment="Right" VerticalAlignment="Center"
                                              IsChecked="{Binding EnableCodeReview, Mode=TwoWay}"/>
                                </Grid>
                            </Border>

                            <!-- ── 기타 설정 ── -->
                            <TextBlock Style="{StaticResource SectionHeader}" Text="기타"/>
                            <Border Style="{StaticResource SettingsRow}">
                                <StackPanel>
                                    <StackPanel Orientation="Horizontal">
                                        <TextBlock Style="{StaticResource RowLabel}" Text="PDF 내보내기 기본 경로"/>
                                        <Border Width="16" Height="16" CornerRadius="8" Background="#EEF0FF" Margin="6,0,0,0" Cursor="Help" VerticalAlignment="Center">
                                            <TextBlock Text="?" FontSize="10" FontWeight="Bold" Foreground="#4B5EFC" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                            <Border.ToolTip>
                                                <ToolTip Style="{StaticResource HelpTooltipStyle}">
                                                    <TextBlock TextWrapping="Wrap" Foreground="White" FontSize="12" LineHeight="18">
                                                        대화를 PDF로 내보낼 때 기본 저장 폴더입니다.
                                                        <LineBreak/>비어 있으면 바탕화면에 저장됩니다.
                                                    </TextBlock>
                                                </ToolTip>
                                            </Border.ToolTip>
                                        </Border>
                                    </StackPanel>
                                    <TextBlock Style="{StaticResource RowHint}" Text="빈 값이면 바탕화면에 저장됩니다"/>
                                    <TextBox Text="{Binding PdfExportPath, Mode=TwoWay}" FontSize="12"
                                             Padding="6,4" Margin="0,4,0,0"/>
                                </StackPanel>
                            </Border>
                            <Border Style="{StaticResource SettingsRow}">
                                <Grid>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="*"/>
                                        <ColumnDefinition Width="Auto"/>
                                    </Grid.ColumnDefinitions>
                                    <StackPanel Grid.Column="0" VerticalAlignment="Center">
                                        <StackPanel Orientation="Horizontal">
                                            <TextBlock Style="{StaticResource RowLabel}" Text="팁 알림 표시 시간"/>
                                            <Border Width="16" Height="16" CornerRadius="8" Background="#EEF0FF" Margin="6,0,0,0" Cursor="Help" VerticalAlignment="Center">
                                                <TextBlock Text="?" FontSize="10" FontWeight="Bold" Foreground="#4B5EFC" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                                <Border.ToolTip>
                                                    <ToolTip Style="{StaticResource HelpTooltipStyle}">
                                                        <TextBlock TextWrapping="Wrap" Foreground="White" FontSize="12" LineHeight="18">
                                                            Cowork/Code 탭 전환 시 표시되는 사용법 팁의 자동 닫힘 시간입니다.
                                                            <LineBreak/>0으로 설정하면 직접 닫을 때까지 표시됩니다.
                                                        </TextBlock>
                                                    </ToolTip>
                                                </Border.ToolTip>
                                            </Border>
                                        </StackPanel>
                                        <TextBlock Style="{StaticResource RowHint}" Text="사용법 팁 자동 닫힘 시간 (0=수동 닫기)"/>
                                    </StackPanel>
                                    <ComboBox Grid.Column="1"
                                              SelectedValue="{Binding TipDurationSeconds}"
                                              SelectedValuePath="Tag"
                                              Width="100" VerticalAlignment="Center">
                                        <ComboBoxItem Content="수동 닫기" Tag="0"/>
                                        <ComboBoxItem Content="3초" Tag="3"/>
                                        <ComboBoxItem Content="5초 (기본)" Tag="5"/>
                                        <ComboBoxItem Content="10초" Tag="10"/>
                                        <ComboBoxItem Content="15초" Tag="15"/>
                                        <ComboBoxItem Content="30초" Tag="30"/>
                                    </ComboBox>
                                </Grid>
                            </Border>

                            <!-- ── 이미지 입력 (멀티모달) ── -->
                            <TextBlock Style="{StaticResource SectionHeader}" Text="이미지 입력"/>
                            <Border Style="{StaticResource SettingsRow}">
                                <Grid>
                                    <StackPanel HorizontalAlignment="Left">
                                        <StackPanel Orientation="Horizontal">
                                            <TextBlock Style="{StaticResource RowLabel}" Text="이미지 입력 활성화"/>
                                            <Border Width="16" Height="16" CornerRadius="8" Background="#EEF0FF" Margin="6,0,0,0" Cursor="Help" VerticalAlignment="Center">
                                                <TextBlock Text="?" FontSize="10" FontWeight="Bold" Foreground="#4B5EFC" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                                <Border.ToolTip>
                                                    <ToolTip Style="{StaticResource HelpTooltipStyle}">
                                                        <TextBlock TextWrapping="Wrap" Foreground="White" FontSize="12" LineHeight="18">
                                                            Ctrl+V로 스크린샷을 붙여넣거나 이미지 파일을 첨부하면
                                                            <LineBreak/>AI가 이미지를 분석합니다 (Vision API).
                                                            <LineBreak/><LineBreak/>지원 형식: PNG, JPG, GIF, BMP, WebP
                                                        </TextBlock>
                                                    </ToolTip>
                                                </Border.ToolTip>
                                            </Border>
                                        </StackPanel>
                                        <TextBlock Style="{StaticResource RowHint}" Text="Ctrl+V 스크린샷 붙여넣기 및 이미지 파일 첨부 허용"/>
                                    </StackPanel>
                                    <CheckBox Style="{StaticResource ToggleSwitch}"
                                              IsChecked="{Binding EnableImageInput}"
                                              HorizontalAlignment="Right" VerticalAlignment="Center"/>
                                </Grid>
                            </Border>
                            <Border Style="{StaticResource SettingsRow}">
                                <StackPanel>
                                    <StackPanel Orientation="Horizontal">
                                        <TextBlock Style="{StaticResource RowLabel}" Text="최대 이미지 크기"/>
                                        <TextBlock Text="{Binding MaxImageSizeKb, StringFormat={}{0:#,0} KB}"
                                                   Foreground="{DynamicResource SecondaryText}" FontSize="12" Margin="8,0,0,0" VerticalAlignment="Center"/>
                                    </StackPanel>
                                    <Slider Minimum="1024" Maximum="10240" TickFrequency="1024"
                                            IsSnapToTickEnabled="True"
                                            Value="{Binding MaxImageSizeKb}"
                                            Margin="0,6,0,0"/>
                                </StackPanel>
                            </Border>

                            <!-- ── 자동 모델 라우팅 (잠금) ── -->
                            <TextBlock Style="{StaticResource SectionHeader}" Text="자동 모델 라우팅"/>
                            <Border Style="{StaticResource SettingsRow}" Opacity="0.5">
                                <Grid>
                                    <StackPanel HorizontalAlignment="Left">
                                        <StackPanel Orientation="Horizontal">
                                            <TextBlock Style="{StaticResource RowLabel}" Text="자동 라우팅 활성화"/>
                                            <Border Width="16" Height="16" CornerRadius="8" Background="#EEF0FF" Margin="6,0,0,0" Cursor="Help" VerticalAlignment="Center">
                                                <TextBlock Text="?" FontSize="10" FontWeight="Bold" Foreground="#4B5EFC" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                                <Border.ToolTip>
                                                    <ToolTip Style="{StaticResource HelpTooltipStyle}">
                                                        <TextBlock TextWrapping="Wrap" Foreground="White" FontSize="12" LineHeight="18">
                                                            질문 ���형(코딩/번역/분석 등)을 자동 감지하여 최적의 AI 모델로 전환합니다.
                                                            <LineBreak/><LineBreak/>현재 사내 서버 미확정으로 비활성 상태입니다.
                                                            <LineBreak/>서버 확정 후 개발자가 활성화�� 예정입니다.
                                                        </TextBlock>
                                                    </ToolTip>
                                                </Border.ToolTip>
                                            </Border>
                                        </StackPanel>
                                        <TextBlock Style="{StaticResource RowHint}" Text="준비 중 — 사내 AI 서버 확정 후 활성화 예정"/>
                                    </StackPanel>
                                    <CheckBox Style="{StaticResource ToggleSwitch}"
                                              IsChecked="{Binding EnableAutoRouter}"
                                              IsEnabled="False" IsHitTestVisible="False"
                                              HorizontalAlignment="Right" VerticalAlignment="Center"/>
                                </Grid>
                            </Border>
                            <Border Style="{StaticResource SettingsRow}" Opacity="0.5">
                                <StackPanel>
                                    <StackPanel Orientation="Horizontal">
                                        <TextBlock Style="{StaticResource RowLabel}" Text="라우팅 확신도 임계값"/>
                                        <TextBlock Text="{Binding AutoRouterConfidence, StringFormat={}{0:P0}}"
                                                   Foreground="{DynamicResource SecondaryText}" FontSize="12" Margin="8,0,0,0" VerticalAlignment="Center"/>
                                        <Border Width="16" Height="16" CornerRadius="8" Background="#EEF0FF" Margin="6,0,0,0" Cursor="Help" VerticalAlignment="Center">
                                            <TextBlock Text="?" FontSize="10" FontWeight="Bold" Foreground="#4B5EFC" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                            <Border.ToolTip>
                                                <ToolTip Style="{StaticResource HelpTooltipStyle}">
                                                    <TextBlock TextWrapping="Wrap" Foreground="White" FontSize="12" LineHeight="18">
                                                        질문 유형 감지의 확신도가 이 값 이상일 때만 자동 전환합니다.
                                                        <LineBreak/>높을수록 보수적 (확실한 경우만 전환), 낮을수록 적극적.
                                                    </TextBlock>
                                                </ToolTip>
                                            </Border.ToolTip>
                                        </Border>
                                    </StackPanel>
                                    <Slider Minimum="0.5" Maximum="0.95" TickFrequency="0.05"
                                            IsSnapToTickEnabled="True"
                                            Value="{Binding AutoRouterConfidence}"
                                            IsEnabled="False"
                                            Margin="0,6,0,0"/>
                                </StackPanel>
                            </Border>

                        </StackPanel>
                    </ScrollViewer>

                    <!-- ══════════════════════════════════════════════════
                         채팅 탭 (Chat)
                         ══════════════════════════════════════════════════ -->
                    <ScrollViewer x:Name="AgentPanelChat" Grid.Row="2" Visibility="Collapsed"
                                  VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled"
                                  Padding="0,0,8,0">
                        <StackPanel>
                            <TextBlock Style="{StaticResource SectionHeader}" Text="프롬프트 템플릿"/>
                            <Border Style="{StaticResource SettingsRow}">
                                <Grid>
                                    <StackPanel HorizontalAlignment="Left">
                                        <TextBlock Style="{StaticResource RowLabel}" Text="저장된 템플릿"/>
                                        <TextBlock Style="{StaticResource RowHint}" Text="자주 사용하는 프롬프트를 저장해 빠르게 불러옵니다."/>
                                    </StackPanel>
                                    <Button x:Name="BtnAddTemplate" HorizontalAlignment="Right" VerticalAlignment="Center"
                                            Content="+ 템플릿 추가" Padding="12,6" Cursor="Hand"
                                            Click="BtnAddTemplate_Click"/>
                                </Grid>
                            </Border>
                            <ItemsControl ItemsSource="{Binding PromptTemplates}" Margin="0,2,0,8">
                                <ItemsControl.ItemTemplate>
                                    <DataTemplate>
                                        <Border Background="{DynamicResource ItemBackground}"
                                                CornerRadius="10" Padding="14,10" Margin="0,4,0,0"
                                                BorderBrush="{DynamicResource BorderColor}" BorderThickness="1">
                                            <Grid>
                                                <Grid.ColumnDefinitions>
                                                    <ColumnDefinition Width="*"/>
                                                    <ColumnDefinition Width="Auto"/>
                                                </Grid.ColumnDefinitions>
                                                <StackPanel Grid.Column="0" VerticalAlignment="Center">
                                                    <TextBlock Text="{Binding Name}" FontSize="13" FontWeight="SemiBold"
                                                               Foreground="{DynamicResource PrimaryText}"/>
                                                    <TextBlock Text="{Binding Preview}" FontSize="11"
                                                               Foreground="{DynamicResource SecondaryText}"
                                                               Margin="0,3,0,0" TextTrimming="CharacterEllipsis"/>
                                                </StackPanel>
                                                <StackPanel Grid.Column="1" Orientation="Horizontal" VerticalAlignment="Center">
                                                    <Button Content="&#xE70F;" FontFamily="Segoe MDL2 Assets"
                                                            FontSize="12" ToolTip="편집" Cursor="Hand"
                                                            Background="Transparent" BorderThickness="0"
                                                            Foreground="{DynamicResource SecondaryText}"
                                                            Padding="6,4" Margin="0,0,4,0"
                                                            Tag="{Binding}" Click="BtnEditTemplate_Click"/>
                                                    <Button Content="&#xE74D;" FontFamily="Segoe MDL2 Assets"
                                                            FontSize="12" ToolTip="삭제" Cursor="Hand"
                                                            Background="Transparent" BorderThickness="0"
                                                            Foreground="#DD4444" Padding="6,4"
                                                            Tag="{Binding}" Click="BtnDeleteTemplate_Click"/>
                                                </StackPanel>
                                            </Grid>
                                        </Border>
                                    </DataTemplate>
                                </ItemsControl.ItemTemplate>
                            </ItemsControl>
                        </StackPanel>
                    </ScrollViewer>

                    <!-- ══════════════════════════════════════════════════
                         코워크 탭 (Cowork)
                         ══════════════════════════════════════════════════ -->
                    <!-- ══════════════════════════════════════════════════
                         코워크/코드 공통 탭 (Cowork/Code Shared)
                         ══════════════════════════════════════════════════ -->
                    <ScrollViewer x:Name="AgentPanelCoworkCode" Grid.Row="2" Visibility="Collapsed"
                                  VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled"
                                  Padding="0,0,8,0">
                        <StackPanel>
                            <!-- ── 파일 접근 권한 ── -->
                            <TextBlock Style="{StaticResource SectionHeader}" Text="파일 접근 권한"/>
                            <Border Style="{StaticResource SettingsRow}">
                                <Grid>
                                    <StackPanel HorizontalAlignment="Left">
                                        <TextBlock Style="{StaticResource RowLabel}" Text="기본 파일 접근 권한"/>
                                        <TextBlock Style="{StaticResource RowHint}" Text="Cowork/Code 탭 진입 시 자동 적용되는 권한입니다."/>
                                    </StackPanel>
                                    <ComboBox HorizontalAlignment="Right" VerticalAlignment="Center"
                                              Width="160" SelectedValue="{Binding DefaultAgentPermission, Mode=TwoWay}"
                                              SelectedValuePath="Tag">
                                        <ComboBoxItem Content="Ask (매번 확인)" Tag="Ask"/>
                                        <ComboBoxItem Content="Auto (자동 허용)" Tag="Auto"/>
                                        <ComboBoxItem Content="Deny (차단)" Tag="Deny"/>
                                    </ComboBox>
                                </Grid>
                            </Border>

                            <!-- ── 에이전트 동작 ── -->
                            <TextBlock Style="{StaticResource SectionHeader}" Text="에이전트 동작"/>
                            <Border Style="{StaticResource SettingsRow}">
                                <Grid>
                                    <StackPanel HorizontalAlignment="Left">
                                        <TextBlock Style="{StaticResource RowLabel}" Text="최대 반복 횟수"/>
                                        <TextBlock Style="{StaticResource RowHint}" Text="에이전트가 도구를 호출하며 반복할 수 있는 최대 횟수입니다. (1~100)"/>
                                    </StackPanel>
                                    <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Center">
                                        <Slider Width="120" Minimum="1" Maximum="100" TickFrequency="1"
                                                IsSnapToTickEnabled="True"
                                                Value="{Binding MaxAgentIterations, Mode=TwoWay}"
                                                VerticalAlignment="Center"/>
                                        <TextBlock Text="{Binding MaxAgentIterations}"
                                                   FontSize="13" FontWeight="SemiBold" Foreground="#4B5EFC"
                                                   Width="32" TextAlignment="Center" VerticalAlignment="Center"
                                                   Margin="8,0,0,0"/>
                                    </StackPanel>
                                </Grid>
                            </Border>
                            <Border Style="{StaticResource SettingsRow}">
                                <Grid>
                                    <StackPanel HorizontalAlignment="Left">
                                        <TextBlock Style="{StaticResource RowLabel}" Text="오류 시 최대 재시도"/>
                                        <TextBlock Style="{StaticResource RowHint}" Text="도구 실행 실패 시 자동으로 재시도할 횟수입니다. (0~10)"/>
                                    </StackPanel>
                                    <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Center">
                                        <Slider Width="100" Minimum="0" Maximum="10" TickFrequency="1"
                                                IsSnapToTickEnabled="True"
                                                Value="{Binding MaxRetryOnError, Mode=TwoWay}"
                                                VerticalAlignment="Center"/>
                                        <TextBlock Text="{Binding MaxRetryOnError}"
                                                   FontSize="13" FontWeight="SemiBold" Foreground="#4B5EFC"
                                                   Width="24" TextAlignment="Center" VerticalAlignment="Center"
                                                   Margin="8,0,0,0"/>
                                    </StackPanel>
                                </Grid>
                            </Border>
                            <Border Style="{StaticResource SettingsRow}">
                                <Grid>
                                    <StackPanel HorizontalAlignment="Left" Margin="0,0,180,0">
                                        <StackPanel Orientation="Horizontal">
                                            <TextBlock Style="{StaticResource RowLabel}" Text="의사결정 수준"/>
                                            <Border Width="16" Height="16" CornerRadius="8" Background="#EEF0FF" Margin="6,0,0,0" Cursor="Help" VerticalAlignment="Center">
                                                <TextBlock Text="?" FontSize="10" FontWeight="Bold" Foreground="#4B5EFC" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                                <Border.ToolTip>
                                                    <ToolTip Style="{StaticResource HelpTooltipStyle}">
                                                        <TextBlock TextWrapping="Wrap" Foreground="White" FontSize="12" LineHeight="18">
                                                            AI가 중요한 작업을 실행하기 전에 사용자 확인을 요청하는 빈도입니다.
                                                            <LineBreak/><LineBreak/>• 최소 — 파일 삭제, 외부 명령만 확인
                                                            <LineBreak/>• 보통 — + 새 파일 생성, 문서 생성, 빌드/테스트 실행
                                                            <LineBreak/>• 상세 — + 모든 파일 수정 시 확인
                                                            <LineBreak/><LineBreak/>※ Git 커밋은 수준에 관계없이 항상 확인합니다.
                                                            <LineBreak/>Cowork/Code 탭 모두에 적용됩니다.
                                                        </TextBlock>
                                                    </ToolTip>
                                                </Border.ToolTip>
                                            </Border>
                                        </StackPanel>
                                        <TextBlock Style="{StaticResource RowHint}" Text="AI가 중요한 작업 전에 사용자 확인을 요청하는 빈도"/>
                                    </StackPanel>
                                    <ComboBox HorizontalAlignment="Right" VerticalAlignment="Center"
                                              Width="160" SelectedValue="{Binding AgentDecisionLevel, Mode=TwoWay}"
                                              SelectedValuePath="Tag">
                                        <ComboBoxItem Content="최소 (숙련자)" Tag="minimal"/>
                                        <ComboBoxItem Content="보통 (권장)" Tag="normal"/>
                                        <ComboBoxItem Content="상세 (신중)" Tag="detailed"/>
                                    </ComboBox>
                                </Grid>
                            </Border>
                            <Border Style="{StaticResource SettingsRow}">
                                <Grid>
                                    <StackPanel HorizontalAlignment="Left" Margin="0,0,180,0">
                                        <StackPanel Orientation="Horizontal">
                                            <TextBlock Style="{StaticResource RowLabel}" Text="플랜 모드"/>
                                            <Border Width="16" Height="16" CornerRadius="8" Background="#EEF0FF" Margin="6,0,0,0" Cursor="Help" VerticalAlignment="Center">
                                                <TextBlock Text="?" FontSize="10" FontWeight="Bold" Foreground="#4B5EFC" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                                <Border.ToolTip>
                                                    <ToolTip Style="{StaticResource HelpTooltipStyle}">
                                                        <TextBlock TextWrapping="Wrap" Foreground="White" FontSize="12" LineHeight="18">
                                                            AI가 도구를 실행하기 전에 실행 계획을 먼저 생성합니다.
                                                            <LineBreak/><LineBreak/>• Off — 기존 동작 (계획 없이 바로 실행)
                                                            <LineBreak/>• Always — 항상 계획 생성 후 승인 대기
                                                            <LineBreak/>• Auto — 복잡한 작업 감지 시 자동 계획
                                                            <LineBreak/><LineBreak/>계획을 검토·수정·승인한 후 실행됩니다.
                                                        </TextBlock>
                                                    </ToolTip>
                                                </Border.ToolTip>
                                            </Border>
                                        </StackPanel>
                                        <TextBlock Style="{StaticResource RowHint}" Text="도구 실행 전 구조화된 실행 계획 생성 및 사용자 승인"/>
                                    </StackPanel>
                                    <ComboBox HorizontalAlignment="Right" VerticalAlignment="Center"
                                              Width="160" SelectedValue="{Binding PlanMode, Mode=TwoWay}"
                                              SelectedValuePath="Tag">
                                        <ComboBoxItem Content="Off (비활성)" Tag="off"/>
                                        <ComboBoxItem Content="Always (항상)" Tag="always"/>
                                        <ComboBoxItem Content="Auto (자동)" Tag="auto"/>
                                    </ComboBox>
                                </Grid>
                            </Border>

                            <!-- ── 프로젝트 규칙 ── -->
                            <TextBlock Style="{StaticResource SectionHeader}" Text="프로젝트 규칙"/>
                            <Border Style="{StaticResource SettingsRow}">
                                <Grid>
                                    <StackPanel HorizontalAlignment="Left" Margin="0,0,60,0">
                                        <StackPanel Orientation="Horizontal">
                                            <TextBlock Style="{StaticResource RowLabel}" Text="프로젝트 규칙 자동 주입"/>
                                            <Border Width="16" Height="16" CornerRadius="8" Background="#EEF0FF" Margin="6,0,0,0" Cursor="Help" VerticalAlignment="Center">
                                                <TextBlock Text="?" FontSize="10" FontWeight="Bold" Foreground="#4B5EFC" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                                <Border.ToolTip>
                                                    <ToolTip Style="{StaticResource HelpTooltipStyle}">
                                                        <TextBlock TextWrapping="Wrap" Foreground="White" FontSize="12" LineHeight="18">
                                                            작업 폴더의 .ax/rules/ 디렉토리에 있는 규칙 파일을
                                                            <LineBreak/>AI 시스템 프롬프트에 자동으로 포함합니다.
                                                            <LineBreak/><LineBreak/>규칙 파일 형식 (마크다운 + YAML 프론트매터):
                                                            <LineBreak/>---
                                                            <LineBreak/>name: 코딩 컨벤션
                                                            <LineBreak/>applies-to: "*.cs"
                                                            <LineBreak/>when: always
                                                            <LineBreak/>---
                                                            <LineBreak/>규칙 내용...
                                                            <LineBreak/><LineBreak/>비활성화해도 project_rules 도구로 수동 조회는 가능합니다.
                                                        </TextBlock>
                                                    </ToolTip>
                                                </Border.ToolTip>
                                            </Border>
                                        </StackPanel>
                                        <TextBlock Style="{StaticResource RowHint}" Text=".ax/rules/*.md 규칙을 시스템 프롬프트에 자동 포함"/>
                                    </StackPanel>
                                    <CheckBox Style="{StaticResource ToggleSwitch}" HorizontalAlignment="Right"
                                              IsChecked="{Binding EnableProjectRules}"/>
                                </Grid>
                            </Border>

                            <!-- ── 에이전트 메모리 ── -->
                            <TextBlock Style="{StaticResource SectionHeader}" Text="에이전트 메모리"/>
                            <Border Style="{StaticResource SettingsRow}">
                                <Grid>
                                    <StackPanel HorizontalAlignment="Left" Margin="0,0,60,0">
                                        <StackPanel Orientation="Horizontal">
                                            <TextBlock Style="{StaticResource RowLabel}" Text="에이전트 메모리 활성화"/>
                                            <Border Width="16" Height="16" CornerRadius="8" Background="#EEF0FF" Margin="6,0,0,0" Cursor="Help" VerticalAlignment="Center">
                                                <TextBlock Text="?" FontSize="10" FontWeight="Bold" Foreground="#4B5EFC" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                                <Border.ToolTip>
                                                    <ToolTip Style="{StaticResource HelpTooltipStyle}">
                                                        <TextBlock TextWrapping="Wrap" Foreground="White" FontSize="12" LineHeight="18">
                                                            AI가 대화에서 학습한 프로젝트 규칙, 사용자 선호도,
                                                            <LineBreak/>사실 정보를 저장하고 다음 대화에서 활용합니다.
                                                            <LineBreak/><LineBreak/>• 작업 폴더별로 별도 메모리 관리
                                                            <LineBreak/>• 전역 메모리는 모든 폴더에 적용
                                                            <LineBreak/>• 암호화되어 안전하게 저장
                                                        </TextBlock>
                                                    </ToolTip>
                                                </Border.ToolTip>
                                            </Border>
                                        </StackPanel>
                                        <TextBlock Style="{StaticResource RowHint}" Text="프로젝트 규칙과 사용자 선호도를 학습하여 대화 간 지속적으로 활용합니다."/>
                                    </StackPanel>
                                    <CheckBox Style="{StaticResource ToggleSwitch}" HorizontalAlignment="Right" VerticalAlignment="Center"
                                              IsChecked="{Binding EnableAgentMemory, Mode=TwoWay}"/>
                                </Grid>
                            </Border>
                            <Border Style="{StaticResource SettingsRow}">
                                <Grid>
                                    <StackPanel HorizontalAlignment="Left">
                                        <TextBlock Style="{StaticResource RowLabel}" Text="최대 메모리 항목 수"/>
                                        <TextBlock Style="{StaticResource RowHint}" Text="폴더당 저장할 수 있는 최대 메모리 항목 수입니다. (20~200)"/>
                                    </StackPanel>
                                    <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Center">
                                        <Slider Width="120" Minimum="20" Maximum="200" TickFrequency="10"
                                                IsSnapToTickEnabled="True"
                                                Value="{Binding MaxMemoryEntries, Mode=TwoWay}"
                                                VerticalAlignment="Center"/>
                                        <TextBlock Text="{Binding MaxMemoryEntries}"
                                                   FontSize="13" FontWeight="SemiBold" Foreground="#4B5EFC"
                                                   Width="32" TextAlignment="Center" VerticalAlignment="Center"
                                                   Margin="8,0,0,0"/>
                                    </StackPanel>
                                </Grid>
                            </Border>
                            <Border Style="{StaticResource SettingsRow}">
                                <Grid>
                                    <StackPanel HorizontalAlignment="Left">
                                        <TextBlock Style="{StaticResource RowLabel}" Text="메모리 관리"/>
                                        <TextBlock Style="{StaticResource RowHint}" Text="현재 작업 폴더의 메모리를 확인하거나 초기화합니다."/>
                                    </StackPanel>
                                    <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Center">
                                        <Button Content="메모리 초기화" Click="BtnClearMemory_Click"
                                                Background="#DC2626" Foreground="White" FontSize="12"
                                                Padding="14,6" Cursor="Hand" BorderThickness="0" Margin="8,0,0,0">
                                            <Button.Template>
                                                <ControlTemplate TargetType="Button">
                                                    <Border Background="{TemplateBinding Background}" CornerRadius="8"
                                                            Padding="{TemplateBinding Padding}">
                                                        <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                                    </Border>
                                                </ControlTemplate>
                                            </Button.Template>
                                        </Button>
                                    </StackPanel>
                                </Grid>
                            </Border>
                        </StackPanel>
                    </ScrollViewer>

                    <!-- ══════════════════════════════════════════════════
                         코워크 탭 (Cowork) — 코워크 전용 설정
                         ══════════════════════════════════════════════════ -->
                    <ScrollViewer x:Name="AgentPanelCowork" Grid.Row="2" Visibility="Collapsed"
                                  VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled"
                                  Padding="0,0,8,0">
                        <StackPanel>
                            <!-- ── 출력 형식 ── -->
                            <TextBlock Style="{StaticResource SectionHeader}" Text="출력 형식"/>
                            <Border Style="{StaticResource SettingsRow}">
                                <Grid>
                                    <StackPanel HorizontalAlignment="Left">
                                        <TextBlock Style="{StaticResource RowLabel}" Text="기본 출력 형식"/>
                                        <TextBlock Style="{StaticResource RowHint}" Text="AI가 파일을 생성할 때 사용할 기본 형식입니다. Auto는 AI가 자동 선택합니다."/>
                                    </StackPanel>
                                    <ComboBox HorizontalAlignment="Right" VerticalAlignment="Center"
                                              Width="160" SelectedValue="{Binding DefaultOutputFormat, Mode=TwoWay}"
                                              SelectedValuePath="Tag">
                                        <ComboBoxItem Content="Auto (AI 선택)" Tag="auto"/>
                                        <ComboBoxItem Content="Excel (.xlsx)" Tag="xlsx"/>
                                        <ComboBoxItem Content="Word (.docx)" Tag="docx"/>
                                        <ComboBoxItem Content="HTML" Tag="html"/>
                                        <ComboBoxItem Content="Markdown (.md)" Tag="md"/>
                                        <ComboBoxItem Content="CSV" Tag="csv"/>
                                    </ComboBox>
                                </Grid>
                            </Border>

                            <!-- ── 미리보기 ── -->
                            <TextBlock Style="{StaticResource SectionHeader}" Text="미리보기"/>
                            <Border Style="{StaticResource SettingsRow}">
                                <Grid>
                                    <StackPanel HorizontalAlignment="Left">
                                        <TextBlock Style="{StaticResource RowLabel}" Text="문서 미리보기"/>
                                        <TextBlock Style="{StaticResource RowHint}" Text="파일 생성 시 오른쪽 패널에 미리보기를 표시합니다."/>
                                    </StackPanel>
                                    <ComboBox HorizontalAlignment="Right" VerticalAlignment="Center"
                                              Width="160" SelectedValue="{Binding AutoPreview, Mode=TwoWay}"
                                              SelectedValuePath="Tag">
                                        <ComboBoxItem Content="Auto (자동 표시)" Tag="auto"/>
                                        <ComboBoxItem Content="Manual (수동)" Tag="manual"/>
                                        <ComboBoxItem Content="Off (비활성화)" Tag="off"/>
                                    </ComboBox>
                                </Grid>
                            </Border>

                            <!-- ── 작업 폴더 ── -->
                            <TextBlock Style="{StaticResource SectionHeader}" Text="작업 폴더"/>
                            <Border Style="{StaticResource SettingsRow}">
                                <Grid>
                                    <StackPanel HorizontalAlignment="Left">
                                        <TextBlock Style="{StaticResource RowLabel}" Text="최근 폴더 최대 표시 수"/>
                                        <TextBlock Style="{StaticResource RowHint}" Text="코워크 폴더 선택 메뉴에 표시할 최근 폴더 최대 개수입니다. (3~30)"/>
                                    </StackPanel>
                                    <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Center">
                                        <Slider Width="120" Minimum="3" Maximum="30" TickFrequency="1"
                                                IsSnapToTickEnabled="True"
                                                Value="{Binding MaxRecentFolders, Mode=TwoWay}"
                                                VerticalAlignment="Center"/>
                                        <TextBlock Text="{Binding MaxRecentFolders}"
                                                   FontSize="13" FontWeight="SemiBold" Foreground="#4B5EFC"
                                                   Width="28" TextAlignment="Center" VerticalAlignment="Center"
                                                   Margin="8,0,0,0"/>
                                    </StackPanel>
                                </Grid>
                            </Border>

                            <Border Style="{StaticResource SettingsRow}">
                                <Grid>
                                    <StackPanel HorizontalAlignment="Left">
                                        <TextBlock Style="{StaticResource RowLabel}" Text="기본 디자인 무드"/>
                                        <TextBlock Style="{StaticResource RowHint}" Text="HTML 보고서의 기본 디자인 테마입니다."/>
                                    </StackPanel>
                                    <ComboBox HorizontalAlignment="Right" VerticalAlignment="Center"
                                              Width="180" SelectedValue="{Binding DefaultMood, Mode=TwoWay}"
                                              SelectedValuePath="Tag">
                                        <ComboBoxItem Content="🔷 모던" Tag="modern"/>
                                        <ComboBoxItem Content="📊 전문가" Tag="professional"/>
                                        <ComboBoxItem Content="🎨 아이디어" Tag="creative"/>
                                        <ComboBoxItem Content="◻️ 미니멀" Tag="minimal"/>
                                        <ComboBoxItem Content="✨ 우아한" Tag="elegant"/>
                                        <ComboBoxItem Content="🌙 다크 모드" Tag="dark"/>
                                        <ComboBoxItem Content="🌈 컬러풀" Tag="colorful"/>
                                        <ComboBoxItem Content="🏢 기업 공식" Tag="corporate"/>
                                        <ComboBoxItem Content="📰 매거진" Tag="magazine"/>
                                        <ComboBoxItem Content="📈 대시보드" Tag="dashboard"/>
                                    </ComboBox>
                                </Grid>
                            </Border>

                            <TextBlock Style="{StaticResource SectionHeader}" Text="고품질 문서"/>
                            <Border Style="{StaticResource SettingsRow}">
                                <Grid>
                                    <StackPanel HorizontalAlignment="Left">
                                        <TextBlock Style="{StaticResource RowLabel}" Text="고품질 문서 생성"/>
                                        <TextBlock Style="{StaticResource RowHint}" Text="긴 문서를 개요→섹션별 상세→조립 방식으로 작성합니다. AI 호출이 많아질 수 있습니다."/>
                                    </StackPanel>
                                    <CheckBox Style="{StaticResource ToggleSwitch}"
                                              HorizontalAlignment="Right" VerticalAlignment="Center"
                                              IsChecked="{Binding EnableMultiPassDocument, Mode=TwoWay}"/>
                                </Grid>
                            </Border>

                            <TextBlock Style="{StaticResource SectionHeader}" Text="폴더 데이터 활용"/>
                            <Border Style="{StaticResource SettingsRow}">
                                <Grid>
                                    <StackPanel HorizontalAlignment="Left">
                                        <TextBlock Style="{StaticResource RowLabel}" Text="기본 데이터 활용 수준"/>
                                        <TextBlock Style="{StaticResource RowHint}" Text="작업 폴더 내 문서/데이터를 보고서 작성에 활용하는 수준입니다."/>
                                    </StackPanel>
                                    <ComboBox HorizontalAlignment="Right" VerticalAlignment="Center"
                                              Width="180" SelectedValue="{Binding FolderDataUsage, Mode=TwoWay}"
                                              SelectedValuePath="Tag">
                                        <ComboBoxItem Content="적극 활용 (자동 탐색)" Tag="active"/>
                                        <ComboBoxItem Content="소극 활용 (요청 시)" Tag="passive"/>
                                        <ComboBoxItem Content="활용하지 않음" Tag="none"/>
                                    </ComboBox>
                                </Grid>
                            </Border>

                            <!-- ── 품질 검증 ── -->
                            <TextBlock Style="{StaticResource SectionHeader}" Text="품질 검증"/>
                            <Border Style="{StaticResource SettingsRow}">
                                <Grid>
                                    <StackPanel HorizontalAlignment="Left">
                                        <TextBlock Style="{StaticResource RowLabel}" Text="문서 생성 후 검증 강제"/>
                                        <TextBlock Style="{StaticResource RowHint}" Text="문서 생성 도구 실행 후 AI가 결과물을 자동으로 읽고 검증합니다. AI 호출이 추가됩니다."/>
                                    </StackPanel>
                                    <CheckBox Style="{StaticResource ToggleSwitch}"
                                              HorizontalAlignment="Right" VerticalAlignment="Center"
                                              IsChecked="{Binding EnableCoworkVerification, Mode=TwoWay}"/>
                                </Grid>
                            </Border>
                            <Border Style="{StaticResource SettingsRow}">
                                <Grid>
                                    <StackPanel HorizontalAlignment="Left">
                                        <TextBlock Style="{StaticResource RowLabel}" Text="파일 경로 파란색 강조"/>
                                        <TextBlock Style="{StaticResource RowHint}" Text="채팅에서 워크스페이스 내 파일/폴더 경로를 파란색으로 표시합니다."/>
                                    </StackPanel>
                                    <CheckBox Style="{StaticResource ToggleSwitch}"
                                              HorizontalAlignment="Right" VerticalAlignment="Center"
                                              IsChecked="{Binding EnableFilePathHighlight, Mode=TwoWay}"/>
                                </Grid>
                            </Border>
                        </StackPanel>
                    </ScrollViewer>

                    <!-- ══════════════════════════════════════════════════
                         코드 탭 (Code)
                         ══════════════════════════════════════════════════ -->
                    <ScrollViewer x:Name="AgentPanelCode" Grid.Row="2" Visibility="Collapsed"
                                  VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled"
                                  Padding="0,0,8,0">
                        <StackPanel>
                            <!-- ── 패키지 저장소 ── -->
                            <TextBlock Style="{StaticResource SectionHeader}" Text="패키지 저장소"/>
                            <Border Style="{StaticResource SettingsRow}">
                                <StackPanel>
                                    <TextBlock Style="{StaticResource RowLabel}" Text="사내 Nexus URL"/>
                                    <TextBlock Style="{StaticResource RowHint}" Text="사내 Nexus 저장소 기본 URL. 빈값이면 공용 저장소 사용."/>
                                    <TextBox Text="{Binding Code.NexusBaseUrl, Mode=TwoWay}" FontSize="12"
                                             Padding="6,4" Margin="0,4,0,0"/>
                                </StackPanel>
                            </Border>
                            <Border Style="{StaticResource SettingsRow}">
                                <Grid>
                                    <StackPanel HorizontalAlignment="Left">
                                        <TextBlock Style="{StaticResource RowLabel}" Text="NuGet (.NET)"/>
                                        <TextBlock Style="{StaticResource RowHint}" Text="기본: api.nuget.org"/>
                                    </StackPanel>
                                    <TextBox HorizontalAlignment="Right" VerticalAlignment="Center"
                                             Width="280" FontSize="11" Padding="4,3"
                                             Text="{Binding Code.NugetSource, Mode=TwoWay}"/>
                                </Grid>
                            </Border>
                            <Border Style="{StaticResource SettingsRow}">
                                <Grid>
                                    <StackPanel HorizontalAlignment="Left">
                                        <TextBlock Style="{StaticResource RowLabel}" Text="PyPI/Conda (Python)"/>
                                        <TextBlock Style="{StaticResource RowHint}" Text="기본: conda.anaconda.org/conda-forge"/>
                                    </StackPanel>
                                    <TextBox HorizontalAlignment="Right" VerticalAlignment="Center"
                                             Width="280" FontSize="11" Padding="4,3"
                                             Text="{Binding Code.PypiSource, Mode=TwoWay}"/>
                                </Grid>
                            </Border>
                            <Border Style="{StaticResource SettingsRow}">
                                <Grid>
                                    <StackPanel HorizontalAlignment="Left">
                                        <TextBlock Style="{StaticResource RowLabel}" Text="Maven (Java)"/>
                                        <TextBlock Style="{StaticResource RowHint}" Text="기본: repo1.maven.org/maven2"/>
                                    </StackPanel>
                                    <TextBox HorizontalAlignment="Right" VerticalAlignment="Center"
                                             Width="280" FontSize="11" Padding="4,3"
                                             Text="{Binding Code.MavenSource, Mode=TwoWay}"/>
                                </Grid>
                            </Border>
                            <Border Style="{StaticResource SettingsRow}">
                                <Grid>
                                    <StackPanel HorizontalAlignment="Left">
                                        <TextBlock Style="{StaticResource RowLabel}" Text="npm (JavaScript)"/>
                                        <TextBlock Style="{StaticResource RowHint}" Text="기본: registry.npmjs.org"/>
                                    </StackPanel>
                                    <TextBox HorizontalAlignment="Right" VerticalAlignment="Center"
                                             Width="280" FontSize="11" Padding="4,3"
                                             Text="{Binding Code.NpmSource, Mode=TwoWay}"/>
                                </Grid>
                            </Border>

                            <!-- ── IDE 설정 ── -->
                            <TextBlock Style="{StaticResource SectionHeader}" Text="IDE"/>
                            <Border Style="{StaticResource SettingsRow}">
                                <StackPanel>
                                    <TextBlock Style="{StaticResource RowLabel}" Text="선호 IDE 경로"/>
                                    <TextBlock Style="{StaticResource RowHint}" Text="빈값이면 자동 감지 (VS Code, Visual Studio 등)"/>
                                    <TextBox Text="{Binding Code.PreferredIdePath, Mode=TwoWay}" FontSize="12"
                                             Padding="6,4" Margin="0,4,0,0"/>
                                </StackPanel>
                            </Border>

                            <!-- ── 빌드 설정 ── -->
                            <TextBlock Style="{StaticResource SectionHeader}" Text="빌드 설정"/>
                            <Border Style="{StaticResource SettingsRow}">
                                <Grid>
                                    <StackPanel HorizontalAlignment="Left">
                                        <TextBlock Style="{StaticResource RowLabel}" Text="빌드 타임아웃 (초)"/>
                                        <TextBlock Style="{StaticResource RowHint}" Text="빌드/테스트 명령의 최대 실행 시간입니다. (30~300)"/>
                                    </StackPanel>
                                    <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Center">
                                        <Slider Width="120" Minimum="30" Maximum="300" TickFrequency="10"
                                                IsSnapToTickEnabled="True"
                                                Value="{Binding Code.BuildTimeout, Mode=TwoWay}"
                                                VerticalAlignment="Center"/>
                                        <TextBlock Text="{Binding Code.BuildTimeout}"
                                                   FontSize="13" FontWeight="SemiBold" Foreground="#4B5EFC"
                                                   Width="36" TextAlignment="Center" VerticalAlignment="Center"
                                                   Margin="8,0,0,0"/>
                                    </StackPanel>
                                </Grid>
                            </Border>

                            <!-- ── 코드 품질 검증 ── -->
                            <TextBlock Style="{StaticResource SectionHeader}" Text="코드 품질 검증"/>
                            <Border Style="{StaticResource SettingsRow}">
                                <Grid>
                                    <StackPanel HorizontalAlignment="Left">
                                        <TextBlock Style="{StaticResource RowLabel}" Text="코드 생성 후 검증 강제"/>
                                        <TextBlock Style="{StaticResource RowHint}" Text="코드 생성/수정 도구 실행 후 AI가 구문 오류, 참조 무결성을 자동 검증합니다."/>
                                    </StackPanel>
                                    <CheckBox Style="{StaticResource ToggleSwitch}"
                                              HorizontalAlignment="Right" VerticalAlignment="Center"
                                              IsChecked="{Binding Code.EnableCodeVerification, Mode=TwoWay}"/>
                                </Grid>
                            </Border>

                            <!-- ── 코드 인텔리전스 (v1.4.0) ── -->
                            <TextBlock Style="{StaticResource SectionHeader}" Text="코드 인텔리전스"/>
                            <Border Style="{StaticResource SettingsRow}">
                                <Grid>
                                    <StackPanel HorizontalAlignment="Left" Margin="0,0,60,0">
                                        <StackPanel Orientation="Horizontal">
                                            <TextBlock Style="{StaticResource RowLabel}" Text="LSP 코드 분석"/>
                                            <Border Width="16" Height="16" CornerRadius="8" Background="#EEF0FF" Margin="6,0,0,0" Cursor="Help" VerticalAlignment="Center">
                                                <TextBlock Text="?" FontSize="10" FontWeight="Bold" Foreground="#4B5EFC" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                                <Border.ToolTip>
                                                    <ToolTip Style="{StaticResource HelpTooltipStyle}">
                                                        <TextBlock TextWrapping="Wrap" Foreground="White" FontSize="12" LineHeight="18">
                                                            Language Server Protocol을 사용하여 AI가 코드를 더 정확하게 이해합니다.
                                                            <LineBreak/>• 심볼 정의 위치 찾기 (Goto Definition)
                                                            <LineBreak/>• 심볼이 사용된 모든 위치 검색 (Find References)
                                                            <LineBreak/>• 파일 내 클래스/메서드/필드 목록 조회
                                                            <LineBreak/><LineBreak/>지원 언어: C#, TypeScript, Python, C++, Java
                                                            <LineBreak/>해당 언어 서버가 PC에 설치되어 있어야 동작합니다.
                                                        </TextBlock>
                                                    </ToolTip>
                                                </Border.ToolTip>
                                            </Border>
                                        </StackPanel>
                                        <TextBlock Style="{StaticResource RowHint}" Text="언어 서버로 정의 이동, 참조 검색 등 코드 분석을 지원합니다"/>
                                    </StackPanel>
                                    <CheckBox Style="{StaticResource ToggleSwitch}" HorizontalAlignment="Right" VerticalAlignment="Center"
                                              IsChecked="{Binding Code.EnableLsp, Mode=TwoWay}"/>
                                </Grid>
                            </Border>
                            <Border Style="{StaticResource SettingsRow}">
                                <Grid>
                                    <StackPanel HorizontalAlignment="Left" Margin="0,0,60,0">
                                        <StackPanel Orientation="Horizontal">
                                            <TextBlock Style="{StaticResource RowLabel}" Text="코드 시맨틱 검색"/>
                                            <Border Width="16" Height="16" CornerRadius="8" Background="#EEF0FF" Margin="6,0,0,0" Cursor="Help" VerticalAlignment="Center">
                                                <TextBlock Text="?" FontSize="10" FontWeight="Bold" Foreground="#4B5EFC" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                                <Border.ToolTip>
                                                    <ToolTip Style="{StaticResource HelpTooltipStyle}">
                                                        <TextBlock TextWrapping="Wrap" Foreground="White" FontSize="12" LineHeight="18">
                                                            프로젝트 파일을 자동으로 분석하여, 자연어 질문으로 관련 코드를 찾습니다.
                                                            <LineBreak/>예: "사용자 인증 로직", "DB 연결 설정"
                                                            <LineBreak/><LineBreak/>작업 폴더 변경 시 자동으로 재인덱싱됩니다.
                                                            <LineBreak/>큰 프로젝트에서는 인덱싱에 시간이 걸릴 수 있습니다.
                                                        </TextBlock>
                                                    </ToolTip>
                                                </Border.ToolTip>
                                            </Border>
                                        </StackPanel>
                                        <TextBlock Style="{StaticResource RowHint}" Text="자연어 질문으로 관련 코드를 자동 검색합니다"/>
                                    </StackPanel>
                                    <CheckBox Style="{StaticResource ToggleSwitch}" HorizontalAlignment="Right" VerticalAlignment="Center"
                                              IsChecked="{Binding Code.EnableCodeIndex, Mode=TwoWay}"/>
                                </Grid>
                            </Border>
                            <Border Style="{StaticResource SettingsRow}">
                                <Grid>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="*"/>
                                        <ColumnDefinition Width="140"/>
                                        <ColumnDefinition Width="40"/>
                                    </Grid.ColumnDefinitions>
                                    <StackPanel Grid.Column="0" VerticalAlignment="Center">
                                        <StackPanel Orientation="Horizontal">
                                            <TextBlock Style="{StaticResource RowLabel}" Text="인덱싱 최대 파일 크기"/>
                                            <Border Width="16" Height="16" CornerRadius="8" Background="#EEF0FF" Margin="6,0,0,0" Cursor="Help" VerticalAlignment="Center">
                                                <TextBlock Text="?" FontSize="10" FontWeight="Bold" Foreground="#4B5EFC" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                                <Border.ToolTip>
                                                    <ToolTip Style="{StaticResource HelpTooltipStyle}">
                                                        <TextBlock TextWrapping="Wrap" Foreground="White" FontSize="12" LineHeight="18">
                                                            코드 시맨틱 검색 시 이 크기(KB)를 초과하는 파일은 인덱싱하지 않습니다.
                                                            <LineBreak/>큰 파일(빌드 산출물, 데이터 파일)을 제외하여 성능을 보호합니다.
                                                            <LineBreak/>일반적으로 500KB가 적정합니다.
                                                        </TextBlock>
                                                    </ToolTip>
                                                </Border.ToolTip>
                                            </Border>
                                        </StackPanel>
                                        <TextBlock Style="{StaticResource RowHint}" Text="이 크기를 초과하는 파일은 인덱싱하지 않습니다 (KB)"/>
                                    </StackPanel>
                                    <Slider Grid.Column="1" Minimum="100" Maximum="2000"
                                            Value="{Binding Code.CodeIndexMaxFileKb, Mode=TwoWay}"
                                            TickFrequency="100" IsSnapToTickEnabled="True"
                                            VerticalAlignment="Center"/>
                                    <TextBlock Grid.Column="2" Text="{Binding Code.CodeIndexMaxFileKb}"
                                               FontFamily="Consolas" FontSize="12" Foreground="#7777AA"
                                               VerticalAlignment="Center" HorizontalAlignment="Center"/>
                                </Grid>
                            </Border>
                            <Border Style="{StaticResource SettingsRow}">
                                <Grid>
                                    <StackPanel HorizontalAlignment="Left" Margin="0,0,60,0">
                                        <StackPanel Orientation="Horizontal">
                                            <TextBlock Style="{StaticResource RowLabel}" Text="diff 자동 표시"/>
                                            <Border Width="16" Height="16" CornerRadius="8" Background="#EEF0FF" Margin="6,0,0,0" Cursor="Help" VerticalAlignment="Center">
                                                <TextBlock Text="?" FontSize="10" FontWeight="Bold" Foreground="#4B5EFC" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                                <Border.ToolTip>
                                                    <ToolTip Style="{StaticResource HelpTooltipStyle}">
                                                        <TextBlock TextWrapping="Wrap" Foreground="White" FontSize="12" LineHeight="18">
                                                            AI가 파일을 수정하면 변경 전/후를 색상으로 구분하여 보여줍니다.
                                                            <LineBreak/>추가된 줄(녹색), 삭제된 줄(빨강)을 한눈에 확인하고
                                                            <LineBreak/>적용/취소 버튼으로 변경을 승인하거나 되돌릴 수 있습니다.
                                                        </TextBlock>
                                                    </ToolTip>
                                                </Border.ToolTip>
                                            </Border>
                                        </StackPanel>
                                        <TextBlock Style="{StaticResource RowHint}" Text="파일 수정 시 변경 전/후 비교를 자동으로 표시합니다"/>
                                    </StackPanel>
                                    <CheckBox Style="{StaticResource ToggleSwitch}" HorizontalAlignment="Right" VerticalAlignment="Center"
                                              IsChecked="{Binding Code.EnableAutoDiff, Mode=TwoWay}"/>
                                </Grid>
                            </Border>

                        </StackPanel>
                    </ScrollViewer>

                    <!-- ══════════════════════════════════════════════════
                         개발자 탭 (Developer)
                         ══════════════════════════════════════════════════ -->
                    <ScrollViewer x:Name="AgentPanelDev" Grid.Row="2" Visibility="Collapsed"
                                  VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled"
                                  Padding="0,0,8,0">
                        <StackPanel>
                            <!-- ── 개발자 모드 활성화 (마스터 토글) ── -->
                            <TextBlock Style="{StaticResource SectionHeader}" Text="개발자 모드"/>
                            <Border Style="{StaticResource SettingsRow}">
                                <Grid>
                                    <StackPanel HorizontalAlignment="Left" Margin="0,0,60,0">
                                        <TextBlock Style="{StaticResource RowLabel}" Text="개발자 모드 활성화"/>
                                        <TextBlock Style="{StaticResource RowHint}" Text="활성화하면 아래에 고급 설정이 표시됩니다. (비밀번호 필요)"/>
                                    </StackPanel>
                                    <CheckBox x:Name="DevModeCheckBox" Style="{StaticResource ToggleSwitch}" HorizontalAlignment="Right" VerticalAlignment="Center"
                                              IsChecked="{Binding DevMode, Mode=TwoWay}"
                                              Checked="DevModeCheckBox_Checked"
                                              Unchecked="DevModeCheckBox_Unchecked"/>
                                </Grid>
                            </Border>

                            <!-- ── 개발자 모드 활성화 시에만 보이는 영역 ── -->
                            <StackPanel x:Name="DevModeContent" Visibility="Collapsed">

                                <!-- ── 에이전트 상세 ── -->
                                <TextBlock Style="{StaticResource SectionHeader}" Text="에이전트 상세"/>
                                <Border Style="{StaticResource SettingsRow}">
                                    <Grid>
                                        <StackPanel HorizontalAlignment="Left" Margin="0,0,60,0">
                                            <TextBlock Style="{StaticResource RowLabel}" Text="스텝 바이 스텝 승인"/>
                                            <TextBlock Style="{StaticResource RowHint}" Text="각 도구 실행 전 사용자 승인을 받아야 다음 단계로 진행합니다. 성능 검증 및 디버깅 용도."/>
                                        </StackPanel>
                                        <CheckBox x:Name="StepApprovalCheckBox" Style="{StaticResource ToggleSwitch}" HorizontalAlignment="Right" VerticalAlignment="Center"
                                                  IsChecked="{Binding DevModeStepApproval, Mode=TwoWay}"
                                                  Checked="StepApprovalCheckBox_Checked"/>
                                    </Grid>
                                </Border>
                                <Border Style="{StaticResource SettingsRow}">
                                    <Grid>
                                        <StackPanel HorizontalAlignment="Left" Margin="0,0,60,0">
                                            <TextBlock Style="{StaticResource RowLabel}" Text="워크플로우 시각화"/>
                                            <TextBlock Style="{StaticResource RowHint}" Text="에이전트 실행 시 별도 창에서 실행 흐름을 실시간으로 시각화합니다."/>
                                        </StackPanel>
                                        <CheckBox Style="{StaticResource ToggleSwitch}" HorizontalAlignment="Right" VerticalAlignment="Center"
                                                  IsChecked="{Binding WorkflowVisualizer, Mode=TwoWay}"/>
                                    </Grid>
                                </Border>
                                <Border Style="{StaticResource SettingsRow}">
                                    <Grid>
                                        <StackPanel HorizontalAlignment="Left">
                                            <TextBlock Style="{StaticResource RowLabel}" Text="실행 이력 상세도"/>
                                            <TextBlock Style="{StaticResource RowHint}" Text="에이전트 실행 이력(도구 호출/결과)의 채팅창 표시 수준입니다."/>
                                        </StackPanel>
                                        <ComboBox HorizontalAlignment="Right" VerticalAlignment="Center"
                                                  Width="160" SelectedValue="{Binding AgentLogLevel, Mode=TwoWay}"
                                                  SelectedValuePath="Tag">
                                            <ComboBoxItem Content="Simple (간략)" Tag="simple"/>
                                            <ComboBoxItem Content="Detailed (상세)" Tag="detailed"/>
                                            <ComboBoxItem Content="Debug (디버그)" Tag="debug"/>
                                        </ComboBox>
                                    </Grid>
                                </Border>

                                <!-- ── 호출 제한 및 통계 ── -->
                                <TextBlock Style="{StaticResource SectionHeader}" Text="호출 제한 및 통계"/>
                                <Border Style="{StaticResource SettingsRow}">
                                    <Grid>
                                        <StackPanel HorizontalAlignment="Left" Margin="0,0,60,0">
                                            <TextBlock Style="{StaticResource RowLabel}" Text="무료 티어 호출 제한"/>
                                            <TextBlock Style="{StaticResource RowHint}" Text="Gemini 무료 등 RPM 제한이 있는 서비스 사용 시 LLM 호출 간 딜레이를 자동 추가합니다."/>
                                        </StackPanel>
                                        <CheckBox Style="{StaticResource ToggleSwitch}" HorizontalAlignment="Right" VerticalAlignment="Center"
                                                  IsChecked="{Binding FreeTierMode, Mode=TwoWay}"/>
                                    </Grid>
                                </Border>
                                <Border Style="{StaticResource SettingsRow}">
                                    <Grid>
                                        <StackPanel HorizontalAlignment="Left" Margin="0,0,60,0">
                                            <TextBlock Style="{StaticResource RowLabel}" Text="호출 간 딜레이 (초)"/>
                                            <TextBlock Style="{StaticResource RowHint}" Text="무료 티어 모드에서 LLM 호출 사이에 대기할 시간. Gemini 무료는 15 RPM → 4초 권장."/>
                                        </StackPanel>
                                        <TextBox HorizontalAlignment="Right" VerticalAlignment="Center"
                                                 Width="60" TextAlignment="Center"
                                                 Text="{Binding FreeTierDelaySeconds, Mode=TwoWay}"
                                                 Style="{StaticResource ModernTextBox}"/>
                                    </Grid>
                                </Border>
                                <Border Style="{StaticResource SettingsRow}">
                                    <Grid>
                                        <StackPanel HorizontalAlignment="Left" Margin="0,0,60,0">
                                            <TextBlock Style="{StaticResource RowLabel}" Text="전체 호출·토큰 합계 표시"/>
                                            <TextBlock Style="{StaticResource RowHint}" Text="활성화하면 에이전트 완료 시 전체 LLM 호출 횟수와 누적 토큰량을 별도 색상으로 표시합니다."/>
                                        </StackPanel>
                                        <CheckBox Style="{StaticResource ToggleSwitch}" HorizontalAlignment="Right" VerticalAlignment="Center"
                                                  IsChecked="{Binding ShowTotalCallStats, Mode=TwoWay}"/>
                                    </Grid>
                                </Border>

                                <!-- ── 보안 ── -->
                                <TextBlock Style="{StaticResource SectionHeader}" Text="보안"/>
                                <Border Style="{StaticResource SettingsRow}">
                                    <Grid>
                                        <StackPanel HorizontalAlignment="Left" Margin="0,0,60,0">
                                            <StackPanel Orientation="Horizontal">
                                                <TextBlock Style="{StaticResource RowLabel}" Text="감사 로그"/>
                                                <Border Width="16" Height="16" CornerRadius="8" Background="#EEF0FF" Margin="6,0,0,0" Cursor="Help" VerticalAlignment="Center">
                                                    <TextBlock Text="?" FontSize="10" FontWeight="Bold" Foreground="#4B5EFC" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                                    <Border.ToolTip>
                                                        <ToolTip Style="{StaticResource HelpTooltipStyle}">
                                                            <TextBlock TextWrapping="Wrap" Foreground="White" FontSize="12" LineHeight="18">
                                                                AI가 파일 읽기/쓰기, 명령 실행 등 도구를 사용한 이력을 날짜별 JSON 파일로 기록합니다.
                                                                <LineBreak/>30일이 지난 로그는 자동 삭제됩니다.
                                                            </TextBlock>
                                                        </ToolTip>
                                                    </Border.ToolTip>
                                                </Border>
                                            </StackPanel>
                                            <TextBlock Style="{StaticResource RowHint}" Text="에이전트 도구 호출 이력을 로컬에 기록합니다. 보안 감사 및 디버깅 용도. (기본: 켜짐)"/>
                                        </StackPanel>
                                        <CheckBox Style="{StaticResource ToggleSwitch}" HorizontalAlignment="Right" VerticalAlignment="Center"
                                                  IsChecked="{Binding EnableAuditLog, Mode=TwoWay}"/>
                                    </Grid>
                                </Border>
                                <Border Style="{StaticResource SettingsRow}">
                                    <Grid>
                                        <StackPanel HorizontalAlignment="Left" Margin="0,0,60,0">
                                            <TextBlock Style="{StaticResource RowLabel}" Text="감사 로그 보기"/>
                                            <TextBlock Style="{StaticResource RowHint}" Text="에이전트 도구 호출 이력이 저장된 폴더를 엽니다."/>
                                        </StackPanel>
                                        <Button HorizontalAlignment="Right" VerticalAlignment="Center"
                                                Click="BtnOpenAuditLog_Click" Padding="12,6" Cursor="Hand"
                                                Background="Transparent" BorderBrush="{DynamicResource BorderColor}"
                                                BorderThickness="1" Foreground="{DynamicResource PrimaryText}">
                                            <TextBlock Text="폴더 열기" FontSize="12"/>
                                        </Button>
                                    </Grid>
                                </Border>

                                <!-- ── 에이전트 고급 ── -->
                                <TextBlock Style="{StaticResource SectionHeader}" Text="에이전트 고급"/>
                                <Border Style="{StaticResource SettingsRow}">
                                    <Grid>
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="*"/>
                                            <ColumnDefinition Width="120"/>
                                            <ColumnDefinition Width="30"/>
                                        </Grid.ColumnDefinitions>
                                        <StackPanel Grid.Column="0" VerticalAlignment="Center">
                                            <StackPanel Orientation="Horizontal">
                                                <TextBlock Style="{StaticResource RowLabel}" Text="서브에이전트 최대 수"/>
                                                <Border Width="16" Height="16" CornerRadius="8" Background="#EEF0FF" Margin="6,0,0,0" Cursor="Help" VerticalAlignment="Center">
                                                    <TextBlock Text="?" FontSize="10" FontWeight="Bold" Foreground="#4B5EFC" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                                    <Border.ToolTip>
                                                        <ToolTip Style="{StaticResource HelpTooltipStyle}">
                                                            <TextBlock TextWrapping="Wrap" Foreground="White" FontSize="12" LineHeight="18">
                                                                AI가 큰 작업을 여러 개의 작은 작업으로 나누어 동시에 실행할 수 있습니다.
                                                                <LineBreak/>이 값은 동시에 실행할 수 있는 최대 작업 수를 제한합니다.
                                                                <LineBreak/><LineBreak/>값이 클수록 빠르지만 CPU/메모리 사용량이 증가합니다.
                                                            </TextBlock>
                                                        </ToolTip>
                                                    </Border.ToolTip>
                                                </Border>
                                            </StackPanel>
                                            <TextBlock Style="{StaticResource RowHint}" Text="동시 실행 제한 (CPU/메모리 보호)"/>
                                        </StackPanel>
                                        <Slider Grid.Column="1" Minimum="1" Maximum="10"
                                                Value="{Binding MaxSubAgents, Mode=TwoWay}"
                                                TickFrequency="1" IsSnapToTickEnabled="True"
                                                VerticalAlignment="Center"/>
                                        <TextBlock Grid.Column="2" Text="{Binding MaxSubAgents}"
                                                   FontFamily="Consolas" FontSize="13" FontWeight="SemiBold"
                                                   Foreground="#4B5EFC" VerticalAlignment="Center"
                                                   HorizontalAlignment="Center"/>
                                    </Grid>
                                </Border>

                                <!-- ── 모델 폴백 ── -->
                                <TextBlock Style="{StaticResource SectionHeader}" Text="모델 폴백"/>
                                <Border Style="{StaticResource SettingsRow}">
                                    <StackPanel>
                                        <StackPanel Orientation="Horizontal">
                                            <TextBlock Style="{StaticResource RowLabel}" Text="폴백 모델 목록"/>
                                            <Border Width="16" Height="16" CornerRadius="8" Background="#EEF0FF" Margin="6,0,0,0" Cursor="Help" VerticalAlignment="Center">
                                                <TextBlock Text="?" FontSize="10" FontWeight="Bold" Foreground="#4B5EFC" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                                <Border.ToolTip>
                                                    <ToolTip Style="{StaticResource HelpTooltipStyle}">
                                                        <TextBlock TextWrapping="Wrap" Foreground="White" FontSize="12" LineHeight="18">
                                                            현재 사용 중인 AI 모델이 응답하지 않을 때, 여기서 선택한 모델을 순서대로 시도합니다.
                                                            <LineBreak/><LineBreak/>여러 모델을 켜두면 안정성이 높아집니다.
                                                        </TextBlock>
                                                    </ToolTip>
                                                </Border.ToolTip>
                                            </Border>
                                        </StackPanel>
                                        <TextBlock Style="{StaticResource RowHint}" Text="API 실패 시 순차 시도할 모델을 선택하세요."/>
                                        <StackPanel x:Name="FallbackModelsPanel" Margin="0,8,0,0"/>
                                        <TextBox x:Name="FallbackModelsBox" Visibility="Collapsed"/>
                                    </StackPanel>
                                </Border>

                                <!-- ── MCP 서버 ── -->
                                <TextBlock Style="{StaticResource SectionHeader}" Text="MCP 서버"/>
                                <Border Style="{StaticResource SettingsRow}">
                                    <Grid>
                                        <StackPanel HorizontalAlignment="Left">
                                            <StackPanel Orientation="Horizontal">
                                                <TextBlock Style="{StaticResource RowLabel}" Text="MCP 서버 관리"/>
                                                <Border Width="16" Height="16" CornerRadius="8" Background="#EEF0FF" Margin="6,0,0,0" Cursor="Help" VerticalAlignment="Center">
                                                    <TextBlock Text="?" FontSize="10" FontWeight="Bold" Foreground="#4B5EFC" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                                    <Border.ToolTip>
                                                        <ToolTip Style="{StaticResource HelpTooltipStyle}">
                                                            <TextBlock TextWrapping="Wrap" Foreground="White" FontSize="12" LineHeight="18">
                                                                외부 도구 서버를 연결하여 AI가 다양한 작업을 수행할 수 있게 합니다.
                                                                <LineBreak/>예: DB 조회, Jira 이슈 관리, Slack 메시지 등
                                                            </TextBlock>
                                                        </ToolTip>
                                                    </Border.ToolTip>
                                                </Border>
                                            </StackPanel>
                                            <TextBlock Style="{StaticResource RowHint}" Text="외부 MCP 서버를 등록하면 에이전트가 해당 도구를 사용할 수 있습니다."/>
                                        </StackPanel>
                                        <Button HorizontalAlignment="Right" VerticalAlignment="Center"
                                                Content="+ 서버 추가" Padding="12,6" Cursor="Hand"
                                                Click="BtnAddMcpServer_Click"/>
                                    </Grid>
                                </Border>
                                <StackPanel x:Name="McpServerListPanel" Margin="0,2,0,8"/>
                                <Border Style="{StaticResource SettingsRow}" Margin="0,0,0,0">
                                    <Expander Header="JSON 편집 (고급)" FontSize="12" Foreground="{DynamicResource SecondaryText}">
                                        <StackPanel Margin="0,8,0,0">
                                            <TextBox x:Name="McpServersBox" FontSize="11.5" Padding="8,6"
                                                     FontFamily="Consolas, Malgun Gothic"
                                                     AcceptsReturn="True" TextWrapping="Wrap" MinHeight="60" MaxHeight="140"
                                                     VerticalScrollBarVisibility="Auto"
                                                     Foreground="{DynamicResource PrimaryText}"
                                                     Background="{DynamicResource ItemBackground}"
                                                     BorderBrush="{DynamicResource BorderColor}"/>
                                        </StackPanel>
                                    </Expander>
                                </Border>

                            </StackPanel>
                        </StackPanel>
                    </ScrollViewer>

                    <!-- ═══ 기타 서브탭 (차단 경로/확장자 — 공통에서 런타임 이동) ═══ -->
                    <ScrollViewer x:Name="AgentPanelEtc" Grid.Row="2" Visibility="Collapsed"
                                  VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled"
                                  Padding="0,0,8,0">
                        <StackPanel x:Name="AgentEtcContent"/>
                    </ScrollViewer>

                    <!-- ═══ 도구 관리 서브탭 ═══ -->
                    <ScrollViewer x:Name="AgentPanelTools" Grid.Row="2" Visibility="Collapsed"
                                  VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled"
                                  Padding="0,0,8,0">
                        <StackPanel>
                            <TextBlock Style="{StaticResource SectionHeader}" Text="에이전트 도구 관리"/>
                            <TextBlock FontSize="12" Foreground="{DynamicResource SecondaryText}" Margin="0,0,0,12"
                                       TextWrapping="Wrap"
                                       Text="AI에 노출할 도구를 선택합니다. 비활성화된 도구는 LLM에 전달되지 않습니다."/>
                            <StackPanel x:Name="ToolCardsPanel"/>
                            <TextBlock Style="{StaticResource SectionHeader}" Text="MCP 서버" Margin="0,16,0,0"/>
                            <TextBlock FontSize="12" Foreground="{DynamicResource SecondaryText}" Margin="0,0,0,12"
                                       TextWrapping="Wrap"
                                       Text="연결된 외부 도구 서버의 상태를 확인합니다."/>
                            <StackPanel x:Name="McpStatusPanel"/>
                        </StackPanel>
                    </ScrollViewer>

                </Grid>
            </TabItem>

            <!-- ═══════════════════════════════════════════════════════════════ -->
            <!-- Phase 18-C1: 플러그인 갤러리 탭                                 -->
            <!-- ═══════════════════════════════════════════════════════════════ -->
            <TabItem Header="플러그인" Tag="&#xE74C;" Style="{StaticResource SideNavItem}">
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="*"/>
                        <RowDefinition Height="Auto"/>
                    </Grid.RowDefinitions>

                    <!-- 헤더 -->
                    <StackPanel Grid.Row="0" Margin="24,20,24,12">
                        <TextBlock Text="플러그인 관리" FontSize="16" FontWeight="SemiBold"
                                   Foreground="{DynamicResource PrimaryText}"/>
                        <TextBlock Text="로컬 zip 파일로 스킬·도구·테마 플러그인을 설치합니다."
                                   FontSize="12" Foreground="{DynamicResource SecondaryText}"
                                   Margin="0,4,0,0" TextWrapping="Wrap"/>
                    </StackPanel>

                    <!-- 플러그인 목록 -->
                    <ScrollViewer Grid.Row="1" VerticalScrollBarVisibility="Auto" Margin="24,0,24,0">
                        <StackPanel x:Name="PluginListPanel" Margin="0,0,0,12"/>
                    </ScrollViewer>

                    <!-- 하단 설치 버튼 -->
                    <Border Grid.Row="2" Margin="24,8,24,16">
                        <StackPanel Orientation="Horizontal" HorizontalAlignment="Left">
                            <Border x:Name="BtnInstallPlugin" CornerRadius="8" Padding="16,8"
                                    Background="{DynamicResource AccentColor}" Cursor="Hand"
                                    MouseLeftButtonUp="BtnInstallPlugin_Click">
                                <StackPanel Orientation="Horizontal">
                                    <TextBlock Text="&#xE710;" FontFamily="Segoe MDL2 Assets" FontSize="13"
                                               Foreground="White" VerticalAlignment="Center" Margin="0,0,6,0"/>
                                    <TextBlock Text="zip에서 설치" FontSize="13" Foreground="White"
                                               FontWeight="SemiBold" VerticalAlignment="Center"/>
                                </StackPanel>
                            </Border>
                            <Border x:Name="BtnRefreshPlugins" CornerRadius="8" Padding="12,8"
                                    Background="{DynamicResource ItemBackground}" Cursor="Hand"
                                    Margin="8,0,0,0" MouseLeftButtonUp="BtnRefreshPlugins_Click">
                                <StackPanel Orientation="Horizontal">
                                    <TextBlock Text="&#xE72C;" FontFamily="Segoe MDL2 Assets" FontSize="13"
                                               Foreground="{DynamicResource PrimaryText}" VerticalAlignment="Center" Margin="0,0,6,0"/>
                                    <TextBlock Text="새로고침" FontSize="13"
                                               Foreground="{DynamicResource PrimaryText}" VerticalAlignment="Center"/>
                                </StackPanel>
                            </Border>
                            <TextBlock x:Name="PluginStatusText" Text="" FontSize="11"
                                       Foreground="{DynamicResource SecondaryText}"
                                       VerticalAlignment="Center" Margin="16,0,0,0"/>
                        </StackPanel>
                    </Border>
                </Grid>
            </TabItem>

        </TabControl>

        <!-- ═════════════════════════════════════════════════════════════════ -->
        <!-- 하단 버튼 바                                                       -->
        <!-- ═════════════════════════════════════════════════════════════════ -->
        <Border Grid.Row="1" Background="White"
                BorderBrush="#EAEAF0" BorderThickness="0,1,0,0"
                Padding="20,12">
            <Grid>
                <!-- 버전 + 내보내기/불러오기 -->
                <StackPanel Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Center">
                    <TextBlock Text="&#xE700;" FontFamily="Segoe MDL2 Assets" FontSize="11"
                               Foreground="#AAAACC" VerticalAlignment="Center" Margin="0,0,6,0"/>
                    <!-- 버전 텍스트: AxCopilot.csproj <Version> 태그에서 자동으로 읽어옵니다.
                         버전을 변경할 때는 반드시 AxCopilot.csproj → <Version> 값만 수정하세요.
                         이 TextBlock의 Text는 SettingsWindow.xaml.cs → SetVersionText()에서 설정됩니다. -->
                    <TextBlock x:Name="VersionInfoText"
                               FontSize="11" Foreground="#BBBBCC" VerticalAlignment="Center"
                               Margin="0,0,16,0"/>
                    <Button Content="내보내기" Style="{StaticResource SecondaryButton}"
                            Click="ExportSettings_Click" Margin="0,0,4,0"
                            FontSize="10" Padding="8,3"/>
                    <Button Content="불러오기" Style="{StaticResource SecondaryButton}"
                            Click="ImportSettings_Click"
                            FontSize="10" Padding="8,3"/>
                </StackPanel>
                <!-- 저장 / 취소 -->
                <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
                    <Button Content="취소" Style="{StaticResource SecondaryButton}"
                            Margin="0,0,8,0" Click="Cancel_Click"/>
                    <Button Style="{StaticResource PrimaryButton}" Click="Save_Click">
                        <StackPanel Orientation="Horizontal">
                            <TextBlock Text="&#xE74E;" FontFamily="Segoe MDL2 Assets"
                                       FontSize="13" Margin="0,0,6,0" VerticalAlignment="Center"/>
                            <TextBlock Text="저장" VerticalAlignment="Center"/>
                        </StackPanel>
                    </Button>
                </StackPanel>
            </Grid>
        </Border>

    </Grid>
</Window>
