/* Base */
/* ============================================
   Design Tokens
   ============================================ */
:root {
    /* Spacing Scale */
    --space-1: 0.25rem;   /* 4px */
    --space-2: 0.5rem;    /* 8px */
    --space-3: 0.75rem;   /* 12px */
    --space-4: 1rem;      /* 16px */
    --space-5: 1.5rem;    /* 24px */
    --space-6: 2rem;      /* 32px */
    --space-7: 3rem;      /* 48px */
    --space-8: 4rem;      /* 64px */

    /* Type Scale */
    --text-2xs: 0.625rem;  /* 10px */
    --text-xs: 0.75rem;    /* 12px */
    --text-sm: 0.875rem;   /* 14px */
    --text-base: 1rem;     /* 16px */
    --text-lg: 1.125rem;   /* 18px */
    --text-xl: 1.25rem;    /* 20px */
    --text-2xl: 1.5rem;    /* 24px */
    --text-3xl: 1.75rem;   /* 28px */
    --text-4xl: 2rem;      /* 32px */
    --text-display: 5rem;  /* 80px - for hero/error displays */

    /* Border Radius Scale */
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
    --radius-xl: 12px;
    --radius-full: 9999px;

    /* Z-Index Scale */
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-overlay: 900;
    --z-modal: 1000;
    --z-toast: 1100;

    /* Transition Tokens */
    --duration-fast: 0.1s;
    --duration-normal: 0.15s;
    --duration-slow: 0.2s;
    --ease-default: ease;
    --ease-out: ease-out;

    /* Focus Ring */
    --focus-ring: 2px solid var(--accent);
    --focus-ring-offset: 2px;

    /* Breakpoints (reference only - CSS custom properties cannot be used in media queries)
       Use these values directly in @media rules for consistency:
       --breakpoint-xs: 480px;
       --breakpoint-sm: 640px;
       --breakpoint-md: 768px;
       --breakpoint-lg: 1024px;
       --breakpoint-xl: 1280px;
    */
}
/* ============================================
   Light Theme (Default)
   WCAG AA Compliant - 4.5:1 minimum for text
   ============================================ */
:root {
    --bg: #f5f4f2;
    --surface: #ffffff;
    --surface-raised: #ffffff;
    --text: #1a1a1a;
    --text-secondary: #525252;
    --text-muted: #6b6b6b;
    --border: #e0e0e0;
    --accent: #b5412c;
    --accent-hover: #9a3625;
    --selected: #f0eeeb;
    --note-bg: #fef9e7;
    --note-border: #f5e6a3;
    --success: #15803d;
    --danger: #dc2626;
    --danger-hover: #b91c1c;
    --warning: #d97706;
    --error: #dc2626;
    --skeleton: #e8e8e8;
    --skeleton-shine: #f5f5f5;
    --overlay-bg: rgba(0, 0, 0, 0.5);
    --surface-alpha: rgba(255, 255, 255, 0.6);
    --border-subtle: #f0f0f0;
    --info: #2563eb;
    --danger-rgb: 220, 38, 38;
    --accent-bg: color-mix(in srgb, var(--accent) 10%, transparent);
    --success-bg: color-mix(in srgb, var(--success) 12%, transparent);
    --warning-bg: color-mix(in srgb, var(--warning) 12%, transparent);
    --danger-bg: color-mix(in srgb, var(--danger) 10%, transparent);
    --info-bg: color-mix(in srgb, var(--info) 10%, transparent);
    --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}
/* ============================================
   Dark Theme
   WCAG AA Compliant - 4.5:1 minimum for text
   ============================================ */
[data-theme="dark"] {
    --bg: #141414;
    --surface: #1c1c1c;
    --surface-raised: #262626;
    --text: #ebebeb;
    --text-secondary: #a8a8a8;
    --text-muted: #8f8f8f;
    --border: #333333;
    --accent: #e87461;
    --accent-hover: #d65d4a;
    --selected: #2a2a2a;
    --note-bg: #2e2a1b;
    --note-border: #3d3520;
    --success: #22c55e;
    --danger: #ef4444;
    --danger-hover: #dc2626;
    --warning: #f59e0b;
    --error: #ef4444;
    --skeleton: #2a2a2a;
    --skeleton-shine: #3a3a3a;
    --overlay-bg: rgba(0, 0, 0, 0.6);
    --surface-alpha: rgba(0, 0, 0, 0.4);
    --border-subtle: #262626;
    --info: #60a5fa;
    --danger-rgb: 239, 68, 68;
    --accent-bg: color-mix(in srgb, var(--accent) 15%, transparent);
    --success-bg: color-mix(in srgb, var(--success) 15%, transparent);
    --warning-bg: color-mix(in srgb, var(--warning) 15%, transparent);
    --danger-bg: color-mix(in srgb, var(--danger) 15%, transparent);
    --info-bg: color-mix(in srgb, var(--info) 15%, transparent);
}
/* ============================================
   Global Focus Styles (Accessibility)
   ============================================ */
:focus-visible {
    outline: var(--focus-ring);
    outline-offset: var(--focus-ring-offset);
}
:focus:not(:focus-visible) {
    outline: none;
}
.message--note .message-body {
    color: var(--text);
}
body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.5;
}
body.app-body {
    height: 100vh;
    overflow: hidden;
}
body.page-body {
    min-height: 100vh;
}
body.centered-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}
a {
    color: var(--accent);
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}
@keyframes conversation-highlight-fade {
    0% { background-color: var(--note-bg); }
    100% { background-color: transparent; }
}
.conversation-highlight {
    animation: conversation-highlight-fade 3s ease-out forwards;
}
@keyframes shimmer {
    0% { background-position: -200px 0; }
    100% { background-position: calc(200px + 100%) 0; }
}
@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes slide-up {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--accent);
    color: white;
    padding: var(--space-2) var(--space-4);
    font-size: var(--text-sm);
    font-weight: 500;
    text-decoration: none;
    z-index: 10000;
    border-radius: 0 0 var(--radius-md) 0;
    transition: top var(--duration-fast) var(--ease-default);
}
.skip-link:focus {
    top: 0;
    outline: none;
}
/* ============================================
   Page Transitions for Turbo
   ============================================ */
.turbo-progress-bar {
    height: 2px;
    background: var(--accent);
}
html.turbo-loading body {
    pointer-events: none;
}
html.turbo-loading .main-area,
html.turbo-loading .settings-main,
html.turbo-loading .page-content {
    opacity: 0.7;
    transition: opacity 0.15s var(--ease-default);
}
[data-turbo-preview] .main-area,
[data-turbo-preview] .settings-main,
[data-turbo-preview] .page-content {
    opacity: 0.7;
}
@keyframes page-enter {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.page-transition-enter {
    animation: page-enter 0.2s var(--ease-out) forwards;
}
/* Layout */
.app-layout {
    display: flex;
    height: 100vh;
}
.main-area {
    flex: 1;
    display: flex;
    min-width: 0;
    background: var(--surface);
}
.main-area.overflow-auto {
    overflow-y: auto;
}
.page-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: var(--space-3) 0;
    position: sticky;
    top: 0;
    z-index: var(--z-dropdown);
}
.header-inner {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 var(--space-5);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.header-inner.narrow {
    max-width: 700px;
}
.header-left {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}
.header-title {
    font-weight: 600;
    font-size: var(--text-sm);
}
.back-link {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    color: var(--text-secondary);
    font-size: var(--text-sm);
}
.back-link:hover {
    color: var(--text);
    text-decoration: none;
}
.back-link:focus-visible {
    outline: var(--focus-ring);
    outline-offset: var(--focus-ring-offset);
}
.page-content {
    max-width: 900px;
    margin: 0 auto;
    padding: var(--space-6) var(--space-5);
}
.page-content.narrow {
    max-width: 600px;
    padding: var(--space-5) var(--space-5) var(--space-7);
}
.page-content.full {
    max-width: none;
}
.page-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-5);
}
.page-title h1 {
    font-size: var(--text-xl);
    font-weight: 600;
    margin: 0;
}
.page-title.larger h1 {
    font-size: var(--text-2xl);
}
/* Components */
/* ============================================
   Button System
   Styling Bootstrap button classes with our design tokens
   ============================================ */
/* Primary button - uses our accent color */
.btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}
.btn-primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    color: white;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.btn-primary:active {
    transform: translateY(0);
    box-shadow: none;
}
.btn-primary:focus-visible {
    outline: var(--focus-ring);
    outline-offset: var(--focus-ring-offset);
}
/* Outline secondary - neutral bordered button */
.btn-outline-secondary {
    color: var(--text-secondary);
    border-color: var(--border);
    background: transparent;
}
.btn-outline-secondary:hover,
.btn-outline-secondary:focus {
    color: var(--text);
    background: var(--surface-raised);
    border-color: var(--border);
}
.btn-outline-secondary:active,
.btn-outline-secondary.active,
.btn-outline-secondary.show {
    color: var(--text);
    background: var(--selected);
    border-color: var(--border);
}
.btn-outline-secondary:focus-visible {
    outline: var(--focus-ring);
    outline-offset: var(--focus-ring-offset);
}
.btn-outline-secondary:disabled,
.btn-outline-secondary.disabled {
    color: var(--text-muted);
    border-color: var(--border);
    background: transparent;
}
/* Ghost button - minimal style */
.btn-ghost {
    background: transparent;
    border-color: transparent;
    color: var(--text-secondary);
    padding-left: var(--space-2);
    padding-right: var(--space-2);
}
.btn-ghost:hover {
    background: var(--bg);
    color: var(--text);
    text-decoration: none;
}
.btn-ghost:focus-visible {
    outline: var(--focus-ring);
    outline-offset: var(--focus-ring-offset);
}
/* Ghost danger modifier */
.btn-ghost--danger {
    color: var(--danger);
}
.btn-ghost--danger:hover {
    background: var(--bg);
    color: var(--danger-hover);
    text-decoration: none;
}
/* Link button modifiers */
.btn-link--muted {
    color: var(--text-muted);
    font-size: var(--text-xs);
    padding: 0;
    background: none;
    border: none;
    cursor: pointer;
}
.btn-link--muted:hover {
    color: var(--text);
}
.btn-link--muted:focus-visible {
    outline: var(--focus-ring);
    outline-offset: var(--focus-ring-offset);
}
.btn-link--danger {
    color: var(--danger);
    font-size: var(--text-xs);
    padding: 0;
    background: none;
    border: none;
    cursor: pointer;
}
.btn-link--danger:hover {
    color: var(--danger-hover);
}
.btn-link--danger:focus-visible {
    outline: var(--focus-ring);
    outline-offset: var(--focus-ring-offset);
}
/* ============================================
   Form Components
   ============================================ */
.form-group {
    margin-bottom: var(--space-4);
}
.form-group:last-of-type {
    margin-bottom: var(--space-5);
}
.form-row {
    margin-bottom: var(--space-4);
}
.form-row:last-child {
    margin-bottom: 0;
}
.form-row.flex {
    display: flex;
    gap: var(--space-3);
}
.form-row-inline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-2) 0;
    border-bottom: 1px solid var(--border);
}
.form-row-inline:last-child {
    border-bottom: none;
}
.form-label {
    display: block;
    font-size: var(--text-xs);
    font-weight: 500;
    margin-bottom: var(--space-1);
}
.form-label.small {
    font-size: var(--text-xs);
    color: var(--text-muted);
}
.form-hint {
    font-size: var(--text-xs);
    color: var(--text-muted);
    margin-top: var(--space-1);
}
.form-error {
    font-size: var(--text-xs);
    color: var(--error);
    margin-top: var(--space-1);
}
/* ============================================
   Form Controls
   ============================================ */
.form-control {
    width: 100%;
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    background-color: var(--surface);
    color: var(--text);
    transition: border-color var(--duration-normal) var(--ease-default),
                box-shadow var(--duration-normal) var(--ease-default);
}
.form-control:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent);
}
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-4px); }
    40% { transform: translateX(4px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}
.form-control.is-invalid {
    border-color: var(--error);
}
.form-control.is-invalid.shake {
    animation: shake 0.4s ease-in-out;
}
.form-control.is-invalid:focus {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--error) 15%, transparent);
}
.form-control.small {
    font-size: var(--text-xs);
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-sm);
}
.form-control::-moz-placeholder {
    color: var(--text-muted);
}
.form-control::placeholder {
    color: var(--text-muted);
}
/* ============================================
   Form Check (Toggles/Checkboxes)
   ============================================ */
.form-check-input {
    cursor: pointer;
}
.form-check-input:checked {
    background-color: var(--accent);
    border-color: var(--accent);
}
.form-check-input:focus {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent);
    border-color: var(--accent);
}
.form-check-input:focus-visible {
    outline: var(--focus-ring);
    outline-offset: var(--focus-ring-offset);
}
/* ============================================
   Form Row Labels
   ============================================ */
.form-row-label {
    font-size: var(--text-xs);
}
.form-row-desc {
    font-size: var(--text-xs);
    color: var(--text-muted);
}
/* ============================================
   Form Select
   ============================================ */
.form-select {
    width: 100%;
    padding: var(--space-2) 2.25rem var(--space-2) var(--space-3);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: var(--text-sm);
    background-color: var(--surface);
    color: var(--text);
    cursor: pointer;
    transition: border-color var(--duration-normal) var(--ease-default),
                box-shadow var(--duration-normal) var(--ease-default);
}
.form-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent);
}
/* ============================================
   Password Strength Indicator
   ============================================ */
.password-strength {
    display: flex;
    gap: var(--space-1);
    margin-top: var(--space-2);
}
.strength-bar {
    flex: 1;
    height: 3px;
    background: var(--border);
    border-radius: 2px;
}
.strength-bar--active {
    background: var(--error);
}
.strength-bar--medium {
    background: var(--warning);
}
.strength-bar--strong {
    background: var(--success);
}
/* ============================================
   Unsaved Changes Indicator
   ============================================ */
.form-unsaved-indicator {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-xs);
    color: var(--warning);
}
.form-unsaved-indicator::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--warning);
    border-radius: 50%;
}
.btn.has-unsaved-changes::after {
    content: '';
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    background: var(--warning);
    border-radius: 50%;
    border: 2px solid var(--surface);
}
.btn.has-unsaved-changes {
    position: relative;
}
/* ============================================
   Form Success State
   ============================================ */
@keyframes checkmark-draw {
    0% { stroke-dashoffset: 24; }
    100% { stroke-dashoffset: 0; }
}
.form-success-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: var(--success);
    border-radius: 50%;
    color: white;
}
.form-success-icon svg {
    width: 12px;
    height: 12px;
}
.form-success-icon.animate svg path {
    stroke-dasharray: 24;
    stroke-dashoffset: 24;
    animation: checkmark-draw 0.3s ease forwards;
}
/* ============================================
   Modal Components
   Overrides for Bootstrap modals
   ============================================ */
.modal-header {
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--border);
}
.modal-header h3,
.modal-header .modal-title {
    font-size: var(--text-sm);
    font-weight: 600;
    margin: 0;
}
.modal-body {
    padding: var(--space-5);
}
.modal-footer {
    padding: var(--space-4) var(--space-5);
    border-top: 1px solid var(--border);
    background: var(--bg);
}
/* Smaller buttons in modal footer */
.modal-footer .btn {
    font-size: var(--text-xs);
    padding: var(--space-2) var(--space-4);
}
.toast-container {
    position: fixed;
    bottom: var(--space-5);
    right: var(--space-5);
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}
.toast {
    display: flex !important;
    background: var(--text);
    color: white;
    padding: var(--space-3) var(--space-5);
    border-radius: var(--radius-lg);
    font-size: var(--text-sm);
    box-shadow: 0 4px 20px var(--overlay-bg);
    align-items: center;
    gap: var(--space-3);
    max-width: 320px;
    animation: toast-in 0.3s var(--ease-out) forwards;
    opacity: 1;
}
@keyframes toast-in {
    from {
        transform: translateX(120%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
.toast--hiding {
    animation: toast-out 0.3s var(--ease-out) forwards;
    margin-top: calc(-1 * var(--space-2));
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    overflow: hidden;
    transition: max-height 0.3s var(--ease-out),
                padding 0.3s var(--ease-out),
                margin 0.3s var(--ease-out);
}
@keyframes toast-out {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(120%);
        opacity: 0;
    }
}
.toast-icon {
    flex-shrink: 0;
}
.toast-icon--success {
    color: var(--success);
}
.toast--error {
    background: var(--error);
}
.toast--error .toast-icon {
    color: white;
}
.toast--warning {
    background: #f59e0b;
}
.toast--warning .toast-icon {
    color: white;
}
.toast--info {
    background: var(--accent);
}
.toast--info .toast-icon {
    color: white;
}
.toast-dismiss {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    padding: 0;
    margin-left: auto;
}
.toast-dismiss:hover {
    color: white;
}
.toast-dismiss:focus-visible {
    outline: var(--focus-ring);
    outline-offset: var(--focus-ring-offset);
}
.toast-action {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    cursor: pointer;
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-sm);
    font-size: var(--text-xs);
    font-weight: 500;
    margin-left: var(--space-2);
}
.toast-action:hover {
    background: rgba(255, 255, 255, 0.3);
}
.toast-action:focus-visible {
    outline: var(--focus-ring);
    outline-offset: var(--focus-ring-offset);
}
[data-theme="dark"] .toast {
    background: var(--surface-raised);
    color: var(--text);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}
[data-theme="dark"] .toast-dismiss {
    color: var(--text-muted);
}
[data-theme="dark"] .toast-dismiss:hover {
    color: var(--text);
}
[data-theme="dark"] .toast-action {
    background: rgba(255, 255, 255, 0.1);
}
[data-theme="dark"] .toast-action:hover {
    background: rgba(255, 255, 255, 0.15);
}
[data-theme="dark"] .toast--error {
    box-shadow: inset 3px 0 0 var(--error), 0 4px 20px rgba(0, 0, 0, 0.4);
}
[data-theme="dark"] .toast--error .toast-icon {
    color: var(--error);
}
[data-theme="dark"] .toast--warning {
    box-shadow: inset 3px 0 0 var(--warning), 0 4px 20px rgba(0, 0, 0, 0.4);
}
[data-theme="dark"] .toast--warning .toast-icon {
    color: var(--warning);
}
[data-theme="dark"] .toast--info {
    box-shadow: inset 3px 0 0 var(--accent), 0 4px 20px rgba(0, 0, 0, 0.4);
}
[data-theme="dark"] .toast--info .toast-icon {
    color: var(--accent);
}
/* ============================================
   Action Buttons & Dropdown Components
   ============================================ */
.action-buttons {
    align-items: center;
    background: var(--bg);
    border-radius: var(--radius-lg);
    padding: var(--space-1);
}
.action-buttons__item {
    font-size: var(--text-xs);
    font-weight: 500;
    padding: var(--space-2) var(--space-3);
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    transition: background var(--duration-fast) var(--ease-default),
                color var(--duration-fast) var(--ease-default);
    display: flex;
    align-items: center;
    gap: var(--space-1);
    cursor: pointer;
}
.action-buttons__item:hover {
    background: var(--surface);
    color: var(--text);
}
.action-buttons__item:focus {
    box-shadow: none;
    outline: none;
}
.action-buttons__item:focus-visible {
    outline: var(--focus-ring);
    outline-offset: var(--focus-ring-offset);
}
.action-buttons__item:active,
.action-buttons__item--active {
    background: var(--selected);
    color: var(--text);
}
.action-buttons__item::after {
    margin-left: var(--space-1);
    opacity: 0.5;
}
.action-buttons__icon {
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}
.action-buttons__badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 14px;
    height: 14px;
    padding: 0 4px;
    font-size: 10px;
    font-weight: 600;
    line-height: 14px;
    text-align: center;
    background: var(--accent);
    color: white;
    border-radius: 7px;
}
.sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    cursor: pointer;
    color: var(--text-secondary);
    transition: background var(--duration-normal) var(--ease-default),
                color var(--duration-normal) var(--ease-default);
}
.sidebar-toggle:hover {
    background: var(--bg);
    color: var(--text);
}
.sidebar-toggle--active {
    background: var(--selected);
    color: var(--text);
}
.sidebar-toggle:focus-visible {
    outline: var(--focus-ring);
    outline-offset: var(--focus-ring-offset);
}
/* ============================================
   Bootstrap Dropdown Overrides
   ============================================ */
.dropdown-menu {
    --bs-dropdown-bg: var(--surface);
    --bs-dropdown-border-color: var(--border);
    --bs-dropdown-link-color: var(--text);
    --bs-dropdown-link-hover-color: var(--text);
    --bs-dropdown-link-hover-bg: var(--selected);
    --bs-dropdown-link-active-color: var(--text);
    --bs-dropdown-link-active-bg: var(--selected);
    --bs-dropdown-divider-bg: var(--border);

    padding: var(--space-1) 0;
    font-size: var(--text-sm);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.06);
    z-index: var(--z-dropdown);
    min-width: 160px;
}
.dropdown-item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    color: var(--text);
    font-size: var(--text-sm);
    border-radius: 0;
    transition: background var(--duration-fast) var(--ease-default),
                color var(--duration-fast) var(--ease-default);
}
.dropdown-item:hover,
.dropdown-item:focus {
    background: var(--selected);
    color: var(--text);
}
.dropdown-item:active {
    background: var(--selected);
    color: var(--text);
}
.dropdown-item.active {
    background: var(--selected);
    color: var(--text);
    font-weight: 500;
}
.dropdown-item:focus-visible {
    outline: none;
    background: var(--selected);
}
.dropdown-item.text-danger {
    color: var(--danger);
}
.dropdown-item.text-danger:hover,
.dropdown-item.text-danger:focus {
    background: color-mix(in srgb, var(--danger) 10%, transparent);
    color: var(--danger);
}
.dropdown-divider {
    margin: var(--space-1) 0;
    border-top-color: var(--border);
    opacity: 1;
}
.dropdown-header {
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-xs);
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.025em;
}
.dropdown-item-text {
    padding: var(--space-2) var(--space-3);
    color: var(--text-secondary);
    font-size: var(--text-sm);
}
.dropdown-item svg,
.dropdown-item i {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: var(--text-muted);
}
.dropdown-item:hover svg,
.dropdown-item:hover i {
    color: var(--text-secondary);
}
.dropdown-item.text-danger svg,
.dropdown-item.text-danger i {
    color: var(--danger);
}
/* ============================================
   Mobile Navigation
   ============================================ */
.mobile-back {
    display: none;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) 0;
    color: var(--text-secondary);
    font-size: var(--text-sm);
    cursor: pointer;
    margin-bottom: var(--space-2);
    background: none;
    border: none;
}
.mobile-back:hover {
    color: var(--text);
}
.mobile-back:focus-visible {
    outline: var(--focus-ring);
    outline-offset: var(--focus-ring-offset);
}
.menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    background: none;
    cursor: pointer;
    color: var(--text-secondary);
}
.menu-toggle:hover {
    color: var(--text);
}
.menu-toggle:focus-visible {
    outline: var(--focus-ring);
    outline-offset: var(--focus-ring-offset);
}
/* ============================================
   Dark Mode Overrides
   ============================================ */
[data-theme="dark"] .btn-outline-danger {
    color: var(--danger);
    border-color: var(--danger);
}
[data-theme="dark"] .btn-outline-danger:hover,
[data-theme="dark"] .btn-outline-danger:focus {
    color: white;
    background: var(--danger);
    border-color: var(--danger);
}
[data-theme="dark"] .dropdown-menu {
    background: var(--surface-raised);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3), 0 1px 3px rgba(0, 0, 0, 0.2);
}
[data-theme="dark"] .dropdown-item.text-danger:hover,
[data-theme="dark"] .dropdown-item.text-danger:focus {
    background: color-mix(in srgb, var(--danger) 15%, transparent);
}
[data-theme="dark"] .modal-content {
    background: var(--surface);
    border-color: var(--border);
}
[data-theme="dark"] .modal-header {
    border-color: var(--border);
}
[data-theme="dark"] .modal-footer {
    border-color: var(--border);
}
[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select {
    background-color: var(--surface);
    border-color: var(--border);
    color: var(--text);
}
[data-theme="dark"] .form-control:focus,
[data-theme="dark"] .form-select:focus {
    background-color: var(--surface);
    border-color: var(--accent);
    color: var(--text);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
}
[data-theme="dark"] .form-control::-moz-placeholder {
    color: var(--text-muted);
}
[data-theme="dark"] .form-control::placeholder {
    color: var(--text-muted);
}
[data-theme="dark"] .form-check-input {
    background-color: var(--surface);
    border-color: var(--border);
}
[data-theme="dark"] .form-check-input:checked {
    background-color: var(--accent);
    border-color: var(--accent);
}
[data-theme="dark"] .composer-toggle .btn-outline-secondary {
    color: var(--text-secondary);
    border-color: var(--border);
    background: transparent;
}
[data-theme="dark"] .composer-toggle .btn-outline-secondary:hover {
    color: var(--text);
    background: var(--surface-raised);
    border-color: var(--border);
}
[data-theme="dark"] .composer-toggle .btn-check:checked + .btn-outline-secondary {
    background: var(--text);
    border-color: var(--text);
    color: var(--surface);
}
[data-theme="dark"] .btn-group > .btn-outline-secondary:not(:last-child) {
    border-right-color: var(--border);
}
/* ============================================
   Tags Dropdown
   ============================================ */
/* ============================================
   Assignee Dropdown
   ============================================ */
.assignee-dropdown__menu {
    min-width: 220px;
    max-height: 320px;
    overflow-y: auto;
}
.assignee-dropdown__search {
    padding: var(--space-2);
    border-bottom: 1px solid var(--border);
}
.assignee-dropdown__search-input {
    width: 100%;
    padding: var(--space-2);
    font-size: var(--text-sm);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg);
    color: var(--text);
}
.assignee-dropdown__search-input:focus {
    outline: none;
    border-color: var(--accent);
}
.assignee-dropdown__search-input::-moz-placeholder {
    color: var(--text-muted);
}
.assignee-dropdown__search-input::placeholder {
    color: var(--text-muted);
}
.assignee-dropdown__list {
    padding: var(--space-1) 0;
}
.assignee-dropdown__item {
    margin: 0 var(--space-1);
    border-radius: var(--radius-sm);
}
.assignee-dropdown__item:hover {
    background: var(--selected);
}
.assignee-dropdown__item--active {
    background: var(--selected);
}
.assignee-dropdown__button {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    width: 100%;
    padding: var(--space-2) var(--space-3);
    border: none;
    background: transparent;
    color: var(--text);
    font-size: var(--text-sm);
    cursor: pointer;
    text-align: left;
}
.assignee-dropdown__item--active .assignee-dropdown__button {
    font-weight: 500;
}
.assignee-dropdown__avatar {
    width: 24px;
    height: 24px;
    border-radius: var(--radius-full);
    background: var(--accent);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-xs);
    font-weight: 600;
    flex-shrink: 0;
}
.assignee-dropdown__name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.assignee-dropdown__empty {
    display: none;
    padding: var(--space-3);
    text-align: center;
    font-size: var(--text-sm);
    color: var(--text-muted);
}
.assignee-dropdown__footer {
    padding: var(--space-1) var(--space-2);
    border-top: 1px solid var(--border);
}
.assignee-dropdown__unassign {
    width: 100%;
    padding: var(--space-2) var(--space-3);
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: var(--text-sm);
    cursor: pointer;
    text-align: left;
    border-radius: var(--radius-sm);
}
.assignee-dropdown__unassign:hover {
    background: var(--selected);
    color: var(--text);
}
/* ============================================
   Tags Dropdown
   ============================================ */
.tags-dropdown__selected {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-right: var(--space-1);
}
.tags-dropdown__tag {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.tags-dropdown__menu {
    min-width: 220px;
    max-height: 320px;
    overflow-y: auto;
}
.tags-dropdown__search {
    padding: var(--space-2);
    border-bottom: 1px solid var(--border);
}
.tags-dropdown__search-input {
    width: 100%;
    padding: var(--space-2);
    font-size: var(--text-sm);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg);
    color: var(--text);
}
.tags-dropdown__search-input:focus {
    outline: none;
    border-color: var(--accent);
}
.tags-dropdown__search-input::-moz-placeholder {
    color: var(--text-muted);
}
.tags-dropdown__search-input::placeholder {
    color: var(--text-muted);
}
.tags-dropdown__empty {
    display: none;
    padding: var(--space-3);
    text-align: center;
    font-size: var(--text-sm);
    color: var(--text-muted);
}
.tags-dropdown__list {
    padding: var(--space-1) 0;
}
.tags-dropdown__item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    cursor: pointer;
    -webkit-user-select: none;
       -moz-user-select: none;
            user-select: none;
    border-radius: var(--radius-sm);
    margin: 0 var(--space-1);
}
.tags-dropdown__item:hover {
    background: var(--selected);
}
.tags-dropdown__item input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.tags-dropdown__item:has(input:checked) {
    background: var(--selected);
    font-weight: 500;
}
.tags-dropdown__item:has(input:checked) .tags-dropdown__color {
    box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px currentColor;
}
.tags-dropdown__color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}
.tags-dropdown__name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
/* ============================================
   Skeleton Loading Components
   ============================================ */
.skeleton {
    background: var(--skeleton);
    background-image: linear-gradient(90deg, var(--skeleton) 0px, var(--skeleton-shine) 40px, var(--skeleton) 80px);
    background-size: 200px 100%;
    animation: shimmer 1.2s ease-in-out infinite;
    border-radius: var(--radius-sm);
}
.skeleton-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 0;
    align-items: center;
    padding: var(--space-3) var(--space-5);
    border-bottom: 1px solid var(--border);
}
.skeleton-checkbox {
    width: 16px;
    height: 16px;
    margin-right: var(--space-4);
}
.skeleton-main {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}
.skeleton-top {
    display: flex;
    gap: var(--space-2);
}
.skeleton-subject {
    width: 180px;
    height: 14px;
}
.skeleton-from {
    width: 100px;
    height: 12px;
}
.skeleton-bottom {
    display: flex;
    gap: var(--space-2);
}
.skeleton-preview {
    width: 280px;
    height: 12px;
}
.skeleton-folder {
    width: 50px;
    height: 12px;
}
.skeleton-meta {
    display: flex;
    gap: var(--space-3);
    padding-left: var(--space-4);
}
.skeleton-replies {
    width: 16px;
    height: 12px;
}
.skeleton-time {
    width: 28px;
    height: 12px;
}
.skeleton-row:nth-child(2) .skeleton-subject { width: 220px; }
.skeleton-row:nth-child(2) .skeleton-from { width: 85px; }
.skeleton-row:nth-child(2) .skeleton-preview { width: 320px; }
.skeleton-row:nth-child(3) .skeleton-subject { width: 150px; }
.skeleton-row:nth-child(3) .skeleton-from { width: 120px; }
.skeleton-row:nth-child(3) .skeleton-preview { width: 240px; }
.skeleton-row:nth-child(4) .skeleton-subject { width: 200px; }
.skeleton-row:nth-child(4) .skeleton-from { width: 95px; }
.skeleton-row:nth-child(4) .skeleton-preview { width: 300px; }
.skeleton-row:nth-child(5) .skeleton-subject { width: 170px; }
.skeleton-row:nth-child(5) .skeleton-from { width: 110px; }
.skeleton-row:nth-child(5) .skeleton-preview { width: 260px; }
.skeleton-row:nth-child(6) .skeleton-subject { width: 190px; }
.skeleton-row:nth-child(6) .skeleton-from { width: 80px; }
.skeleton-row:nth-child(6) .skeleton-preview { width: 290px; }
.skeleton-row:nth-child(7) .skeleton-subject { width: 160px; }
.skeleton-row:nth-child(7) .skeleton-from { width: 100px; }
.skeleton-row:nth-child(7) .skeleton-preview { width: 220px; }
.skeleton-row:nth-child(8) .skeleton-subject { width: 210px; }
.skeleton-row:nth-child(8) .skeleton-from { width: 90px; }
.skeleton-row:nth-child(8) .skeleton-preview { width: 270px; }
.nav-count-skeleton {
    width: 18px;
    height: 12px;
}
/* ============================================
   Settings Page Skeleton Variants
   ============================================ */
.skeleton-settings-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3);
    border-bottom: 1px solid var(--border);
}
.skeleton-settings-item:last-child {
    border-bottom: none;
}
.skeleton-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
}
.skeleton-settings-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}
.skeleton-settings-name {
    width: 120px;
    height: 14px;
}
.skeleton-settings-meta {
    width: 180px;
    height: 12px;
}
.skeleton-settings-action {
    width: 60px;
    height: 28px;
    border-radius: var(--radius-sm);
}
/* Team Member Skeleton */
.skeleton-team-member {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2) var(--space-3);
    border-bottom: 1px solid var(--border);
}
.skeleton-team-member:last-child {
    border-bottom: none;
}
.skeleton-team-member:nth-child(2) .skeleton-settings-name { width: 100px; }
.skeleton-team-member:nth-child(3) .skeleton-settings-name { width: 140px; }
.skeleton-team-member:nth-child(4) .skeleton-settings-name { width: 110px; }
/* Webhook Skeleton */
.skeleton-webhook-item {
    display: flex;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--border);
}
.skeleton-webhook-item:last-child {
    border-bottom: none;
}
.skeleton-webhook-info {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}
.skeleton-webhook-name {
    width: 150px;
    height: 14px;
}
.skeleton-webhook-url {
    width: 280px;
    height: 12px;
}
.skeleton-webhook-item:nth-child(2) .skeleton-webhook-name { width: 180px; }
.skeleton-webhook-item:nth-child(2) .skeleton-webhook-url { width: 320px; }
.skeleton-webhook-item:nth-child(3) .skeleton-webhook-name { width: 130px; }
.skeleton-webhook-item:nth-child(3) .skeleton-webhook-url { width: 260px; }
/* Customer Panel Skeleton */
.skeleton-customer-panel {
    padding: var(--space-4);
}
.skeleton-customer-header {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
}
.skeleton-customer-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}
.skeleton-customer-info {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}
.skeleton-customer-name {
    width: 140px;
    height: 16px;
}
.skeleton-customer-email {
    width: 180px;
    height: 12px;
}
.skeleton-customer-field {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    padding: var(--space-2) 0;
    border-bottom: 1px solid var(--border);
}
.skeleton-customer-field:last-child {
    border-bottom: none;
}
.skeleton-customer-label {
    width: 60px;
    height: 10px;
}
.skeleton-customer-value {
    width: 120px;
    height: 14px;
}
.skeleton-customer-field:nth-child(2) .skeleton-customer-value { width: 100px; }
.skeleton-customer-field:nth-child(3) .skeleton-customer-value { width: 140px; }
.skeleton-customer-field:nth-child(4) .skeleton-customer-value { width: 90px; }
.composer-lock-status {
  display: none;
  background: color-mix(in srgb, var(--danger) 8%, var(--surface));
  border: 2px solid var(--danger);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-4);
  padding: var(--space-4) var(--space-5);
  position: relative;
}
.composer-lock-status.visible {
  display: block;
}
.composer-lock-header {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
}
.composer-lock-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  color: var(--danger);
}
.composer-lock-content {
  flex: 1;
}
.composer-lock-title {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--danger);
  margin: 0 0 var(--space-1) 0;
}
.composer-lock-description {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin: 0 0 var(--space-3) 0;
  line-height: 1.5;
}
.composer-lock-actions {
  display: flex;
  gap: var(--space-2);
}
.composer-lock-btn {
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-default);
}
.composer-lock-btn:focus-visible {
  outline: var(--focus-ring);
  outline-offset: var(--focus-ring-offset);
}
.composer-lock-btn-primary {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--accent);
}
.composer-lock-btn-primary:hover {
  background: var(--bg);
  border-color: var(--accent);
}
.composer-lock-btn-secondary {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}
.composer-lock-btn-secondary:hover {
  background: var(--bg);
}
.composer-lock-dismiss {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  background: transparent;
  border: none;
  padding: var(--space-1);
  cursor: pointer;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
}
.composer-lock-dismiss:hover {
  background: color-mix(in srgb, var(--danger) 15%, transparent);
  color: var(--danger);
}
.composer-lock-dismiss:focus-visible {
  outline: var(--focus-ring);
  outline-offset: var(--focus-ring-offset);
}
.composer button[disabled],
.composer input[type="submit"][disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}
.message.highlight-new {
  animation: highlight-pulse 2s ease-out;
}
@keyframes highlight-pulse {
  0% {
    background-color: color-mix(in srgb, var(--warning) 20%, transparent);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--warning) 30%, transparent);
  }
  100% {
    background-color: transparent;
    box-shadow: none;
  }
}
[data-tooltip] {
    position: relative;
}
[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    padding: var(--space-1) var(--space-2);
    background: var(--text);
    color: white;
    font-size: var(--text-xs);
    font-weight: 500;
    white-space: nowrap;
    border-radius: var(--radius-sm);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--duration-fast) var(--ease-default),
                visibility var(--duration-fast) var(--ease-default);
    pointer-events: none;
    z-index: var(--z-tooltip, 1000);
}
[data-tooltip]::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: var(--text);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--duration-fast) var(--ease-default),
                visibility var(--duration-fast) var(--ease-default);
    pointer-events: none;
    z-index: var(--z-tooltip, 1000);
}
[data-tooltip]:hover::after,
[data-tooltip]:hover::before,
[data-tooltip]:focus-visible::after,
[data-tooltip]:focus-visible::before {
    opacity: 1;
    visibility: visible;
    transition-delay: 300ms;
}
[data-tooltip-position="bottom"]::after {
    bottom: auto;
    top: calc(100% + 6px);
}
[data-tooltip-position="bottom"]::before {
    bottom: auto;
    top: calc(100% + 2px);
    border-top-color: transparent;
    border-bottom-color: var(--text);
}
[data-tooltip-position="left"]::after {
    bottom: auto;
    left: auto;
    right: calc(100% + 6px);
    top: 50%;
    transform: translateY(-50%);
}
[data-tooltip-position="left"]::before {
    bottom: auto;
    left: auto;
    right: calc(100% + 2px);
    top: 50%;
    transform: translateY(-50%);
    border-top-color: transparent;
    border-left-color: var(--text);
}
[data-tooltip-position="right"]::after {
    bottom: auto;
    left: calc(100% + 6px);
    top: 50%;
    transform: translateY(-50%);
}
[data-tooltip-position="right"]::before {
    bottom: auto;
    left: calc(100% + 2px);
    top: 50%;
    transform: translateY(-50%);
    border-top-color: transparent;
    border-right-color: var(--text);
}
[data-theme="dark"] [data-tooltip]::after {
    background: var(--surface-raised);
    color: var(--text);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
[data-theme="dark"] [data-tooltip]::before {
    border-top-color: var(--surface-raised);
}
[data-theme="dark"] [data-tooltip-position="bottom"]::before {
    border-top-color: transparent;
    border-bottom-color: var(--surface-raised);
}
[data-theme="dark"] [data-tooltip-position="left"]::before {
    border-top-color: transparent;
    border-left-color: var(--surface-raised);
}
[data-theme="dark"] [data-tooltip-position="right"]::before {
    border-top-color: transparent;
    border-right-color: var(--surface-raised);
}
.filter-builder {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}
.filter-builder-header {
    margin-bottom: var(--space-2);
}
.filter-builder-header h4 {
    font-size: var(--text-sm);
    font-weight: 500;
    margin: 0 0 var(--space-1) 0;
}
.filter-builder-header p {
    font-size: var(--text-xs);
    color: var(--text-muted);
    margin: 0;
}
.filter-condition-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}
.filter-condition-empty {
    padding: var(--space-5);
    text-align: center;
    color: var(--text-muted);
    font-size: var(--text-sm);
    background: var(--bg);
    border-radius: var(--radius-md);
    border: 1px dashed var(--border);
}
.filter-condition-card {
    display: flex;
    flex-direction: column;
    padding: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: border-color var(--duration-normal) var(--ease-default),
                box-shadow var(--duration-normal) var(--ease-default);
    cursor: pointer;
    position: relative;
}
.filter-condition-card:hover {
    border-color: color-mix(in srgb, var(--border) 80%, var(--text) 20%);
}
.filter-condition-card:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent);
}
.filter-condition-collapsed {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-3);
    gap: var(--space-2);
}
.filter-condition-card--expanded .filter-condition-collapsed {
    display: none;
}
.filter-condition-summary {
    font-size: var(--text-sm);
    color: var(--text);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.filter-condition-expand-icon {
    color: var(--text-muted);
    flex-shrink: 0;
    transition: transform var(--duration-fast) var(--ease-default);
}
.filter-condition-card--expanded .filter-condition-expand-icon {
    transform: rotate(180deg);
}
.filter-condition-content {
    display: none;
    padding: var(--space-3);
    cursor: default;
}
.filter-condition-card--expanded .filter-condition-content {
    display: block;
}
.filter-condition-card .filter-condition-remove {
    position: absolute;
    top: var(--space-2);
    right: var(--space-2);
    opacity: 0;
    transition: opacity var(--duration-fast) var(--ease-default);
}
.filter-condition-card:hover .filter-condition-remove,
.filter-condition-card--expanded .filter-condition-remove {
    opacity: 1;
}
.filter-condition-header {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-2);
    flex-wrap: wrap;
}
.filter-condition-type {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text);
    min-width: 100px;
}
.filter-condition-operator {
    font-size: var(--text-sm);
    padding: var(--space-1) var(--space-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    min-width: 120px;
}
.filter-condition-operator:hover {
    border-color: var(--text-muted);
}
.filter-condition-operator:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 15%, transparent);
}
.filter-condition-values {
    margin-top: var(--space-2);
}
.filter-values-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}
.filter-value-checkbox {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-1) var(--space-2);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: var(--text-xs);
    cursor: pointer;
    transition: background var(--duration-fast) var(--ease-default),
                border-color var(--duration-fast) var(--ease-default);
    -webkit-user-select: none;
       -moz-user-select: none;
            user-select: none;
}
.filter-value-checkbox:hover {
    background: var(--selected);
}
.filter-value-checkbox:has(input:checked) {
    background: color-mix(in srgb, var(--accent) 10%, transparent);
    border-color: var(--accent);
}
.filter-value-checkbox input[type="checkbox"] {
    width: 14px;
    height: 14px;
    margin: 0;
    cursor: pointer;
    accent-color: var(--accent);
}
.filter-value-checkbox span {
    color: var(--text);
}
.filter-value-text {
    width: 100%;
    max-width: 300px;
}
.filter-value-text input {
    width: 100%;
    padding: var(--space-1) var(--space-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: var(--text-sm);
    background: var(--surface);
    color: var(--text);
}
.filter-value-text input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 15%, transparent);
}
.filter-value-date {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}
.filter-value-date input[type="date"] {
    padding: var(--space-1) var(--space-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: var(--text-sm);
    background: var(--surface);
    color: var(--text);
}
.filter-value-date input[type="date"]:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 15%, transparent);
}
.filter-condition-remove {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--duration-fast) var(--ease-default),
                color var(--duration-fast) var(--ease-default);
    flex-shrink: 0;
}
.filter-condition-remove:hover {
    background: color-mix(in srgb, var(--danger) 10%, transparent);
    color: var(--danger);
}
.filter-condition-remove:focus-visible {
    outline: var(--focus-ring);
    outline-offset: var(--focus-ring-offset);
}
.filter-condition-remove svg {
    width: 16px;
    height: 16px;
}
.filter-builder-add {
    position: relative;
}
.filter-add-button {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    border: 1px dashed var(--border);
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--text-secondary);
    font-size: var(--text-sm);
    cursor: pointer;
    transition: border-color var(--duration-normal) var(--ease-default),
                color var(--duration-normal) var(--ease-default),
                background var(--duration-normal) var(--ease-default);
}
.filter-add-button:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: color-mix(in srgb, var(--accent) 5%, transparent);
}
.filter-add-button:focus-visible {
    outline: var(--focus-ring);
    outline-offset: var(--focus-ring-offset);
}
.filter-add-button svg {
    width: 16px;
    height: 16px;
}
.filter-type-picker {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: var(--space-2);
    min-width: 240px;
    max-height: 400px;
    overflow-y: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.06);
    z-index: var(--z-dropdown);
}
.filter-type-picker[hidden] {
    display: none;
}
.filter-type-picker-list {
    padding: var(--space-1);
}
.filter-type-picker-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    width: 100%;
    padding: var(--space-2) var(--space-3);
    border: none;
    background: transparent;
    color: var(--text);
    font-size: var(--text-sm);
    text-align: left;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: background var(--duration-fast) var(--ease-default);
}
.filter-type-picker-item:hover {
    background: var(--selected);
}
.filter-type-picker-item:focus-visible {
    outline: none;
    background: var(--selected);
}
.filter-type-picker-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
}
.filter-type-picker-icon svg {
    width: 16px;
    height: 16px;
}
.filter-type-picker-label {
    font-weight: 400;
}
.filter-operator-dropdown {
    position: relative;
}
.filter-operator-trigger {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-1) var(--space-2);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: var(--text-sm);
    color: var(--text);
    cursor: pointer;
    transition: border-color var(--duration-fast) var(--ease-default);
}
.filter-operator-trigger:hover {
    border-color: var(--text-muted);
}
.filter-operator-trigger svg {
    width: 12px;
    height: 12px;
    color: var(--text-muted);
}
.filter-operator-menu {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: var(--space-1);
    min-width: 200px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.06);
    z-index: var(--z-dropdown);
    padding: var(--space-1);
}
.filter-operator-menu[hidden] {
    display: none;
}
.filter-operator-option {
    display: block;
    width: 100%;
    padding: var(--space-2) var(--space-3);
    border: none;
    background: transparent;
    text-align: left;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: background var(--duration-fast) var(--ease-default);
}
.filter-operator-option:hover {
    background: var(--selected);
}
.filter-operator-option-label {
    display: block;
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text);
}
.filter-operator-option-desc {
    display: block;
    font-size: var(--text-xs);
    color: var(--text-muted);
    margin-top: 2px;
}
.filter-operator-option--selected {
    background: color-mix(in srgb, var(--accent) 10%, transparent);
}
.filter-operator-option--selected .filter-operator-option-label {
    color: var(--accent);
}
.filter-property-select {
    font-size: var(--text-sm);
    padding: var(--space-1) var(--space-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    min-width: 150px;
}
.filter-property-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 15%, transparent);
}
.filter-add-button-container {
    display: flex;
    justify-content: center;
    padding: var(--space-4);
    background: var(--surface);
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    transition: border-color var(--duration-fast) var(--ease-default),
                background var(--duration-fast) var(--ease-default);
}
.filter-add-button-container:hover {
    border-color: var(--accent);
    background: color-mix(in srgb, var(--accent) 3%, transparent);
}
.filter-add-button-centered {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-4);
    color: var(--text-muted);
    text-decoration: none;
    transition: color var(--duration-fast) var(--ease-default);
}
.filter-add-button-centered:hover {
    color: var(--accent);
}
.filter-add-button-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: 50%;
    transition: all var(--duration-fast) var(--ease-default);
}
.filter-add-button-centered:hover .filter-add-button-icon {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}
.filter-add-button-text {
    font-size: var(--text-sm);
    font-weight: 500;
}
.filter-picker-container {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.filter-picker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--border);
    background: var(--bg);
}
.filter-picker-title {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text);
}
.filter-picker-cancel {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    transition: all var(--duration-fast) var(--ease-default);
}
.filter-picker-cancel:hover {
    background: var(--selected);
    color: var(--text);
}
.filter-picker-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-1);
    padding: var(--space-2);
}
.filter-picker-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3);
    color: var(--text);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: background var(--duration-fast) var(--ease-default);
}
.filter-picker-item:hover {
    background: var(--selected);
}
.filter-picker-item-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    flex-shrink: 0;
}
.filter-picker-item:hover .filter-picker-item-icon {
    background: color-mix(in srgb, var(--accent) 15%, transparent);
    color: var(--accent);
}
.filter-picker-item-label {
    font-size: var(--text-sm);
    font-weight: 500;
}
.filter-config-container {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.filter-config-form {
    display: flex;
    flex-direction: column;
}
.filter-config-header {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--border);
    background: var(--bg);
}
.filter-config-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: color-mix(in srgb, var(--accent) 15%, transparent);
    color: var(--accent);
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}
.filter-config-operator {
    flex: 1;
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-sm);
    font-weight: 500;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
}
.filter-config-operator:hover {
    border-color: var(--text-muted);
}
.filter-config-operator:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 15%, transparent);
}
.filter-config-cancel {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    transition: all var(--duration-fast) var(--ease-default);
}
.filter-config-cancel:hover {
    background: color-mix(in srgb, var(--danger) 10%, transparent);
    color: var(--danger);
}
.filter-config-values {
    padding: var(--space-4);
}
.filter-config-values .filter-values-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}
.filter-config-values .filter-values-scrollable {
    max-height: 200px;
    overflow-y: auto;
}
.filter-config-text-input,
.filter-config-date-input,
.filter-config-number-input {
    width: 100%;
    padding: var(--space-3);
    font-size: var(--text-sm);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg);
    color: var(--text);
}
.filter-config-text-input:focus,
.filter-config-date-input:focus,
.filter-config-number-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 15%, transparent);
}
.filter-value-number {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}
.filter-config-number-input {
    max-width: 120px;
}
.filter-value-suffix {
    font-size: var(--text-sm);
    color: var(--text-muted);
}
.filter-config-actions {
    display: flex;
    justify-content: flex-end;
    padding: var(--space-3) var(--space-4);
    border-top: 1px solid var(--border);
    background: var(--bg);
}
.filter-config-add-button {
    padding: var(--space-2) var(--space-4);
    font-size: var(--text-sm);
    font-weight: 500;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-default);
}
.filter-config-add-button:hover {
    background: color-mix(in srgb, var(--accent) 85%, black);
}
.filter-condition-cards {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}
.filter-condition-card-compact {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-3) var(--space-4);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    transition: border-color var(--duration-fast) var(--ease-default);
}
.filter-condition-card-compact:hover {
    border-color: var(--text-muted);
}
.filter-condition-card-content {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    flex: 1;
    min-width: 0;
}
.filter-condition-card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    flex-shrink: 0;
}
.filter-condition-card-label {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
}
.filter-condition-value-pills {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1);
    margin-left: var(--space-2);
}
.filter-condition-value-pill {
    display: inline-flex;
    align-items: center;
    padding: var(--space-1) var(--space-2);
    font-size: var(--text-xs);
    font-weight: 500;
    background: color-mix(in srgb, var(--accent) 10%, transparent);
    color: var(--accent);
    border-radius: var(--radius-sm);
}
.filter-condition-value-pill-more {
    background: var(--bg);
    color: var(--text-muted);
}
.filter-condition-card-remove {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    cursor: pointer;
    opacity: 0;
    transition: all var(--duration-fast) var(--ease-default);
    flex-shrink: 0;
}
.filter-condition-card-compact:hover .filter-condition-card-remove {
    opacity: 1;
}
.filter-condition-card-remove:hover {
    background: color-mix(in srgb, var(--danger) 10%, transparent);
    color: var(--danger);
}
.command-filter__tag-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
/* ==========================================================================
   Search Modal (BEM)
   Full-screen command palette style search
   ========================================================================== */
:root {
  --search-accent-subtle: rgba(181, 65, 44, 0.1);
  --search-result-hover: var(--selected);
}
[data-theme="dark"] {
  --search-accent-subtle: rgba(232, 116, 97, 0.15);
}
/* Block: search-modal
   ========================================================================== */
.search-modal {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: none;
  background: var(--surface);
}
.search-modal--visible {
  display: block;
}
/* Element: search-modal__container
   ========================================================================== */
.search-modal__container {
  width: 100%;
  height: 100%;
  background: var(--surface);
}
/* Element: search-modal__header
   ========================================================================== */
.search-modal__header {
  position: relative;
  z-index: 10;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border);
}
/* Element: search-modal__input-field
   ========================================================================== */
.search-modal__input-field {
  flex: 1;
  min-width: 0;
  min-height: 24px;
}
/* Element: search-modal__input
   ========================================================================== */
.search-modal__input {
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: var(--text-sm);
  flex: 1;
  min-width: 120px;
  padding: 0;
}
.search-modal__input:focus {
  box-shadow: none;
}
.search-modal__input::-moz-placeholder {
  color: var(--text-muted);
}
.search-modal__input::placeholder {
  color: var(--text-muted);
}
/* Element: search-modal__shortcut
   ========================================================================== */
.search-modal__shortcut {
  font-size: var(--text-2xs);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text-muted);
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}
/* Element: search-modal__filter-btn
   ========================================================================== */
.search-modal__filter-btn {
  display: none;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-secondary);
  font-size: var(--text-xs);
  cursor: pointer;
}
.search-modal__filter-btn:hover {
  background: var(--selected);
}
.search-modal__filter-btn--active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--search-accent-subtle);
}
@media (max-width: 768px) {
  .search-modal__filter-btn {
    display: flex;
  }
}
/* Element: search-modal__token
   ========================================================================== */
.search-modal__token {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  background: var(--search-accent-subtle);
  color: var(--accent);
  white-space: nowrap;
}
.search-modal__token-key {
  opacity: 0.7;
}
.search-modal__token-remove {
  margin-left: var(--space-1);
  cursor: pointer;
  opacity: 0.6;
  font-size: var(--text-2xs);
}
.search-modal__token-remove:hover {
  opacity: 1;
}
/* Element: search-modal__tabs
   ========================================================================== */
.search-modal__tabs {
  gap: var(--space-1);
  padding: 0 var(--space-4);
  border-bottom: 1px solid var(--border);
}
/* Element: search-modal__tab
   ========================================================================== */
.search-modal__tab {
  color: var(--text-muted);
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  padding: var(--space-2) var(--space-3);
  margin-bottom: -1px;
  font-size: var(--text-xs);
  font-weight: 500;
  background: none;
  transition: color var(--duration-fast) var(--ease-default),
              border-color var(--duration-fast) var(--ease-default);
}
.search-modal__tab:hover {
  color: var(--text);
  border-bottom-color: transparent;
}
.search-modal__tab--active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  background: none;
}
.search-modal__tab-count {
  font-weight: 400;
  color: var(--text-muted);
  margin-left: var(--space-1);
}
.search-modal__tab--active .search-modal__tab-count {
  color: var(--accent);
  opacity: 0.7;
}
/* Element: search-modal__body
   ========================================================================== */
.search-modal__body {
  flex: 1;
  min-height: 0;
  height: 100vh;
}
/* Element: search-modal__sidebar
   ========================================================================== */
.search-modal__sidebar {
  width: 200px;
  padding: var(--space-2);
  background: var(--bg);
  border-right: 1px solid var(--border);
}
@media (max-width: 768px) {
  .search-modal__sidebar {
    display: none !important;
  }
}
/* Element: search-modal__sidebar-section
   ========================================================================== */
.search-modal__sidebar-section {
  margin-bottom: var(--space-4);
}
.search-modal__sidebar-section:last-child {
  margin-bottom: 0;
}
/* Element: search-modal__sidebar-heading
   ========================================================================== */
.search-modal__sidebar-heading {
  font-size: var(--text-2xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  padding: var(--space-1) var(--space-2) var(--space-2);
}
/* Element: search-modal__sidebar-item
   ========================================================================== */
.search-modal__sidebar-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-md);
  font-size: var(--text-xs);
  color: var(--text-secondary);
  text-decoration: none;
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-default),
              color var(--duration-fast) var(--ease-default);
}
.search-modal__sidebar-item:hover {
  background: var(--selected);
  color: var(--text);
  text-decoration: none;
}
.search-modal__sidebar-item--active {
  background: var(--search-accent-subtle);
  color: var(--accent);
}
.search-modal__sidebar-item i {
  width: 18px;
  text-align: center;
  opacity: 0.7;
}
.search-modal__sidebar-count {
  margin-left: auto;
  font-size: var(--text-2xs);
  color: var(--text-muted);
}
/* Element: search-modal__results
   ========================================================================== */
.search-modal__results {
  min-height: 200px;
  padding: var(--space-2);
}
/* Element: search-modal__result
   ========================================================================== */
.search-modal__result {
  display: flex;
  flex-direction: column;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  cursor: pointer;
  color: inherit;
  text-decoration: none;
  margin: var(--space-1) 0;
  transition: background var(--duration-fast) var(--ease-default);
}
.search-modal__result:hover {
  background: var(--selected);
  text-decoration: none;
}
.search-modal__result--selected {
  background: var(--selected);
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
.search-modal__result:focus-visible {
  outline: var(--focus-ring);
  outline-offset: -2px;
}
/* Element: search-modal__result-time
   ========================================================================== */
.search-modal__result-time {
  font-size: var(--text-2xs);
  color: var(--text-muted);
}
/* Element: search-modal__result-customer
   ========================================================================== */
.search-modal__result-customer {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--text-secondary);
}
/* Element: search-modal__result-preview
   ========================================================================== */
.search-modal__result-preview {
  font-size: var(--text-xs);
  color: var(--text-muted);
}
/* Element: search-modal__badge (status variants)
   ========================================================================== */
.search-modal__badge--open {
  background: rgba(21, 128, 61, 0.15);
  color: var(--success);
}
[data-theme="dark"] .search-modal__badge--open {
  background: rgba(34, 197, 94, 0.2);
  color: var(--success);
}
.search-modal__badge--waiting {
  background: rgba(217, 119, 6, 0.15);
  color: var(--warning);
}
[data-theme="dark"] .search-modal__badge--waiting {
  background: rgba(245, 158, 11, 0.2);
  color: var(--warning);
}
.search-modal__badge--done,
.search-modal__badge--closed {
  background: var(--bg);
  color: var(--text-muted);
}
.search-modal__badge--spam {
  background: rgba(220, 38, 38, 0.15);
  color: var(--danger);
}
[data-theme="dark"] .search-modal__badge--spam {
  background: rgba(239, 68, 68, 0.2);
  color: var(--danger);
}
.search-modal__badge--draft {
  background: var(--search-accent-subtle);
  color: var(--accent);
}
/* Element: search-modal__avatar
   ========================================================================== */
.search-modal__avatar {
  width: 36px;
  height: 36px;
  background: var(--search-accent-subtle);
  color: var(--accent);
  font-size: var(--text-xs);
  font-weight: 600;
}
/* Element: search-modal__customer-email
   ========================================================================== */
.search-modal__customer-email {
  font-size: var(--text-xs);
  color: var(--text-muted);
}
/* Element: search-modal__autocomplete
   ========================================================================== */
.search-modal__autocomplete {
  position: absolute;
  top: calc(100% + 4px);
  left: var(--space-4);
  right: var(--space-4);
  z-index: 1000;
  max-height: 280px;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}
@media (max-width: 576px) {
  .search-modal:has(.search-modal__autocomplete:not(.d-none)) .search-modal__header {
    z-index: 1100;
  }

  .search-modal__autocomplete {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    max-height: 60vh;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    padding-bottom: env(safe-area-inset-bottom);
    z-index: 1100;
  }

  .search-modal__autocomplete::before {
    content: "";
    display: block;
    width: 36px;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    margin: var(--space-3) auto;
  }

  .search-modal:has(.search-modal__autocomplete:not(.d-none))::after {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1050;
  }
}
/* Element: search-modal__autocomplete-section
   ========================================================================== */
.search-modal__autocomplete-section {
  padding: var(--space-1);
}
.search-modal__autocomplete-title {
  font-size: var(--text-2xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  padding: var(--space-2) var(--space-2) var(--space-1);
}
/* Element: search-modal__autocomplete-item
   ========================================================================== */
.search-modal__autocomplete-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-2);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: var(--text-xs);
  color: var(--text);
  transition: background var(--duration-fast) var(--ease-default);
}
.search-modal__autocomplete-item:hover {
  background: var(--selected);
}
.search-modal__autocomplete-item--selected {
  background: var(--search-accent-subtle);
  color: var(--accent);
}
.search-modal__autocomplete-item i {
  width: 18px;
  text-align: center;
  color: var(--text-muted);
}
.search-modal__autocomplete-item--selected i {
  color: var(--accent);
}
.search-modal__autocomplete-label {
  flex: 1;
}
.search-modal__autocomplete-hint {
  font-size: var(--text-2xs);
  color: var(--text-muted);
}
.search-modal__autocomplete-item--selected .search-modal__autocomplete-hint {
  color: var(--accent);
  opacity: 0.7;
}
/* Element: search-modal__hints
   ========================================================================== */
.search-modal__hints {
  max-width: 320px;
}
/* Element: search-modal__hint
   ========================================================================== */
.search-modal__hint {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  background: var(--bg);
  color: var(--text-muted);
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-default),
              color var(--duration-fast) var(--ease-default);
}
.search-modal__hint:hover {
  background: var(--search-accent-subtle);
  color: var(--accent);
}
.search-modal__hint code {
  font-size: var(--text-2xs);
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  color: var(--accent);
}
/* Element: search-modal__filter-sheet
   ========================================================================== */
.search-modal__filter-sheet {
  position: absolute;
  inset: 0;
  background: var(--surface);
  z-index: 200;
  display: none;
  flex-direction: column;
}
.search-modal__filter-sheet--open {
  display: flex;
}
.search-modal__filter-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border);
}
.search-modal__filter-sheet-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text);
}
.search-modal__filter-sheet-close {
  padding: var(--space-1);
  border: none;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: var(--text-lg);
}
.search-modal__filter-sheet-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-2);
}
.search-modal__filter-sheet-section {
  margin-bottom: var(--space-4);
}
.search-modal__filter-sheet-section-title {
  font-size: var(--text-2xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  padding: var(--space-2) var(--space-2) var(--space-1);
}
/* Element: search-modal__filter-sheet-item
   ========================================================================== */
.search-modal__filter-sheet-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3);
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  color: var(--text);
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-default);
}
.search-modal__filter-sheet-item:hover {
  background: var(--selected);
}
.search-modal__filter-sheet-item--active {
  background: var(--search-accent-subtle);
  color: var(--accent);
}
.search-modal__filter-sheet-item i {
  font-size: var(--text-base);
  width: 20px;
  text-align: center;
}
.search-modal__filter-sheet-footer {
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--border);
  display: flex;
  gap: var(--space-2);
}
/* Element: search-modal__empty
   ========================================================================== */
.search-modal__empty {
  min-height: 250px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-6);
}
.search-modal__empty-icon {
  font-size: var(--text-4xl);
  color: var(--text-muted);
  margin-bottom: var(--space-3);
}
.search-modal__empty-title {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text);
  margin-bottom: var(--space-4);
}
/* Element: search-modal__no-results
   ========================================================================== */
.search-modal__no-results {
  min-height: 150px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-6);
  color: var(--text-muted);
}
/* Element: search-modal__footer
   ========================================================================== */
.search-modal__footer {
  font-size: var(--text-2xs);
  padding: var(--space-2) var(--space-4);
  border-top: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-muted);
}
@media (max-width: 576px) {
  .search-modal__footer {
    display: none !important;
  }
}
.search-modal__footer kbd {
  display: inline-block;
  padding: var(--space-1);
  font-size: var(--text-2xs);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin: 0 var(--space-1);
  color: var(--text-secondary);
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}
/* Features */
/* ============================================
   Sidebar Layout
   ============================================ */
.sidebar {
    width: 260px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}
.sidebar--disabled {
    opacity: 0.5;
    pointer-events: none;
}
.sidebar__header {
    padding: var(--space-4);
    border-bottom: 1px solid var(--border);
}
.workspace-switcher {
    position: relative;
}
.workspace-switcher__toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
    padding: var(--space-1) var(--space-2);
    margin: calc(var(--space-1) * -1) calc(var(--space-2) * -1);
    width: calc(100% + var(--space-2) * 2);
    border: none;
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--text);
    text-align: left;
    cursor: pointer;
    transition: background var(--duration-fast) var(--ease-default);
}
.workspace-switcher__toggle:hover {
    background: var(--bg);
}
.workspace-switcher__toggle:focus-visible {
    outline: var(--focus-ring);
    outline-offset: var(--focus-ring-offset);
}
.workspace-switcher__name {
    min-width: 0;
    font-weight: 600;
    font-size: var(--text-sm);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.workspace-switcher__chevron {
    flex-shrink: 0;
    font-size: var(--text-xs);
    color: var(--text-muted);
}
.workspace-switcher__menu {
    min-width: 240px;
}
.workspace-switcher__option {
    justify-content: space-between;
}
.workspace-switcher__option-name {
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sidebar__nav {
    padding: var(--space-3) var(--space-2);
    flex: 1;
    overflow-y: auto;
}
.sidebar__footer {
    padding: var(--space-2) var(--space-3);
    border-top: 1px solid var(--border);
    margin-top: auto;
}
.sidebar__footer a {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: 6px var(--space-3);
    border-radius: var(--radius-md);
    color: var(--text-muted);
    text-decoration: none;
    font-size: var(--text-xs);
    transition: background var(--duration-normal) var(--ease-default),
                color var(--duration-normal) var(--ease-default);
}
.sidebar__footer a:hover {
    background: var(--bg);
    color: var(--text);
}
.sidebar__footer a:focus-visible {
    outline: var(--focus-ring);
    outline-offset: var(--focus-ring-offset);
}
[data-theme="dark"] .sidebar__footer a:hover {
    background: var(--surface-raised);
}
/* ============================================
   Folder Selector
   ============================================ */
.folder-selector {
    padding: 0 var(--space-1) var(--space-3);
    margin-bottom: var(--space-2);
    border-bottom: 1px solid var(--border);
}
.folder-selector__btn {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    width: 100%;
    padding: var(--space-2) var(--space-3);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text);
    cursor: pointer;
    text-align: left;
    transition: background var(--duration-normal) var(--ease-default);
}
.folder-selector__btn:hover {
    background: var(--selected);
}
.folder-selector__btn:focus-visible {
    outline: var(--focus-ring);
    outline-offset: var(--focus-ring-offset);
}
.folder-selector__btn::after {
    display: none;
}
.folder-selector__btn .dropdown-chevron {
    margin-left: auto;
    color: var(--text-muted);
}
.folder-selector .dropdown-menu {
    width: 100%;
    min-width: 100%;
}
/* ============================================
   Navigation Items
   ============================================ */
.nav-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px var(--space-3);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: var(--text-sm);
    line-height: 1.4;
    cursor: pointer;
    margin-bottom: 1px;
    transition: background var(--duration-normal) var(--ease-default),
                color var(--duration-normal) var(--ease-default);
}
.nav-item:hover {
    background: var(--bg);
    color: var(--text);
    text-decoration: none;
}
[data-theme="dark"] .nav-item:hover {
    background: var(--surface-raised);
}
.nav-item--active {
    background: var(--selected);
    color: var(--text);
    font-weight: 500;
    position: relative;
}
.nav-item--active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 4px;
    bottom: 4px;
    width: 3px;
    background: var(--accent);
    border-radius: 0 2px 2px 0;
}
.nav-item:focus-visible {
    outline: var(--focus-ring);
    outline-offset: var(--focus-ring-offset);
}
.nav-item__count {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}
.nav-item--active .nav-item__count {
    color: var(--text-secondary);
}
.nav-item--back {
    gap: var(--space-2);
    justify-content: flex-start;
    color: var(--text-muted);
    margin-bottom: var(--space-2);
}
.nav-item--back:hover {
    color: var(--text);
}
/* ============================================
   Navigation Sections
   ============================================ */
.nav-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-3) var(--space-3) var(--space-1);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}
.nav-section a {
    font-size: 11px;
    font-weight: 500;
    text-transform: none;
    letter-spacing: normal;
    color: var(--text-muted);
}
.nav-section a:hover {
    color: var(--text);
    text-decoration: none;
}
/* ============================================
   Theme Toggle
   ============================================ */
.theme-toggle {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    width: 100%;
    padding: 6px var(--space-3);
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-size: var(--text-xs);
    cursor: pointer;
    border: none;
    background: none;
    text-align: left;
    transition: background var(--duration-normal) var(--ease-default),
                color var(--duration-normal) var(--ease-default);
}
.theme-toggle:hover {
    background: var(--bg);
    color: var(--text);
}
.theme-toggle:focus-visible {
    outline: var(--focus-ring);
    outline-offset: var(--focus-ring-offset);
}
[data-theme="dark"] .theme-toggle:hover {
    background: var(--surface-raised);
}
/* ============================================
   Attention/Needs Attention Nav Item
   ============================================ */
.nav-item--attention {
    color: var(--text-secondary);
    font-weight: 500;
    position: relative;
}
.nav-item--attention::before {
    content: '';
    position: absolute;
    left: 0;
    top: 4px;
    bottom: 4px;
    width: 3px;
    background: var(--danger);
    border-radius: 0 2px 2px 0;
}
.nav-item--attention:hover {
    background: rgba(220, 38, 38, 0.06);
    color: var(--text);
}
.nav-item--attention.nav-item--active {
    background: rgba(220, 38, 38, 0.08);
    color: var(--text);
}
.nav-item--attention:has(.nav-item__count--attention:empty) {
    display: none;
}
.nav-item__count--attention {
    background: var(--danger);
    color: white;
    padding: 1px 6px;
    border-radius: var(--radius-full);
    font-size: 10px;
    font-weight: 600;
    min-width: 18px;
    text-align: center;
}
[data-theme="dark"] .nav-item--attention:hover {
    background: rgba(239, 68, 68, 0.12);
}
[data-theme="dark"] .nav-item--attention.nav-item--active {
    background: rgba(239, 68, 68, 0.15);
}
/* ============================================
   Conversation List Layout
   ============================================ */
.conversation-list {
    width: 280px;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}
.conversation-list--full-width {
    width: 100%;
    border-right: none;
}
/* ============================================
   List Header
   ============================================ */
.list-header {
    padding: var(--space-3) var(--space-5);
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    font-size: var(--text-sm);
}
/* ============================================
   Ticket Table (Full-width list view)
   ============================================ */
.ticket-table {
    display: none;
    flex: 1;
    overflow: auto;
}
.ticket-table__grid {
    min-width: -moz-max-content;
    min-width: max-content;
}
.conversation-list--full-width .ticket-table {
    display: block;
}
.conversation-list--full-width .list-items {
    display: none;
}
.ticket-table-header {
    display: grid;
    grid-template-columns: var(--columns);
    font-size: var(--text-xs);
    font-weight: 500;
    color: var(--text-muted);
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--surface);
}
.ticket-table-header > div {
    padding: var(--space-3) var(--space-2);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
}
.ticket-table-header > div:first-child {
    padding-left: var(--space-5);
}
.ticket-table-header > div:last-child {
    padding-right: var(--space-5);
}
.ticket-header-checkbox {
    padding-right: var(--space-4);
}
.ticket-header-conversation {
    min-width: 0;
}
.ticket-header-number {
    text-align: right;
    justify-content: flex-end;
}
.ticket-header-last_updated {
    text-align: right;
    justify-content: flex-end;
}
.ticket-table-header a.sortable {
    color: var(--text-muted);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
}
.ticket-table-header a.sortable:hover {
    color: var(--text);
}
.ticket-table-header a.sortable:focus-visible {
    outline: var(--focus-ring);
    outline-offset: var(--focus-ring-offset);
}
.ticket-table-header a.sortable--active {
    color: var(--text);
}
.ticket-table-header a.sortable--active::after {
    content: "";
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
}
.ticket-table-header a.sortable--active.sortable--desc::after {
    border-top: 5px solid currentColor;
}
.ticket-table-header a.sortable--active.sortable--asc::after {
    border-bottom: 5px solid currentColor;
}
/* ============================================
   Conversation Item (Unified Desktop/Mobile)
   ============================================ */
.conversation-item {
    display: grid;
    grid-template-columns: var(--columns);
    align-items: center;
    border-bottom: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
    position: relative;
}
.conversation-item:hover {
    background: var(--selected);
}
.conversation-item--unread::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 3px;
    background: var(--accent);
    border-radius: 0 2px 2px 0;
}
.conversation-item__checkbox {
    display: flex;
    align-items: center;
    padding: var(--space-3) var(--space-2) var(--space-3) var(--space-5);
}
.conversation-item__link {
    display: contents;
    color: inherit;
    text-decoration: none;
}
.conversation-item__link:hover {
    text-decoration: none;
}
.ticket-checkbox {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
    cursor: pointer;
    flex-shrink: 0;
}
.ticket-checkbox:focus-visible {
    outline: var(--focus-ring);
    outline-offset: var(--focus-ring-offset);
}
/* Desktop layout */
.conversation-item__desktop {
    display: contents;
}
.conversation-item__desktop > div {
    padding: var(--space-3) var(--space-2);
    display: flex;
    align-items: start;
    min-width: 0;
}
.conversation-item__desktop > div:last-child {
    padding-right: var(--space-5);
}
.conversation-item__customer {
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.conversation-item--unread .conversation-item__customer {
    font-weight: 600;
}
.conversation-item__conversation {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-1);
    min-width: 0;
}
.conversation-item__subject-row {
    display: flex;
    align-items: baseline;
    gap: var(--space-2);
    min-width: 0;
}
.conversation-item__tag {
    display: inline-block;
    padding: 1px 6px;
    font-size: var(--text-xs);
    font-weight: 500;
    border-radius: var(--radius-sm);
    white-space: nowrap;
    flex-shrink: 0;
}
.conversation-item__subject {
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: var(--text-sm);
    font-weight: 500;
}
.conversation-item--unread .conversation-item__subject {
    font-weight: 600;
}
.conversation-item__preview {
    font-size: var(--text-xs);
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    margin-top: 2px;
}
.conversation-item__assignee {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.conversation-item__number {
    text-align: right;
    justify-content: flex-end;
}
.conversation-item__number-badge {
    display: inline-block;
    font-size: var(--text-xs);
    font-weight: 500;
    padding: 2px 6px;
    background: var(--bg);
    color: var(--text-secondary);
    border-radius: 4px;
    font-variant-numeric: tabular-nums;
}
.conversation-item__time,
.conversation-item__last_updated {
    font-size: var(--text-xs);
    color: var(--text-muted);
    white-space: nowrap;
    text-align: right;
    justify-content: flex-end;
    font-variant-numeric: tabular-nums;
}
/* Hover actions toolbar */
.conversation-item__actions {
    display: none;
    position: absolute;
    right: var(--space-5);
    top: 50%;
    transform: translateY(-50%);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--space-1);
    gap: var(--space-1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    z-index: 1;
}
.conversation-item:hover .conversation-item__actions {
    display: flex;
}
.conversation-item:hover .conversation-item__time {
    visibility: hidden;
}
.conversation-item__action {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    background: none;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--duration-fast) var(--ease-default),
                color var(--duration-fast) var(--ease-default);
}
.conversation-item__action:hover {
    background: var(--bg);
    color: var(--text);
}
.conversation-item__action:focus-visible {
    outline: var(--focus-ring);
    outline-offset: var(--focus-ring-offset);
}
/* Mobile layout - hidden by default */
.conversation-item__mobile {
    display: none;
    flex-direction: column;
    padding: var(--space-4);
    padding-left: var(--space-3);
}
.conversation-item__mobile-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-2);
    margin-bottom: var(--space-1);
}
.conversation-item__mobile-customer {
    display: flex;
    align-items: baseline;
    gap: var(--space-2);
    min-width: 0;
}
.conversation-item__mobile-customer-name {
    font-weight: 600;
    font-size: var(--text-base);
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.conversation-item--unread .conversation-item__mobile-customer-name {
    font-weight: 700;
}
.conversation-item__mobile-message-count {
    font-size: var(--text-sm);
    color: var(--text-muted);
    flex-shrink: 0;
}
.conversation-item__mobile-time {
    font-size: var(--text-sm);
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}
.conversation-item__mobile-subject {
    font-weight: 600;
    font-size: var(--text-sm);
    color: var(--text);
    margin-bottom: var(--space-1);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.conversation-item--unread .conversation-item__mobile-subject {
    font-weight: 700;
}
.conversation-item__mobile-preview {
    font-size: var(--text-sm);
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.conversation-item__mobile-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-top: var(--space-3);
}
.conversation-tag {
    display: inline-block;
    padding: var(--space-1) var(--space-3);
    font-size: var(--text-sm);
    font-weight: 500;
    border-radius: var(--radius-sm);
}
/* ============================================
   List Toolbar
   ============================================ */
.list-toolbar {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-5);
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}
.search-wrapper {
    position: relative;
    max-width: 280px;
}
.search-wrapper svg {
    position: absolute;
    left: var(--space-2);
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}
.search-input {
    width: 100%;
    padding: var(--space-1) var(--space-2) var(--space-1) var(--space-6);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: var(--text-xs);
    background: var(--surface);
    color: var(--text);
    transition: border-color var(--duration-normal) var(--ease-default),
                box-shadow var(--duration-normal) var(--ease-default);
}
.search-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent);
}
.search-input::-moz-placeholder {
    color: var(--text-muted);
}
.search-input::placeholder {
    color: var(--text-muted);
}
/* ============================================
   Sort & Filter Dropdowns
   ============================================ */
.sort-dropdown {
    padding: var(--space-1) var(--space-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: var(--text-xs);
    background: var(--surface);
    color: var(--text-secondary);
    cursor: pointer;
}
.sort-dropdown .btn {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    border-color: var(--border);
    background: var(--surface);
}
.sort-dropdown .btn:hover {
    background: var(--bg);
    color: var(--text);
}
.filter-dropdown {
    padding: var(--space-1) var(--space-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: var(--text-xs);
    background: var(--surface);
    color: var(--text-secondary);
    cursor: pointer;
}
.filter-dropdown:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent);
}
.filter-dropdown--active {
    background: var(--selected);
    border-color: var(--text-muted);
    color: var(--text);
}
/* ============================================
   Mobile Filter Panel
   ============================================ */
.filter-trigger-mobile {
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    color: var(--text-secondary);
    cursor: pointer;
}
.filter-trigger-mobile:hover {
    border-color: var(--text-muted);
    color: var(--text);
}
.filter-trigger-mobile:focus-visible {
    outline: var(--focus-ring);
    outline-offset: var(--focus-ring-offset);
}
.filter-panel-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: var(--overlay-bg);
    z-index: var(--z-modal);
}
.filter-panel-overlay--visible {
    display: block;
}
.filter-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--surface);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    z-index: calc(var(--z-modal) + 1);
    transform: translateY(100%);
    transition: transform var(--duration-slow) var(--ease-default);
}
.filter-panel--visible {
    transform: translateY(0);
}
.filter-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4);
    border-bottom: 1px solid var(--border);
    font-weight: 600;
}
.filter-panel-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    background: none;
    color: var(--text-secondary);
    cursor: pointer;
}
.filter-panel-close:hover {
    color: var(--text);
}
.filter-panel-close:focus-visible {
    outline: var(--focus-ring);
    outline-offset: var(--focus-ring-offset);
}
.filter-panel-body {
    padding: var(--space-4);
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}
.filter-panel-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}
.filter-panel-label {
    font-size: var(--text-xs);
    font-weight: 500;
    color: var(--text-secondary);
}
.filter-panel-select {
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    background: var(--surface);
    color: var(--text);
}
.filter-panel-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent);
}
.filter-panel-footer {
    display: flex;
    gap: var(--space-3);
    padding: var(--space-4);
    border-top: 1px solid var(--border);
}
.btn-filter-clear {
    flex: 1;
    padding: var(--space-2) var(--space-4);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    color: var(--text-secondary);
    font-size: var(--text-sm);
    font-weight: 500;
    cursor: pointer;
}
.btn-filter-clear:hover {
    border-color: var(--text-muted);
    color: var(--text);
}
.btn-filter-clear:focus-visible {
    outline: var(--focus-ring);
    outline-offset: var(--focus-ring-offset);
}
.btn-filter-apply {
    flex: 1;
    padding: var(--space-2) var(--space-4);
    border: none;
    border-radius: var(--radius-md);
    background: var(--accent);
    color: white;
    font-size: var(--text-sm);
    font-weight: 500;
    cursor: pointer;
}
.btn-filter-apply:hover {
    background: var(--accent-hover);
}
.btn-filter-apply:focus-visible {
    outline: var(--focus-ring);
    outline-offset: var(--focus-ring-offset);
}
.toolbar-spacer {
    flex: 1;
}
/* ============================================
   Mobile Filter Bar
   ============================================ */
.mobile-filter-bar {
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-2) var(--space-4);
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}
.mobile-filter-label {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-secondary);
}
.mobile-sort-form {
    display: flex;
    align-items: center;
}
.mobile-sort-select {
    padding: var(--space-1) var(--space-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: var(--text-xs);
    background: var(--surface);
    color: var(--text-secondary);
    cursor: pointer;
}
.mobile-sort-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent);
}
/* ============================================
   Mobile Header
   ============================================ */
.mobile-header {
    display: none;
}
.mobile-header__menu {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: none;
    background: none;
    color: var(--accent);
    cursor: pointer;
}
.mobile-header__mailbox {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-1) var(--space-2);
    border: none;
    background: none;
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
}
.mobile-header__count {
    font-weight: 400;
    color: var(--text-muted);
}
.mobile-header__mailbox svg {
    color: var(--text-muted);
}
.mobile-header__bulk-trigger {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: none;
    background: none;
    color: var(--text);
    cursor: pointer;
    margin-left: auto;
}
/* ============================================
   Row Action Dropdowns
   ============================================ */
.row-action-dropdown {
    position: relative;
}
.row-action-dropdown__menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: var(--space-2);
    min-width: 200px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    z-index: 100;
    overflow: hidden;
}
.row-action-dropdown__menu--open {
    display: block;
}
.row-action-dropdown__menu--assignee {
    min-width: 240px;
}
.row-action-dropdown__search {
    padding: var(--space-3);
    border-bottom: 1px solid var(--border);
}
.row-action-dropdown__search-input {
    width: 100%;
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    background: var(--surface);
    color: var(--text);
    transition: border-color var(--duration-fast) var(--ease-default),
                box-shadow var(--duration-fast) var(--ease-default);
}
.row-action-dropdown__search-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent);
}
.row-action-dropdown__search-input::-moz-placeholder {
    color: var(--text-muted);
}
.row-action-dropdown__search-input::placeholder {
    color: var(--text-muted);
}
.row-action-dropdown__label {
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.row-action-dropdown__list {
    max-height: 240px;
    overflow-y: auto;
}
.row-action-dropdown__item {
    display: block;
}
.row-action-dropdown__item--active .row-action-dropdown__button {
    background: var(--selected);
}
.row-action-dropdown__button {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    width: 100%;
    padding: var(--space-3) var(--space-4);
    border: none;
    background: none;
    color: var(--text);
    font-size: var(--text-sm);
    text-align: left;
    cursor: pointer;
    transition: background var(--duration-fast) var(--ease-default);
}
.row-action-dropdown__button:hover {
    background: var(--bg);
}
.row-action-dropdown__avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: var(--accent);
    color: white;
    border-radius: 50%;
    font-size: var(--text-xs);
    font-weight: 600;
    flex-shrink: 0;
}
.row-action-dropdown__name {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.row-action-dropdown__empty {
    display: none;
    padding: var(--space-4);
    text-align: center;
    color: var(--text-muted);
    font-size: var(--text-sm);
}
/* Property column styling */
.ticket-header-prop {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.conversation-item__property {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
#conversations + .empty-state {
    display: none;
}
#conversations:empty + .empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    padding: var(--space-8);
    text-align: center;
    color: var(--text-muted);
    flex: 1;
}
#conversations:empty + .empty-state i {
    font-size: 48px;
    opacity: 0.4;
}
#conversations:empty + .empty-state p {
    margin: 0;
    font-size: var(--text-base);
    font-weight: 500;
    color: var(--text-secondary);
}
#conversations:empty + .empty-state span {
    font-size: var(--text-sm);
}
[data-theme="dark"] .conversation-item__actions {
    background: var(--surface-raised);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}
[data-theme="dark"] .row-action-dropdown__menu {
    background: var(--surface-raised);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}
/* ============================================
   Conversation Detail Layout
   ============================================ */
.conversation-detail {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}
.conversation-detail--closed .composer {
    display: none;
}
.conversation-detail--closed .detail-header .action-buttons__item:not(.action-buttons__icon) {
    display: none;
}
.conversation-detail--closed .detail-header .dropdown {
    display: none;
}
/* ============================================
   Detail Header
   ============================================ */
.detail-header {
    padding: var(--space-4) var(--space-5);
    padding-top: var(--space-5);
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}
.detail-subject {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-2);
    font-size: var(--text-xl);
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: var(--space-2);
    color: var(--text);
}
.detail-subject__number {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-muted);
    background: var(--bg);
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-sm);
}
.detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-bottom: var(--space-2);
}
.detail-tag {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-1) var(--space-2);
    font-size: var(--text-sm);
    font-weight: 500;
    border-radius: var(--radius-sm);
    white-space: nowrap;
}
.detail-tag__remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    margin-left: var(--space-1);
    background: none;
    border: none;
    cursor: pointer;
    opacity: 0.6;
    color: inherit;
    border-radius: var(--radius-sm);
    transition: opacity var(--duration-fast) var(--ease-default);
}
.detail-tag__remove:hover {
    opacity: 1;
}
.detail-tag__remove:focus-visible {
    outline: var(--focus-ring);
    outline-offset: var(--focus-ring-offset);
}
.detail-meta {
    font-size: var(--text-xs);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}
.detail-meta span + span::before {
    content: ' · ';
    margin-right: var(--space-1);
}
.customer-link {
    color: var(--accent);
    cursor: pointer;
}
.customer-link:hover {
    text-decoration: underline;
}
.customer-link:focus-visible {
    outline: var(--focus-ring);
    outline-offset: var(--focus-ring-offset);
}
/* ============================================
   Presence Indicator
   ============================================ */
.presence-indicator {
    display: none;
    padding: var(--space-2) var(--space-5);
    background: var(--selected);
    border-bottom: 1px solid var(--border);
    font-size: var(--text-xs);
    color: var(--text-secondary);
}
.presence-indicator--visible {
    display: block;
}
/* ============================================
   Closed Banner
   ============================================ */
.closed-banner,
.draft-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-3) var(--space-5);
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    font-size: var(--text-sm);
}
.closed-banner-info,
.draft-banner-info {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--text-secondary);
}
.closed-banner-icon,
.draft-banner-icon {
    color: var(--text-muted);
}
.draft-banner-actions {
    display: flex;
    gap: var(--space-2);
}
.btn-reopen {
    font-size: var(--text-xs);
    padding: var(--space-1) var(--space-3);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text);
    cursor: pointer;
    transition: background var(--duration-normal) var(--ease-default);
}
.btn-reopen:hover {
    background: var(--selected);
    border-color: var(--text-muted);
}
.btn-reopen:focus-visible {
    outline: var(--focus-ring);
    outline-offset: var(--focus-ring-offset);
}
/* ============================================
   Attention Banner
   ============================================ */
.attention-banner {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-4);
    padding: var(--space-4) var(--space-5);
    background: rgba(220, 38, 38, 0.08);
    border-bottom: 2px solid var(--danger);
}
.attention-banner-info {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    color: var(--danger);
    flex: 1;
}
.attention-banner-icon {
    flex-shrink: 0;
    margin-top: 2px;
}
.attention-banner-text {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}
.attention-banner-text strong {
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    font-size: var(--text-sm);
}
.attention-banner-details {
    color: var(--text-secondary);
    font-size: var(--text-xs);
    font-family: var(--font-mono, monospace);
    background: var(--surface);
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-sm);
    max-width: 500px;
    word-break: break-word;
}
.attention-banner-help {
    color: var(--text-secondary);
    font-size: var(--text-sm);
    margin-top: var(--space-1);
}
.attention-banner-actions {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex-shrink: 0;
}
.btn-attention-action {
    font-size: var(--text-xs);
    padding: var(--space-1) var(--space-3);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text);
    cursor: pointer;
    font-weight: 500;
    text-decoration: none;
}
.btn-attention-action:hover {
    background: var(--selected);
    border-color: var(--text-muted);
}
.btn-attention-action:focus-visible {
    outline: var(--focus-ring);
    outline-offset: var(--focus-ring-offset);
}
.btn-attention-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}
.btn-attention-primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    color: white;
}
.btn-attention-dismiss {
    font-size: var(--text-xs);
    padding: var(--space-1) var(--space-3);
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    cursor: pointer;
    font-weight: 500;
}
.btn-attention-dismiss:hover {
    background: var(--surface);
    color: var(--text-secondary);
}
.btn-attention-dismiss:focus-visible {
    outline: var(--focus-ring);
    outline-offset: var(--focus-ring-offset);
}
[data-theme="dark"] .attention-banner {
    background: rgba(239, 68, 68, 0.12);
}
/* ============================================
   Message Thread
   ============================================ */
.thread {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-6) var(--space-6);
}
.message {
    margin-bottom: var(--space-4);
}
.message-header {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-1);
}
/* ============================================
   Avatar Component (Consolidated)
   ============================================ */
.avatar,
.message-avatar,
.author-avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--text-secondary);
    flex-shrink: 0;
}
.avatar--agent,
.message-avatar--agent,
.author-avatar--agent {
    background: var(--accent);
    color: white;
}
.avatar-lg,
.avatar-large {
    width: 40px;
    height: 40px;
    font-size: var(--text-sm);
}
.message-name {
    font-weight: 500;
    color: var(--text);
}
.message-time {
    font-size: var(--text-xs);
    color: var(--text-muted);
}
.message-name + .message-time::before {
    content: '·';
    margin: 0 6px;
    color: var(--text-muted);
}
.message-link-btn {
    background: none;
    border: none;
    padding: var(--space-1);
    cursor: pointer;
    color: var(--text-muted);
    opacity: 0.4;
    transition: opacity var(--duration-normal);
    display: inline-flex;
    align-items: center;
    border-radius: var(--radius-sm);
    font-size: var(--text-xs);
}
@media (hover: hover) {
    .message-link-btn {
        opacity: 0;
    }

    .message:hover .message-link-btn,
    .message-card:hover .message-link-btn {
        opacity: 1;
    }
}
.message-link-btn:hover,
.message-link-btn:active {
    color: var(--accent);
    background: var(--bg);
    opacity: 1;
}
.message-link-btn:focus-visible {
    outline: var(--focus-ring);
    outline-offset: var(--focus-ring-offset);
    opacity: 1;
}
.message--highlighted,
.message-card--highlighted,
.highlighted {
    animation: highlight-pulse 3s ease-out forwards;
    border-radius: var(--radius-lg);
}
@keyframes highlight-pulse {
    0% {
        background: color-mix(in srgb, var(--accent) 40%, transparent);
        box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 25%, transparent);
    }
    15% {
        background: color-mix(in srgb, var(--accent) 30%, transparent);
        box-shadow: 0 0 0 8px color-mix(in srgb, var(--accent) 15%, transparent);
    }
    30% {
        background: color-mix(in srgb, var(--accent) 25%, transparent);
        box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 10%, transparent);
    }
    100% {
        background: transparent;
        box-shadow: 0 0 0 0 transparent;
    }
}
/* ============================================
   Message Body
   ============================================ */
.message-body {
    padding: var(--space-5);
    background: var(--bg);
    border-radius: var(--radius-lg);
    margin-top: var(--space-3);
    line-height: 1.6;
    font-size: var(--text-sm);
    max-width: 80ch;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.message-body p {
    margin: 0 0 var(--space-3) 0;
}
.message-body p:last-child {
    margin-bottom: 0;
}
.message-body a {
    color: var(--accent);
}
.message-body a:hover {
    text-decoration: underline;
}
.message--agent .message-body {
    background: var(--surface);
    border: 1px solid var(--border);
}
.message--note .message-body {
    background: #fefce8;
    border: 1px solid var(--note-border);
    border-left: 3px solid var(--warning);
}
[data-theme="dark"] .message--note .message-body {
    background: rgba(250, 204, 21, 0.08);
}
.message--note .message-name::after {
    content: 'Note';
    font-size: var(--text-xs);
    font-weight: 500;
    color: var(--text-muted);
    background: var(--surface);
    padding: var(--space-1) var(--space-1);
    border-radius: var(--radius-sm);
    margin-left: var(--space-2);
}
/* ============================================
   Draft Message
   ============================================ */
.message--draft {
    opacity: 0.8;
}
.message--draft .message-body {
    background: var(--surface);
    border: 2px dashed var(--border);
    position: relative;
}
.message-draft-badge {
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--warning);
    background: color-mix(in srgb, var(--warning) 15%, transparent);
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-sm);
    margin-left: var(--space-2);
    text-transform: uppercase;
    letter-spacing: 0.025em;
}
.draft-actions {
    margin-top: var(--space-3);
    display: flex;
    gap: var(--space-2);
}
.message-scheduled {
    font-size: var(--text-xs);
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    margin-left: var(--space-2);
}
.btn-send-now,
.btn-cancel-send {
    background: none;
    border: none;
    font-size: var(--text-xs);
    cursor: pointer;
    padding: var(--space-1) var(--space-1);
    border-radius: var(--radius-sm);
}
.btn-send-now {
    color: var(--accent);
}
.btn-send-now:hover {
    background: var(--bg);
    text-decoration: underline;
}
.btn-send-now:focus-visible {
    outline: var(--focus-ring);
    outline-offset: var(--focus-ring-offset);
}
.btn-cancel-send {
    color: var(--text-muted);
}
.btn-cancel-send:hover {
    color: var(--danger);
    background: var(--bg);
}
.btn-cancel-send:focus-visible {
    outline: var(--focus-ring);
    outline-offset: var(--focus-ring-offset);
}
/* ============================================
   Help Scout Layout
   ============================================ */
.thread--helpscout {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    max-width: 900px;
}
.thread--helpscout .message-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.thread--helpscout .message-card--customer {
    border-left: 3px solid var(--accent);
}
.thread--helpscout .message-card--note {
    background: var(--note-bg);
    border: 2px dashed var(--note-border);
}
.thread--helpscout .message-card--draft {
    opacity: 0.8;
    border: 2px dashed var(--border);
}
.thread--helpscout .message-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--border);
}
.thread--helpscout .message-card--note .message-card-header {
    border-bottom-color: var(--note-border);
}
.thread--helpscout .author-info {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}
.thread--helpscout .author-name {
    font-weight: 500;
}
.thread--helpscout .note-badge {
    font-size: var(--text-xs);
    font-weight: 500;
    color: var(--text-muted);
    background: var(--surface);
    padding: var(--space-1) var(--space-1);
    border-radius: var(--radius-sm);
}
.thread--helpscout .message-card--note .note-badge {
    background: var(--surface-alpha);
}
.thread--helpscout .draft-badge {
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--warning);
    background: color-mix(in srgb, var(--warning) 15%, transparent);
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.025em;
}
.thread--helpscout .header-right {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}
.thread--helpscout .timestamp {
    font-size: var(--text-xs);
    color: var(--text-muted);
}
.thread--helpscout .message-card-body {
    padding: var(--space-5);
    line-height: 1.6;
    font-size: var(--text-sm);
    max-width: 80ch;
}
.thread--helpscout .message-card-body p:first-child {
    margin-top: 0;
}
.thread--helpscout .message-card-body p:last-child {
    margin-bottom: 0;
}
.thread--helpscout .message-attachments {
    margin-top: var(--space-4);
    padding-top: var(--space-4);
    border-top: 1px solid var(--border);
}
.thread--helpscout .message-card-actions {
    padding: var(--space-3) var(--space-5);
    border-top: 1px solid var(--border);
    display: flex;
    gap: var(--space-2);
}
.message-attachments {
    margin-top: var(--space-3);
}
.message-attachments__item {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    max-width: 100%;
}
.message-attachments__icon {
    flex-shrink: 0;
}
.message-attachments__name {
    max-width: 28ch;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.message-attachments__size {
    color: var(--text-muted);
    font-size: var(--text-xs);
}
/* ============================================
   Composer Component
   ============================================ */
.composer {
    border-top: 1px solid var(--border);
    padding: var(--space-4) var(--space-5);
    background: var(--surface);
    box-shadow: 0 -1px 4px rgba(0, 0, 0, 0.03);
}
.composer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-3);
}
.composer-toggle {
    margin-bottom: 0;
}
.composer-toggle .btn {
    font-size: var(--text-xs);
    padding: 6px var(--space-3);
    border-radius: var(--radius-md);
    transition: all var(--duration-normal) var(--ease-default);
}
.composer-toggle .btn-check:checked + .btn {
    background: var(--text);
    border-color: var(--text);
    color: white;
}
.composer-toggle .btn-check:checked + .btn.btn-note {
    background: var(--warning);
    border-color: var(--warning);
    color: white;
}
.composer-body-wrapper .ql-editor {
    height: 35vh;
}
.composer-body-wrapper .ql-container:focus-within {
    border-color: var(--border);
}
.composer-body-wrapper .ql-editor:focus {
    outline: none;
}
.composer-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: var(--space-3);
}
/* ============================================
   Attach Button
   ============================================ */
.btn-attach {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-1) var(--space-2);
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: var(--text-xs);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--duration-normal) var(--ease-default);
}
.btn-attach:hover {
    border-color: var(--text-muted);
    color: var(--text);
    background: var(--bg);
}
.btn-attach:focus-visible {
    outline: var(--focus-ring);
    outline-offset: var(--focus-ring-offset);
}
.btn-attach svg {
    flex-shrink: 0;
}
/* ============================================
   Saved Replies Picker
   ============================================ */
.saved-replies-picker {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    max-height: 240px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    margin-bottom: var(--space-2);
    z-index: var(--z-dropdown);
}
.saved-replies-picker.d-none {
    display: none;
}
.saved-replies-search {
    padding: var(--space-2) var(--space-3);
    border-bottom: 1px solid var(--border);
}
.saved-replies-search input {
    width: 100%;
    border: none;
    background: var(--bg);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-md);
    font-size: var(--text-xs);
}
.saved-replies-search input:focus {
    outline: none;
}
.saved-replies-list {
    max-height: 180px;
    overflow-y: auto;
}
.saved-reply-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    width: 100%;
    padding: var(--space-2) var(--space-3);
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    font-size: var(--text-xs);
}
.saved-reply-item:hover,
.saved-reply-item.selected {
    background: var(--bg);
}
.saved-reply-item:focus-visible {
    outline: var(--focus-ring);
    outline-offset: -2px;
}
.saved-reply-shortcut {
    font-family: monospace;
    color: var(--accent);
    min-width: 4rem;
}
.saved-reply-name {
    color: var(--text);
}
.saved-replies-empty {
    padding: var(--space-4);
    text-align: center;
    color: var(--text-muted);
    font-size: var(--text-xs);
}
.saved-replies-empty a {
    color: var(--accent);
}
.draft-status {
    font-size: var(--text-xs);
    color: var(--text-muted);
}
/* ============================================
   Compose Input
   ============================================ */
.compose-input {
    width: 100%;
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    background: var(--surface);
    color: var(--text);
    transition: border-color var(--duration-normal) var(--ease-default),
                box-shadow var(--duration-normal) var(--ease-default);
}
.compose-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent);
}
.compose-input::-moz-placeholder {
    color: var(--text-muted);
}
.compose-input::placeholder {
    color: var(--text-muted);
}
/* ============================================
   Browse Customers Button
   ============================================ */
.btn-browse-customers {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    color: var(--text-secondary);
    cursor: pointer;
    flex-shrink: 0;
    transition: border-color var(--duration-normal) var(--ease-default),
                color var(--duration-normal) var(--ease-default);
}
.btn-browse-customers:hover {
    border-color: var(--text-muted);
    color: var(--text);
}
.btn-browse-customers:focus-visible {
    outline: var(--focus-ring);
    outline-offset: var(--focus-ring-offset);
}
/* ============================================
   New Conversation Page
   ============================================ */
.new-conversation-layout {
    flex: 1;
    display: flex;
    background: var(--bg);
    overflow: hidden;
}
.new-conversation-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: var(--space-6);
    overflow-y: auto;
    min-width: 0;
}
.new-conversation-layout .customer-sidebar {
    width: 280px;
    flex-shrink: 0;
    border-left: 1px solid var(--border);
    background: var(--surface);
    overflow-y: auto;
}
.new-conversation-layout .customer-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: var(--space-6);
    text-align: center;
    color: var(--text-muted);
    font-size: var(--text-sm);
}
@media (max-width: 1024px) {
    .new-conversation-layout .customer-sidebar {
        display: none;
    }
}
.new-conversation-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: var(--space-5);
}
.new-conversation-meta {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    flex: 1;
}
.conversation-number {
    font-size: var(--text-sm);
    color: var(--text-muted);
}
.new-conversation-subject-input {
    font-size: var(--text-xl);
    font-weight: 600;
    border: none;
    border-bottom: 1px solid var(--border);
    background: transparent;
    padding: 0 0 var(--space-2) 0;
    color: var(--text);
    width: 100%;
    min-width: 300px;
    transition: border-color var(--duration-normal) var(--ease-default);
}
.new-conversation-subject-input:focus {
    outline: none;
    border-bottom-color: var(--accent);
}
.new-conversation-subject-input.is-invalid {
    border-bottom-color: var(--danger);
}
.new-conversation-subject-input::-moz-placeholder {
    color: var(--text-muted);
}
.new-conversation-subject-input::placeholder {
    color: var(--text-muted);
}
.new-conversation-form {
    flex: 1;
    display: flex;
    flex-direction: column;
}
/* ============================================
   Composer Card
   ============================================ */
.composer-card {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    flex: 1;
}
.composer-card-actions {
    position: absolute;
    top: var(--space-4);
    right: var(--space-4);
    display: flex;
    gap: var(--space-2);
}
.composer-card-action {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: color var(--duration-normal) var(--ease-default),
                background var(--duration-normal) var(--ease-default);
}
.composer-card-action:hover {
    color: var(--text);
    background: var(--bg);
}
.composer-card-action:focus-visible {
    outline: var(--focus-ring);
    outline-offset: var(--focus-ring-offset);
}
/* ============================================
   Composer Card Fields
   ============================================ */
.composer-card-fields {
    padding: var(--space-5) var(--space-5) var(--space-3);
    padding-right: 100px;
}
.composer-field-row {
    display: flex;
    align-items: center;
    padding: var(--space-2) 0;
    border-bottom: 1px solid var(--border-subtle, #f0f0f0);
}
.composer-field-row:last-child {
    border-bottom: none;
}
.composer-field-label {
    width: 40px;
    flex-shrink: 0;
    font-size: var(--text-sm);
    color: var(--text-secondary);
}
.composer-field-content {
    flex: 1;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-2);
}
.composer-field-input {
    flex: 1;
    min-width: 100px;
    border: none;
    background: transparent;
    padding: var(--space-1) 0;
    font-size: var(--text-sm);
    color: var(--text);
}
.composer-field-input:focus {
    outline: none;
}
.composer-field-input::-moz-placeholder {
    color: var(--text-muted);
}
.composer-field-input::placeholder {
    color: var(--text-muted);
}
/* ============================================
   Email Chips
   ============================================ */
.recipient-chips {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}
.email-chip {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-1) var(--space-2) var(--space-1) var(--space-3);
    background: var(--accent);
    color: white;
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
}
.email-chip-remove {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    padding: 0;
    border: none;
    background: transparent;
    color: white;
    opacity: 0.7;
    cursor: pointer;
    border-radius: var(--radius-sm);
    font-size: var(--text-xs);
}
.email-chip-remove:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.2);
}
/* ============================================
   Composer Card Body
   ============================================ */
.composer-card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 0 var(--space-5) var(--space-5) var(--space-5);
    position: relative;
    min-height: 200px;
    padding-bottom: var(--space-5) !important;
}
.composer-card-body .ql-editor {
    height: 35vh;
}
.lexxy-editor__content { padding-bottom: 2em; }
.composer-editor-footer {
    padding-bottom: 0px !important;
    padding-left: 1ch !important;
    position: relative;
    box-shadow: 0 1px var(--lexxy-color-ink-lighter), -1px 1px var(--lexxy-color-ink-lighter);
    margin-top: -40px;
    margin-left: 1px;
    margin-right: 1px;
    margin-bottom: 1px;
    display: flex;
    align-items: center;
    padding: var(--space-3) var(--space-4);
    background: var(--surface);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    z-index: 10;
}
.composer-signature {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    opacity: 0.75;

}
/* ============================================
   Composer Card Toolbar
   ============================================ */
.composer-card-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4) var(--space-5);
    border-top: 1px solid var(--border);
}
.composer-toolbar-left {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}
.composer-toolbar-right {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}
.btn-insert {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-2) var(--space-3);
    background: transparent;
    border: 1px solid var(--accent);
    border-radius: var(--radius-full);
    font-size: var(--text-sm);
    color: var(--accent);
    cursor: pointer;
    transition: all var(--duration-normal) var(--ease-default);
}
.btn-insert:hover {
    background: var(--accent);
    color: white;
}
.btn-insert:focus-visible {
    outline: var(--focus-ring);
    outline-offset: var(--focus-ring-offset);
}
.btn-status {
    padding: var(--space-2) var(--space-3);
    background: var(--text);
    border: none;
    border-radius: var(--radius-full);
    font-size: var(--text-sm);
    color: white;
    cursor: pointer;
}
.btn-status:hover {
    opacity: 0.9;
}
.btn-status:focus-visible {
    outline: var(--focus-ring);
    outline-offset: var(--focus-ring-offset);
}
.btn-status::after {
    display: inline-block;
    margin-left: var(--space-1);
    vertical-align: middle;
    content: "";
    border-top: 0.3em solid;
    border-right: 0.3em solid transparent;
    border-bottom: 0;
    border-left: 0.3em solid transparent;
}
.btn-toolbar-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    background: var(--surface);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--duration-normal) var(--ease-default);
}
.btn-toolbar-icon:hover {
    border-color: var(--text-muted);
    color: var(--text);
}
.btn-toolbar-icon:focus-visible {
    outline: var(--focus-ring);
    outline-offset: var(--focus-ring-offset);
}
.btn-toolbar-icon::after {
    display: none;
}
/* ============================================
   Send Button Group
   ============================================ */
.btn-send-group {
    display: flex;
    position: relative;
}
.btn-send-group .dropdown {
    display: flex;
}
.btn-send-main {
    padding: var(--space-2) var(--space-4);
    background: var(--accent);
    border: none;
    border-radius: var(--radius-md) 0 0 var(--radius-md);
    font-size: var(--text-sm);
    font-weight: 500;
    color: white;
    cursor: pointer;
    transition: background var(--duration-normal) var(--ease-default);
}
.btn-send-main:hover {
    background: var(--accent-hover, color-mix(in srgb, var(--accent) 85%, black));
}
.btn-send-main:focus-visible {
    outline: var(--focus-ring);
    outline-offset: var(--focus-ring-offset);
}
.btn-send-dropdown {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-2) var(--space-2);
    background: var(--accent);
    border: none;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    color: white;
    cursor: pointer;
    transition: background var(--duration-normal) var(--ease-default);
}
.btn-send-dropdown:hover {
    background: var(--accent-hover, color-mix(in srgb, var(--accent) 85%, black));
}
.btn-send-dropdown:focus-visible {
    outline: var(--focus-ring);
    outline-offset: var(--focus-ring-offset);
}
.btn-send-dropdown::after {
    display: none;
}
/* ============================================
   Assignee Button
   ============================================ */
.btn-assignee {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    font-size: var(--text-sm);
    color: var(--text);
    cursor: pointer;
    transition: all var(--duration-normal) var(--ease-default);
}
.btn-assignee:hover {
    border-color: var(--text-muted);
    background: var(--bg);
}
.btn-assignee:focus-visible {
    outline: var(--focus-ring);
    outline-offset: var(--focus-ring-offset);
}
.btn-assignee::after {
    display: inline-block;
    margin-left: var(--space-1);
    vertical-align: middle;
    content: "";
    border-top: 0.3em solid;
    border-right: 0.3em solid transparent;
    border-bottom: 0;
    border-left: 0.3em solid transparent;
}
.btn-assignee svg {
    flex-shrink: 0;
}
/* ============================================
   Saved Replies Picker (Inline)
   ============================================ */
.composer-toolbar-left {
    position: relative;
}
.saved-replies-picker {
    position: absolute;
    bottom: 100%;
    left: 0;
    margin-bottom: var(--space-2);
    width: 320px;
    max-height: 300px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    z-index: var(--z-dropdown);
}
.saved-replies-search {
    padding: var(--space-3);
    border-bottom: 1px solid var(--border);
}
.saved-replies-search input {
    width: 100%;
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    background: var(--bg);
}
.saved-replies-search input:focus {
    outline: none;
    border-color: var(--accent);
}
.saved-replies-list {
    max-height: 220px;
    overflow-y: auto;
}
.saved-reply-item {
    display: block;
    width: 100%;
    padding: var(--space-3);
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
    transition: background var(--duration-fast) var(--ease-default);
}
.saved-reply-item:hover,
.saved-reply-item.selected {
    background: var(--bg);
}
.saved-reply-name {
    font-weight: 500;
    font-size: var(--text-sm);
    color: var(--text);
}
.saved-replies-empty {
    padding: var(--space-4);
    text-align: center;
    color: var(--text-muted);
    font-size: var(--text-sm);
}
/* ============================================
   Reply Button (collapsed state)
   ============================================ */
.composer-reply-btn {
    display: block;
    width: 100%;
    padding: var(--space-4);
    background: var(--surface);
    border: none;
    border-top: 1px solid var(--border);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    text-align: left;
    transition: background var(--duration-normal) var(--ease-default),
                color var(--duration-normal) var(--ease-default);
}
.composer-reply-btn:hover {
    background: var(--bg);
    color: var(--text);
}
/* ============================================
   Forward Composer
   ============================================ */
.composer--forward {
    padding-top: var(--space-3);
}
.composer__forward-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-3);
    padding-bottom: var(--space-3);
    border-bottom: 1px solid var(--border);
}
.composer__forward-field {
    display: flex;
    align-items: center;
    flex: 1;
    gap: var(--space-3);
}
.composer__forward-label {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-secondary);
    flex-shrink: 0;
}
.composer__forward-input {
    flex: 1;
    max-width: 320px;
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    background: var(--surface);
    color: var(--text);
    transition: border-color var(--duration-normal) var(--ease-default),
                box-shadow var(--duration-normal) var(--ease-default);
}
.composer__forward-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent);
}
.composer__forward-input::-moz-placeholder {
    color: var(--text-muted);
}
.composer__forward-input::placeholder {
    color: var(--text-muted);
}
.composer-textarea {
    width: 100%;
    min-height: 120px;
    padding: var(--space-3);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-family: inherit;
    background: var(--surface);
    color: var(--text);
    resize: vertical;
    transition: border-color var(--duration-normal) var(--ease-default),
                box-shadow var(--duration-normal) var(--ease-default);
}
.composer-textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent);
}
.composer-textarea::-moz-placeholder {
    color: var(--text-muted);
}
.composer-textarea::placeholder {
    color: var(--text-muted);
}
[data-theme="dark"] .btn-status {
    background: var(--surface-raised);
    border: 1px solid var(--border);
    color: var(--text);
}
[data-theme="dark"] .btn-status:hover {
    background: var(--selected);
    opacity: 1;
}
[data-theme="dark"] .saved-replies-picker {
    background: var(--surface-raised);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}
/* ============================================
   Composer Attachments
   ============================================ */
.composer-attachments:empty {
    display: none;
}
.composer-attachments {
    padding: var(--space-2) var(--space-3) 0;
}
.composer-attachments__chip {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    max-width: 100%;
    font-weight: 400;
}
.composer-attachments__name {
    max-width: 28ch;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.composer-attachments__size {
    color: var(--text-muted);
}
.composer-attachments__remove {
    font-size: 0.6rem;
}
.composer-attachments__errors:not(:empty) {
    margin-top: var(--space-2);
}
/* ============================================
   Customer Picker Modal
   ============================================ */
.customer-picker-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: var(--overlay-bg);
    z-index: calc(var(--z-modal) + 1);
}
.customer-picker-overlay--visible {
    display: block;
}
.customer-picker {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    width: 90%;
    max-width: 480px;
    max-height: 80vh;
    background: var(--surface);
    border-radius: var(--radius-xl);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    z-index: calc(var(--z-modal) + 2);
    display: none;
    flex-direction: column;
    opacity: 0;
    transition: opacity var(--duration-normal) var(--ease-default),
                transform var(--duration-normal) var(--ease-default);
}
.customer-picker--visible {
    display: flex;
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}
.customer-picker-header {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4);
    border-bottom: 1px solid var(--border);
    color: var(--text-muted);
}
.customer-picker-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: var(--text-base);
    color: var(--text);
    outline: none;
}
.customer-picker-input::-moz-placeholder {
    color: var(--text-muted);
}
.customer-picker-input::placeholder {
    color: var(--text-muted);
}
.customer-picker-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    background: none;
    color: var(--text-muted);
    cursor: pointer;
}
.customer-picker-close:hover {
    color: var(--text);
}
.customer-picker-close:focus-visible {
    outline: var(--focus-ring);
    outline-offset: var(--focus-ring-offset);
}
.customer-picker-results {
    flex: 1;
    overflow-y: auto;
    max-height: 400px;
}
.customer-picker-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    width: 100%;
    padding: var(--space-3) var(--space-4);
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
    transition: background var(--duration-fast) var(--ease-default);
}
.customer-picker-item:hover {
    background: var(--bg);
}
.customer-picker-item--selected {
    background: var(--selected);
}
.customer-picker-item:focus-visible {
    outline: var(--focus-ring);
    outline-offset: -2px;
}
.customer-picker-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: var(--border);
    color: var(--text-secondary);
    font-size: var(--text-xs);
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.customer-picker-info {
    flex: 1;
    min-width: 0;
}
.customer-picker-name {
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.customer-picker-email {
    font-size: var(--text-xs);
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.customer-picker-company {
    font-size: var(--text-xs);
    color: var(--text-muted);
    flex-shrink: 0;
}
/* Mobile: slide-up sheet */
@media (max-width: 640px) {
    .customer-picker {
        display: flex;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-width: none;
        max-height: 85vh;
        transform: translateY(100%);
        border-radius: var(--radius-xl) var(--radius-xl) 0 0;
        opacity: 1;
        visibility: hidden;
        transition: transform 0.3s var(--ease-default), visibility 0.3s;
    }

    .customer-picker--visible {
        transform: translateY(0);
        visibility: visible;
    }

    .customer-picker-header {
        position: relative;
        padding: var(--space-5) var(--space-5) var(--space-4);
    }

    .customer-picker-header::before {
        content: "";
        position: absolute;
        top: var(--space-3);
        left: 50%;
        transform: translateX(-50%);
        width: 36px;
        height: 4px;
        background: var(--border);
        border-radius: 2px;
    }

    .customer-picker-results {
        max-height: none;
    }

    .customer-picker-item {
        padding: var(--space-4) var(--space-5);
    }
}
/* ============================================
   Customer Sidebar (Desktop)
   ============================================ */
.customer-sidebar {
    width: 280px;
    border-left: 1px solid var(--border);
    background: var(--surface);
    flex-shrink: 0;
    overflow-y: auto;
    position: relative;
}
.customer-sidebar .resize-handle {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    cursor: ew-resize;
    background: transparent;
}
.customer-sidebar .resize-handle:hover {
    background: var(--accent);
}
.customer-sidebar--collapsed {
    width: 0;
    overflow: hidden;
    border-left: none;
}
.customer-header {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-4);
    border-bottom: 1px solid var(--border);
}
.customer-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-secondary);
    flex-shrink: 0;
}
.customer-header-info {
    flex: 1;
    min-width: 0;
}
.customer-name-row {
    display: flex;
    align-items: center;
    gap: var(--space-1);
}
.customer-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.customer-edit-btn {
    opacity: 0.5;
    transition: opacity var(--duration-fast);
}
.customer-edit-btn:hover,
.customer-header:hover .customer-edit-btn {
    opacity: 1;
}
.customer-email {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}
.customer-company {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
}
.customer-company a {
    font-size: 12px;
    color: var(--accent);
}
.customer-company a:hover {
    text-decoration: underline;
}
.customer-company-empty {
    font-size: 12px;
    color: var(--text-muted);
}
.btn-icon-inline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    padding: 0;
    border: none;
    background: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius-sm);
    opacity: 0;
    transition: opacity var(--duration-fast);
}
.customer-company:hover .btn-icon-inline,
.customer-company-empty + .btn-icon-inline {
    opacity: 1;
}
.btn-icon-inline:hover {
    background: var(--bg);
    color: var(--text);
}
/* ============================================
   Key Info Section
   ============================================ */
.customer-key-info {
    display: flex;
    gap: var(--space-4);
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--border);
    background: var(--bg);
}
.key-info-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.key-info-label {
    font-size: 11px;
    color: var(--text-muted);
}
.key-info-value {
    font-size: 12px;
    font-weight: 500;
    color: var(--text);
}
.customer-section {
    padding: var(--space-2) var(--space-3);
    border-bottom: 1px solid var(--border);
}
.customer-section:last-child {
    border-bottom: none;
}
.customer-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-2);
}
.customer-section-header .customer-section-title {
    margin-bottom: 0;
}
.customer-section-title {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: var(--space-2);
}
.section-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    opacity: 0.5;
    transition: opacity var(--duration-fast), background var(--duration-fast);
}
.section-link:hover {
    opacity: 1;
    background: var(--bg);
    color: var(--accent);
}
.customer-detail {
    display: flex;
    justify-content: space-between;
    font-size: var(--text-xs);
    margin-bottom: var(--space-1);
}
.customer-detail:last-child {
    margin-bottom: 0;
}
.customer-detail-label {
    color: var(--text-muted);
}
.prev-convo {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: var(--space-2);
    padding: 6px 0;
    color: var(--text);
    text-decoration: none;
    font-size: 12px;
    border-radius: var(--radius-sm);
}
.prev-convo > div:first-child {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.prev-convo:hover {
    color: var(--accent);
}
.prev-convo:focus-visible {
    outline: var(--focus-ring);
    outline-offset: var(--focus-ring-offset);
}
.prev-convo-date {
    font-size: 11px;
    color: var(--text-muted);
    flex-shrink: 0;
}
.customer-view-full {
    display: block;
    text-align: center;
    margin: var(--space-3) var(--space-4);
    padding: 8px var(--space-4);
    font-size: 12px;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}
.customer-view-full:hover {
    background: var(--bg);
    color: var(--text);
    text-decoration: none;
}
.customer-view-full:focus-visible {
    outline: var(--focus-ring);
    outline-offset: var(--focus-ring-offset);
}
/* ============================================
   Bottom Sheet (Mobile)
   ============================================ */
.bottom-sheet-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: var(--overlay-bg);
    z-index: var(--z-sticky);
    opacity: 0;
    transition: opacity var(--duration-slow) var(--ease-default);
}
.bottom-sheet-overlay--visible {
    display: block;
    opacity: 1;
}
.bottom-sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--surface);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    z-index: calc(var(--z-sticky) + 1);
    transform: translateY(100%);
    transition: transform 0.3s var(--ease-default);
    max-height: 85vh;
    overflow-y: auto;
}
.bottom-sheet--visible {
    transform: translateY(0);
}
.bottom-sheet-handle {
    width: 36px;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    margin: var(--space-3) auto;
}
.bottom-sheet-header {
    padding: var(--space-4) var(--space-5) var(--space-5);
    text-align: center;
    border-bottom: 1px solid var(--border);
}
.bottom-sheet-avatar {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-full);
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-xl);
    font-weight: 600;
    color: var(--text-secondary);
    margin: 0 auto var(--space-3);
}
.bottom-sheet-name {
    font-weight: 600;
    font-size: var(--text-lg);
    margin-bottom: var(--space-1);
}
.bottom-sheet-email {
    font-size: var(--text-sm);
    color: var(--text-muted);
}
.bottom-sheet-section {
    padding: var(--space-5);
    border-bottom: 1px solid var(--border);
}
.bottom-sheet-section:last-child {
    border-bottom: none;
}
.bottom-sheet-section-title {
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: var(--space-3);
}
.bottom-sheet-detail {
    display: flex;
    justify-content: space-between;
    font-size: var(--text-sm);
    margin-bottom: var(--space-2);
}
.bottom-sheet-detail:last-child {
    margin-bottom: 0;
}
.bottom-sheet-detail-label {
    color: var(--text-muted);
}
.bottom-sheet-convo {
    display: block;
    padding: var(--space-2) 0;
    color: var(--text);
    text-decoration: none;
    font-size: var(--text-sm);
    border-bottom: 1px solid var(--border);
}
.bottom-sheet-convo:last-child {
    border-bottom: none;
}
.bottom-sheet-convo:hover {
    color: var(--accent);
}
.bottom-sheet-convo:focus-visible {
    outline: var(--focus-ring);
    outline-offset: var(--focus-ring-offset);
}
.bottom-sheet-convo-date {
    font-size: var(--text-xs);
    color: var(--text-muted);
}
.bottom-sheet-footer {
    padding: var(--space-4) var(--space-5) var(--space-6);
    border-top: 1px solid var(--border);
}
.bottom-sheet-footer a {
    display: block;
    text-align: center;
    padding: var(--space-3);
    background: var(--bg);
    border-radius: var(--radius-lg);
    color: var(--text);
    font-weight: 500;
    text-decoration: none;
}
.bottom-sheet-footer a:hover {
    background: var(--border);
}
.bottom-sheet-footer a:focus-visible {
    outline: var(--focus-ring);
    outline-offset: var(--focus-ring-offset);
}
/* ============================================
   Slideout Panel
   ============================================ */
.slideout-overlay {
    position: fixed;
    inset: 0;
    background: var(--overlay-bg);
    z-index: var(--z-overlay);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--duration-normal), visibility var(--duration-normal);
}
.slideout-overlay--visible {
    opacity: 1;
    visibility: visible;
}
.slideout-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 360px;
    max-width: 100%;
    background: var(--surface);
    z-index: var(--z-modal);
    transform: translateX(100%);
    transition: transform var(--duration-normal) var(--ease-default);
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
}
.slideout-panel--open {
    transform: translateX(0);
}
.slideout-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--border);
}
.slideout-title {
    font-size: var(--text-base);
    font-weight: 600;
    margin: 0;
}
.slideout-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    background: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius-sm);
}
.slideout-close:hover {
    background: var(--bg);
    color: var(--text);
}
.slideout-body {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-4) var(--space-5);
}
.slideout-tabs {
    display: flex;
    gap: var(--space-1);
    margin-bottom: var(--space-4);
    background: var(--bg);
    padding: var(--space-1);
    border-radius: var(--radius-md);
}
.slideout-tab {
    flex: 1;
    padding: var(--space-2) var(--space-3);
    background: none;
    border: none;
    font-size: var(--text-xs);
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all var(--duration-fast);
}
.slideout-tab:hover {
    color: var(--text);
}
.slideout-tab--active {
    background: var(--surface);
    color: var(--text);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
.slideout-tab-panel {
    padding-top: var(--space-2);
}
.slideout-form .form-group {
    margin-bottom: var(--space-4);
}
.slideout-form .form-label {
    display: block;
    font-size: var(--text-xs);
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: var(--space-2);
}
.slideout-actions {
    margin-top: var(--space-4);
    padding-top: var(--space-4);
    border-top: 1px solid var(--border);
}
.slideout-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-8);
    color: var(--text-muted);
    font-size: var(--text-sm);
}
.slideout-tabs-sm {
    margin-bottom: var(--space-3);
}
.slideout-properties-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}
.slideout-property-item {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}
.slideout-property-label {
    font-size: var(--text-xs);
    font-weight: 500;
    color: var(--text-muted);
}
.slideout-property-input {
    font-size: var(--text-sm);
}
.slideout-empty {
    text-align: center;
    padding: var(--space-6) var(--space-4);
    color: var(--text-muted);
}
.slideout-empty p {
    margin-bottom: var(--space-3);
}
/* ============================================
   Sidebar Property Tabs
   ============================================ */
.sidebar-property-tabs {
    display: flex;
    gap: var(--space-1);
    margin-bottom: var(--space-2);
    background: var(--bg);
    padding: 2px;
    border-radius: var(--radius-sm);
}
.sidebar-property-tab {
    flex: 1;
    padding: var(--space-1) var(--space-2);
    background: none;
    border: none;
    font-size: 10px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 3px;
    transition: all var(--duration-fast);
}
.sidebar-property-tab:hover {
    color: var(--text);
}
.sidebar-property-tab.active {
    background: var(--surface);
    color: var(--text);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
.sidebar-property-tabs + .tab-content {
    padding-top: var(--space-1);
}
/* ============================================
   Sidebar Properties List
   ============================================ */
.sidebar-properties-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.sidebar-properties-empty {
    font-size: var(--text-xs);
    color: var(--text-muted);
    font-style: italic;
}
/* Inline property item layout */
.property-item {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-2);
    font-size: 11px;
    line-height: 1.4;
}
.property-label {
    color: var(--text-muted);
    flex-shrink: 0;
}
.property-value {
    color: var(--text);
    text-align: right;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.property-value-link {
    color: var(--accent);
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.property-value-link:hover {
    text-decoration: underline;
}
.property-value-empty {
    color: var(--text-muted);
    font-weight: 400;
}
.property-edit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    padding: 0;
    border: none;
    background: none;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    opacity: 0;
    transition: opacity var(--duration-fast);
}
.property-item:hover .property-edit-btn {
    opacity: 1;
}
.property-edit-btn:hover {
    background: var(--bg);
    color: var(--text);
}
/* Legacy inline property styles (keep for backwards compat) */
.customer-detail-property {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    font-size: var(--text-xs);
}
.customer-detail-property .customer-detail-value {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    text-align: right;
}
.customer-detail-property .btn-icon-xs {
    opacity: 0;
    transition: opacity var(--duration-fast);
}
.customer-detail-property:hover .btn-icon-xs {
    opacity: 1;
}
.customer-detail-value-editable {
    display: flex;
    align-items: center;
    gap: var(--space-1);
}
.customer-detail-value-editable .btn-icon-xs {
    opacity: 0;
    transition: opacity var(--duration-fast);
}
.customer-detail:hover .customer-detail-value-editable .btn-icon-xs {
    opacity: 1;
}
.btn-icon-xs {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    padding: 0;
    border: none;
    background: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}
.btn-icon-xs:hover {
    background: var(--bg);
    color: var(--text);
}
.alert-sm {
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-xs);
    margin-bottom: var(--space-3);
}
/* ==========================================================================
   Search Feature

   Legacy styles for non-modal search elements. Modal styles are in
   components/_search_modal.css using BEM naming.
   ========================================================================== */
/* Search Trigger Button (in header/sidebar)
   ========================================================================== */
.search-trigger {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: var(--text-xs);
  cursor: pointer;
  min-width: 200px;
  transition: border-color var(--duration-normal) var(--ease-default),
              color var(--duration-normal) var(--ease-default);
}
.search-trigger:hover {
  border-color: var(--text-muted);
  color: var(--text-secondary);
}
.search-trigger:focus-visible {
  outline: var(--focus-ring);
  outline-offset: var(--focus-ring-offset);
}
/* Status Badge Colors (used in search results and conversation list)
   ========================================================================== */
.badge-spam {
  background: var(--warning);
  color: #000;
}
/* Timeline Events (if used in search context)
   ========================================================================== */
.timeline-event {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-xs);
  color: var(--text-muted);
}
.timeline-event-text {
  text-align: center;
}
.timeline-event-time {
  font-size: var(--text-xs);
  color: var(--text-muted);
}
.bulk-actions {
    position: fixed;
    top: var(--space-5);
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: var(--text);
    color: white;
    padding: var(--space-3) var(--space-5);
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    gap: var(--space-4);
    box-shadow: 0 8px 30px var(--overlay-bg);
    z-index: var(--z-sticky);
    opacity: 0;
    transition: transform var(--duration-slow) var(--ease-out), opacity var(--duration-slow) var(--ease-out);
}
.bulk-actions--visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}
@media (max-width: 768px) {
    .bulk-actions {
        top: auto;
        bottom: var(--space-3);
        left: var(--space-3);
        right: var(--space-3);
        width: auto;
        transform: translateX(0) translateY(100px);
        justify-content: center;
    }

    .bulk-actions--visible {
        transform: translateX(0) translateY(0);
    }
}
.bulk-count {
    font-weight: 600;
    padding-right: var(--space-4);
    border-right: 1px solid rgba(255, 255, 255, 0.2);
}
.bulk-actions .btn {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    font-size: var(--text-xs);
    padding: var(--space-1) var(--space-3);
}
.bulk-actions .btn:hover {
    background: rgba(255, 255, 255, 0.25);
    color: white;
}
.bulk-actions .btn:focus-visible {
    outline: 2px solid white;
    outline-offset: var(--focus-ring-offset);
}
.bulk-actions .btn-close-bulk {
    background: none;
    padding: var(--space-1);
    margin-left: var(--space-2);
}
.bulk-actions .dropdown-menu {
    font-size: var(--text-xs);
}
.bulk-actions .dropdown-toggle::after {
    margin-left: var(--space-2);
}
[data-theme="dark"] .bulk-actions {
    background: var(--surface-raised);
    color: var(--text);
    border: 1px solid var(--border);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}
[data-theme="dark"] .bulk-count {
    border-right-color: var(--border);
}
[data-theme="dark"] .bulk-actions .btn {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
}
[data-theme="dark"] .bulk-actions .btn:hover,
[data-theme="dark"] .bulk-actions .btn.show {
    background: rgba(255, 255, 255, 0.12);
    color: var(--text);
}
[data-theme="dark"] .bulk-actions .btn-close-bulk {
    background: none;
    color: var(--text-muted);
}
[data-theme="dark"] .bulk-actions .btn-close-bulk:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
}
[data-theme="dark"] .bulk-actions .btn:focus-visible {
    outline: var(--focus-ring);
}
.bulk-actions__tag-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: var(--space-2);
    vertical-align: middle;
}
/* ============================================
   Integration Sidebar Components
   ============================================ */
.integration-loading {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3);
    font-size: var(--text-xs);
    color: var(--text-muted);
}
.integration-loading-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid var(--border);
    border-top-color: var(--text-muted);
    border-radius: 50%;
    animation: integration-spin 0.8s linear infinite;
}
@keyframes integration-spin {
    to { transform: rotate(360deg); }
}
.integration-error {
    padding: var(--space-3);
    font-size: var(--text-xs);
    color: var(--text-muted);
    font-style: italic;
}
.integration-components {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}
/* Section header */
.integration-section {
    margin-top: var(--space-2);
}
.integration-section:first-child {
    margin-top: 0;
}
.integration-section-title {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: var(--space-1);
}
/* Key-value pairs */
.integration-kv {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: var(--space-2);
    font-size: 11px;
}
.integration-kv-label {
    color: var(--text-muted);
    flex-shrink: 0;
}
.integration-kv-value {
    color: var(--text);
    text-align: right;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.integration-kv-link {
    color: var(--accent);
    text-decoration: none;
    text-align: right;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.integration-kv-link:hover {
    text-decoration: underline;
}
/* List component */
.integration-list {
    margin-top: var(--space-1);
}
.integration-list-title {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: var(--space-1);
}
.integration-list-items {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.integration-list-item {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: var(--space-2);
    font-size: 11px;
}
.integration-list-label {
    color: var(--text-muted);
    flex-shrink: 0;
}
.integration-list-value {
    color: var(--text);
    text-align: right;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.integration-list-link {
    color: var(--accent);
    text-decoration: none;
    text-align: right;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.integration-list-link:hover {
    text-decoration: underline;
}
/* Text component */
.integration-text {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.4;
}
/* Link component */
.integration-link {
    margin-top: var(--space-1);
}
.integration-link-text {
    font-size: 11px;
    color: var(--accent);
    text-decoration: none;
}
.integration-link-text:hover {
    text-decoration: underline;
}
.integration-link-button {
    display: inline-block;
    padding: var(--space-1) var(--space-2);
    font-size: 11px;
    font-weight: 500;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: background var(--duration-fast), border-color var(--duration-fast);
}
.integration-link-button:hover {
    background: var(--border);
    border-color: var(--border);
    text-decoration: none;
}
/* Badge component */
.integration-badge-wrapper {
    display: inline-flex;
    margin-top: var(--space-1);
}
.integration-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 6px;
    font-size: 10px;
    font-weight: 500;
    border-radius: var(--radius-sm);
    white-space: nowrap;
}
.integration-badge-gray {
    background: var(--bg);
    color: var(--text-secondary);
}
.integration-badge-green {
    background: var(--success-bg);
    color: var(--success);
}
.integration-badge-yellow {
    background: var(--warning-bg);
    color: var(--warning);
}
.integration-badge-red {
    background: var(--danger-bg);
    color: var(--danger);
}
.integration-badge-blue {
    background: var(--info-bg);
    color: var(--info);
}
/* ============================================
   Settings Page - Integration Cards
   ============================================ */
.settings-integrations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-4);
}
.settings-integration-card {
    display: flex;
    flex-direction: column;
    padding: var(--space-4);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}
.settings-integration-header {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-2);
}
.settings-integration-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--bg);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
}
.settings-integration-title {
    font-weight: 600;
    font-size: var(--text-base);
}
.settings-integration-description {
    flex: 1;
    font-size: var(--text-sm);
    color: var(--text-muted);
    margin-bottom: var(--space-3);
}
.settings-integration-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
    padding-top: var(--space-3);
    border-top: 1px solid var(--border);
}
/* ============================================
   Settings Page - Code Block
   ============================================ */
.settings-code-block {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--space-3);
    overflow-x: auto;
    font-size: 12px;
    line-height: 1.5;
}
.settings-code-block code {
    font-family: var(--font-mono);
    white-space: pre;
}
.slideout-panel-wide {
    width: min(480px, 95vw);
}
.slideout-panel-wide > turbo-frame {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}
.slideout-panel-wide .slideout-header {
    flex-shrink: 0;
}
.slideout-panel-wide .slideout-body {
    padding: 0;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}
.slideout-panel-wide .view-builder-form {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}
.slideout-panel-wide .view-builder-section:first-child {
    flex-shrink: 0;
}
.slideout-panel-wide .view-builder-filters {
    flex: 1;
}
.slideout-panel-wide .view-builder-footer {
    flex-shrink: 0;
}
.view-builder-slideout-body {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}
.view-builder-form {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}
.view-builder-main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4);
    flex: 1;
    min-height: 0;
    overflow: hidden;
}
.view-builder-config {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    overflow-y: auto;
    padding-right: var(--space-2);
}
.view-builder-preview {
    display: flex;
    flex-direction: column;
    background: var(--bg);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    overflow: hidden;
}
.view-builder-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-3);
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}
.view-builder-preview-header h4 {
    font-size: var(--text-sm);
    font-weight: 500;
    margin: 0;
}
.view-builder-preview-count {
    font-size: var(--text-xs);
    color: var(--text-muted);
}
.view-builder-preview-list {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-2);
}
.preview-conversation {
    display: flex;
    align-items: flex-start;
    gap: var(--space-2);
    padding: var(--space-2);
    border-radius: var(--radius-sm);
    transition: background var(--duration-fast) var(--ease-default);
}
.preview-conversation:hover {
    background: var(--selected);
}
.preview-conversation-status {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 6px;
}
.preview-conversation-status-open {
    background: var(--success);
}
.preview-conversation-status-waiting {
    background: var(--warning);
}
.preview-conversation-status-done {
    background: var(--text-muted);
}
.preview-conversation-status-spam {
    background: var(--danger);
}
.preview-conversation-content {
    flex: 1;
    min-width: 0;
}
.preview-conversation-subject {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.preview-conversation-meta {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-xs);
    color: var(--text-muted);
    margin-top: 2px;
}
.preview-conversation-customer {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.preview-conversation-time {
    flex-shrink: 0;
}
.preview-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    font-size: var(--text-sm);
    padding: var(--space-8);
    text-align: center;
}
.view-builder-actions {
    display: flex;
    gap: var(--space-2);
    padding-top: var(--space-4);
    border-top: 1px solid var(--border);
    margin-top: var(--space-4);
}
@media (max-width: 640px) {
    .view-builder-main {
        grid-template-columns: 1fr;
    }

    .view-builder-preview {
        display: none;
    }
}
#conversations.view-preview-loading {
    opacity: 0.6;
    pointer-events: none;
    transition: opacity 0.15s ease;
}
#conversations.view-preview-updated {
    animation: flashHighlight 0.4s ease-out;
}
@keyframes flashHighlight {
    0% {
        background-color: color-mix(in srgb, var(--accent) 10%, transparent);
    }
    100% {
        background-color: transparent;
    }
}
.slideout-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: var(--space-5);
    border-bottom: 1px solid var(--border);
    background: linear-gradient(to bottom, var(--surface), var(--bg));
}
.slideout-header-content {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
}
.slideout-header-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 80%, var(--text)));
    border-radius: var(--radius-md);
    color: white;
    flex-shrink: 0;
}
.slideout-title {
    font-size: var(--text-lg);
    font-weight: 600;
    margin: 0;
    color: var(--text);
}
.slideout-subtitle {
    font-size: var(--text-sm);
    color: var(--text-muted);
    margin: var(--space-1) 0 0 0;
}
.slideout-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-default);
}
.slideout-close:hover {
    background: var(--selected);
    color: var(--text);
}
.view-builder-section {
    padding: var(--space-5);
    border-bottom: 1px solid var(--border);
}
.view-builder-section:last-of-type {
    border-bottom: none;
}
.view-builder-section-header {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
}
.view-builder-section-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: var(--accent);
    color: white;
    font-size: var(--text-xs);
    font-weight: 600;
    border-radius: 50%;
}
.view-builder-section-title {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.view-builder-section-content {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}
.view-builder-field {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}
.view-builder-field-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-4);
}
.view-builder-label {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text);
}
.view-builder-label-required {
    color: var(--danger);
    margin-left: 2px;
}
.view-builder-input {
    width: 100%;
    padding: var(--space-3);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: var(--text-base);
    background: var(--surface);
    color: var(--text);
    transition: all var(--duration-fast) var(--ease-default);
}
.view-builder-input:hover {
    border-color: var(--text-muted);
}
.view-builder-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent);
}
.view-builder-input::-moz-placeholder {
    color: var(--text-muted);
}
.view-builder-input::placeholder {
    color: var(--text-muted);
}
.view-builder-radio-group {
    display: flex;
    gap: var(--space-2);
}
.view-builder-radio {
    flex: 1;
    cursor: pointer;
}
.view-builder-radio input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.view-builder-radio-card {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3);
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-secondary);
    transition: all var(--duration-fast) var(--ease-default);
}
.view-builder-radio-card:hover {
    border-color: var(--text-muted);
    background: var(--selected);
}
.view-builder-radio input:checked + .view-builder-radio-card {
    border-color: var(--accent);
    background: color-mix(in srgb, var(--accent) 8%, transparent);
    color: var(--accent);
}
.view-builder-radio input:focus-visible + .view-builder-radio-card {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent);
}
.view-builder-radio-card svg {
    opacity: 0.7;
}
.view-builder-radio input:checked + .view-builder-radio-card svg {
    opacity: 1;
}
.view-builder-toggle {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    cursor: pointer;
    padding: var(--space-3);
    background: var(--bg);
    border-radius: var(--radius-md);
    transition: background var(--duration-fast) var(--ease-default);
}
.view-builder-toggle:hover {
    background: var(--selected);
}
.view-builder-toggle-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.view-builder-toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    background: var(--border);
    border-radius: 12px;
    transition: background var(--duration-fast) var(--ease-default);
    flex-shrink: 0;
}
.view-builder-toggle-switch::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    transition: transform var(--duration-fast) var(--ease-default);
}
.view-builder-toggle-input:checked + .view-builder-toggle-switch {
    background: var(--accent);
}
.view-builder-toggle-input:checked + .view-builder-toggle-switch::after {
    transform: translateX(20px);
}
.view-builder-toggle-input:focus-visible + .view-builder-toggle-switch {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent);
}
.view-builder-toggle-label {
    font-size: var(--text-sm);
    color: var(--text);
}
.view-builder-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-2);
    padding: var(--space-4) var(--space-5);
    background: var(--bg);
    border-top: 1px solid var(--border);
    margin-top: auto;
}
.view-builder-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    font-size: var(--text-sm);
    font-weight: 500;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-default);
    border: none;
}
.view-builder-btn-secondary {
    background: var(--surface);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}
.view-builder-btn-secondary:hover {
    background: var(--selected);
    color: var(--text);
    border-color: var(--text-muted);
}
.view-builder-btn-primary {
    background: var(--accent);
    color: white;
    padding: var(--space-2) var(--space-5);
}
.view-builder-btn-primary:hover {
    background: color-mix(in srgb, var(--accent) 90%, black);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px color-mix(in srgb, var(--accent) 30%, transparent);
}
.view-builder-btn-primary:active {
    transform: translateY(0);
}
.view-builder-section-content .filter-builder {
    gap: var(--space-3);
}
.view-builder-section-content .filter-builder-header {
    display: none;
}
.view-builder-section-content .filter-condition-list {
    gap: var(--space-2);
}
.view-builder-section-content .filter-condition-card {
    padding: var(--space-3);
    background: var(--surface);
    border-radius: var(--radius-lg);
}
.view-builder-section-content .filter-condition-empty {
    padding: var(--space-6);
    background: var(--surface);
    border-radius: var(--radius-lg);
    border-style: dashed;
}
.view-builder-section-content .filter-add-button {
    width: 100%;
    justify-content: center;
    padding: var(--space-3);
    border-radius: var(--radius-lg);
}
.view-builder-filters .view-builder-section-content {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}
.command-filter {
    position: relative;
}
.command-filter--active .command-filter__input {
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent);
    background: var(--surface);
}
.command-filter--active .command-filter__dropdown {
    display: block;
    border-color: var(--accent);
    border-top: 0;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
}
.command-filter__pills {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-bottom: var(--space-3);
}
.command-filter__pills:empty {
    display: none;
}
.command-filter__pill {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-1) var(--space-2);
    background: var(--bg);
    border-radius: var(--radius-sm);
    font-size: var(--text-sm);
    transition: background var(--duration-fast) var(--ease-default);
}
.command-filter__pill:hover {
    background: var(--selected);
}
.command-filter__pill-content {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    color: inherit;
    text-decoration: none;
    cursor: pointer;
}
.command-filter__pill-content:hover {
    color: inherit;
    text-decoration: none;
}
.command-filter__pill--editing {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
}
.command-filter__pill-label {
    color: var(--text-secondary);
}
.command-filter__pill-values {
    display: flex;
    align-items: center;
    gap: var(--space-1);
}
.command-filter__pill-value {
    font-weight: 500;
    color: var(--text);
}
.command-filter__pill-more {
    font-size: var(--text-xs);
    color: var(--text-muted);
    background: var(--surface);
    padding: 0 var(--space-1);
    border-radius: var(--radius-sm);
}
form.command-filter__pill-remove {
    display: inline;
    margin: 0;
    padding: 0;
    margin-left: var(--space-1);
}
.command-filter__pill-remove button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-default);
}
.command-filter__pill-remove button:hover {
    background: color-mix(in srgb, var(--danger) 15%, transparent);
    color: var(--danger);
}
.command-filter__pill-remove button:focus {
    outline: none;
}
.command-filter__pill-remove button:focus-visible {
    outline: 2px solid var(--bs-primary, #6366f1);
    outline-offset: 1px;
}
.command-filter__input-wrap {
    position: relative;
}
.command-filter__input-icon {
    position: absolute;
    left: var(--space-3);
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    z-index: 1;
}
.command-filter__input {
    width: 100%;
    padding: var(--space-3) var(--space-3) var(--space-3) calc(var(--space-3) + 24px);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    background: var(--bg);
    color: var(--text);
    transition: all var(--duration-fast) var(--ease-default);
}
.command-filter__input:hover {
    border-color: var(--text-muted);
}
.command-filter__input:focus {
    outline: none;
    background: var(--surface);
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent);
}
.command-filter__input::-moz-placeholder {
    color: var(--text-muted);
}
.command-filter__input::placeholder {
    color: var(--text-muted);
}
.command-filter__dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: var(--z-dropdown);
    display: none;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.06);
    animation: commandFilterSlideDown 0.15s ease-out;
}
@keyframes commandFilterSlideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}
.command-filter__type-list {
    padding: var(--space-2);
}
.command-filter__type-item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-default);
}
.command-filter__type-item:hover,
.command-filter__type-item--focused {
    background: color-mix(in srgb, var(--accent) 10%, transparent);
}
.command-filter__type-item:hover .command-filter__type-icon,
.command-filter__type-item--focused .command-filter__type-icon {
    background: var(--accent);
    color: white;
}
.command-filter__type-item:hover .command-filter__type-label,
.command-filter__type-item--focused .command-filter__type-label {
    color: var(--accent);
}
.command-filter__type-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    flex-shrink: 0;
    transition: all var(--duration-fast) var(--ease-default);
}
.command-filter__type-label {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text);
    flex: 1;
    transition: color var(--duration-fast) var(--ease-default);
}
.command-filter__type-operators {
    font-size: var(--text-xs);
    color: var(--text-muted);
}
.command-filter__value-picker {
    padding: var(--space-3);
    background: var(--bg);
    border-top: 1px solid var(--border);
}
.command-filter__value-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-3);
}
.command-filter__cancel-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-default);
}
.command-filter__cancel-btn:hover {
    background: color-mix(in srgb, var(--danger) 10%, transparent);
    color: var(--danger);
}
.command-filter__value-label {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-secondary);
}
.command-filter__value-operator {
    color: var(--accent);
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px var(--space-1);
    border-radius: var(--radius-sm);
    font-size: var(--text-xs);
    font-weight: 500;
}
.command-filter__value-operator:hover,
.command-filter__value-operator:focus {
    background: color-mix(in srgb, var(--accent) 10%, transparent);
    outline: none;
}
.command-filter__value-options {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}
.command-filter__value-options > .command-filter__checkbox-list {
    flex-direction: row;
    flex-wrap: wrap;
}
.command-filter__value-option {
    display: inline-flex;
    align-items: center;
    padding: var(--space-1) var(--space-3);
    font-size: var(--text-sm);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 9999px;
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-default);
}
.command-filter__value-option:hover {
    border-color: var(--text-muted);
}
.command-filter__value-option--selected {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}
.command-filter__value-input {
    width: 100%;
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-sm);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    color: var(--text);
}
.command-filter__value-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 15%, transparent);
}
.command-filter__value-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: var(--space-3);
    padding-top: var(--space-3);
    border-top: 1px solid var(--border);
}
.command-filter__done-btn {
    padding: var(--space-2) var(--space-4);
    font-size: var(--text-sm);
    font-weight: 500;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-default);
}
.command-filter__done-btn:hover {
    background: color-mix(in srgb, var(--accent) 85%, black);
}
.command-filter__done-btn--disabled {
    background: var(--border);
    color: var(--text-muted);
    pointer-events: none;
}
.command-filter__autocomplete {
    max-height: 180px;
    overflow-y: auto;
}
.command-filter__autocomplete-item {
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-sm);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all var(--duration-fast) var(--ease-default);
}
.command-filter__autocomplete-item:hover {
    background: color-mix(in srgb, var(--accent) 10%, transparent);
    color: var(--accent);
}
.command-filter__autocomplete-item--selected {
    background: var(--accent);
    color: white;
}
.command-filter__autocomplete-empty {
    padding: var(--space-3);
    font-size: var(--text-sm);
    color: var(--text-muted);
    text-align: center;
}
.command-filter__property-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin: calc(var(--space-3) * -1);
}
.command-filter__property-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-3);
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-default);
}
.command-filter__property-item:last-child {
    border-bottom: none;
}
.command-filter__property-item:hover {
    background: color-mix(in srgb, var(--accent) 10%, transparent);
}
.command-filter__property-label {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text);
}
.command-filter__property-type {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}
.command-filter__keyboard-hints {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2) var(--space-3);
    border-top: 1px solid var(--border);
    font-size: var(--text-xs);
    color: var(--text-muted);
}
.command-filter__keyboard-hints kbd {
    background: var(--selected);
    padding: 2px var(--space-1);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 11px;
}
.command-filter__hidden-fields {
    display: none;
}
.command-filter__checkbox-list {
    display: flex;
    flex-direction: column;
    max-height: 240px;
    overflow-y: auto;
}
.command-filter__checkbox-item {
    display: flex;
    align-items: center;
    padding: var(--space-3);
    font-size: var(--text-sm);
    font-weight: 500;
    cursor: pointer;
    transition: background var(--duration-fast) var(--ease-default);
    -webkit-user-select: none;
       -moz-user-select: none;
            user-select: none;
}
.command-filter__checkbox-item:hover {
    background: var(--selected);
}
.command-filter__checkbox-item:has(input:checked) {
    background: color-mix(in srgb, var(--accent) 10%, transparent);
    color: var(--accent);
}
.command-filter__checkbox-item:has(input:checked) span {
    color: var(--accent);
}
.command-filter__checkbox-item input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.command-filter__checkbox-item span {
    color: var(--text);
}
.command-filter__text-input-wrap {
    width: 100%;
}
.command-filter__text-input {
    width: 100%;
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-sm);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    color: var(--text);
}
.command-filter__text-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 15%, transparent);
}
.command-filter__number-input-wrap {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}
.command-filter__number-input {
    max-width: 120px;
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-sm);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    color: var(--text);
}
.command-filter__number-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 15%, transparent);
}
.command-filter__number-suffix {
    font-size: var(--text-sm);
    color: var(--text-muted);
}
.command-filter__date-input-wrap {
    width: 100%;
}
.command-filter__date-input {
    width: 100%;
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-sm);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    color: var(--text);
}
.command-filter__date-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 15%, transparent);
}
.command-filter__autocomplete-wrap {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}
.command-filter__autocomplete-input {
    width: 100%;
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-sm);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    color: var(--text);
}
.command-filter__autocomplete-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 15%, transparent);
}
.command-filter__autocomplete-results {
    max-height: 180px;
    overflow-y: auto;
}
.command-filter__autocomplete-list {
    display: flex;
    flex-direction: column;
}
.command-filter__searchable-checkboxes {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}
.command-filter__search-input {
    width: 100%;
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-sm);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    color: var(--text);
}
.command-filter__search-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 15%, transparent);
}
.command-filter__searchable-checkboxes .command-filter__checkbox-list {
    max-height: 200px;
    overflow-y: auto;
}
.command-filter__property-picker {
    margin: 0;
}
.command-filter__no-value {
    font-size: var(--text-sm);
    color: var(--text-muted);
}
/* ============================================
   Workflow Wizard
   ============================================ */
/* Step Indicator */
.workflow-wizard__steps {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-4);
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
}
.workflow-wizard__step {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--text-muted);
    font-size: var(--text-sm);
    transition: all var(--duration-fast) var(--ease-default);
    flex: 1;
    justify-content: center;
}
.workflow-wizard__step:hover:not(.disabled):not(.active) {
    background: var(--selected);
    color: var(--text-secondary);
}
.workflow-wizard__step--active,
.workflow-wizard__step.active {
    background: color-mix(in srgb, var(--accent) 12%, transparent);
    color: var(--accent);
}
.workflow-wizard__step--active .workflow-wizard__step-number,
.workflow-wizard__step.active .workflow-wizard__step-number {
    background: var(--accent);
    color: white;
}
.workflow-wizard__step--completed .workflow-wizard__step-number,
.workflow-wizard__step.completed .workflow-wizard__step-number {
    background: var(--success);
    color: white;
}
.workflow-wizard__step--incomplete .workflow-wizard__step-number,
.workflow-wizard__step.incomplete .workflow-wizard__step-number {
    background: var(--warning);
    color: white;
}
.workflow-wizard__step--disabled,
.workflow-wizard__step.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.workflow-wizard__step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: var(--text-xs);
    font-weight: 600;
    background: var(--border);
    color: var(--text-muted);
    flex-shrink: 0;
    transition: all var(--duration-fast) var(--ease-default);
}
.workflow-wizard__step-label {
    font-weight: 500;
}
/* Main Card */
.workflow-wizard > .card {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: none;
}
.workflow-wizard > .card > .card-body {
    padding: var(--space-5);
    overflow: visible;
}
.workflow-wizard > .card > .card-footer {
    background: var(--bg);
    border-top: 1px solid var(--border);
    padding: var(--space-4) var(--space-5);
}
/* Empty State */
.workflow-wizard__empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-6) var(--space-4);
    background: var(--bg);
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    text-align: center;
}
.workflow-wizard__empty-state p {
    color: var(--text-muted);
    font-size: var(--text-sm);
    max-width: 340px;
    margin: 0;
}
/* ============================================
   Condition Groups
   ============================================ */
.workflow-condition-groups {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}
.workflow-condition-groups__and-divider {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2) 0;
}
.workflow-condition-groups__and-divider::before,
.workflow-condition-groups__and-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border);
}
.workflow-condition-groups__and-divider .badge {
    font-size: var(--text-xs);
    font-weight: 600;
    letter-spacing: 0.05em;
    padding: var(--space-1) var(--space-3);
    background: var(--text-secondary);
    border-radius: var(--radius-full);
    color: white;
}
/* Condition Group */
.workflow-condition-group.card {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: none;
    overflow: visible;
}
.workflow-condition-group > .card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-3) var(--space-4);
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}
.workflow-condition-group > .card-body {
    padding: var(--space-4);
    overflow: visible;
}
.workflow-condition-group__conditions {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}
.workflow-condition-group__conditions > .text-center {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-1) 0;
}
.workflow-condition-group__conditions > .text-center .badge {
    font-size: var(--text-xs);
    font-weight: 600;
    letter-spacing: 0.05em;
    padding: var(--space-1) var(--space-3);
    background: var(--border);
    color: var(--text-secondary);
    border-radius: var(--radius-full);
}
.workflow-condition-group__picker {
    padding-top: var(--space-3);
}
/* Condition Card */
.workflow-condition-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: all var(--duration-fast) var(--ease-default);
}
.workflow-condition-card:hover {
    border-color: var(--text-muted);
}
.workflow-condition-card__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
}
.workflow-condition-card__content {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    flex-wrap: wrap;
}
.workflow-condition-card__content strong {
    font-weight: 600;
    color: var(--text);
    font-size: var(--text-sm);
}
.workflow-condition-card__content .text-muted {
    color: var(--text-muted);
    font-size: var(--text-sm);
}
.workflow-condition-card__content code {
    font-family: var(--font-mono, monospace);
    font-size: var(--text-xs);
    background: var(--surface);
    padding: 2px var(--space-2);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    margin-left: var(--space-1);
}
.workflow-condition-card__actions {
    display: flex;
    gap: var(--space-2);
    flex-shrink: 0;
}
.workflow-condition-card > turbo-frame:not(:empty) {
    display: block;
    padding: var(--space-3) var(--space-4);
    border-top: 1px solid var(--border);
}
/* Condition Type Picker */
.workflow-condition-type-picker {
    overflow: visible;
}
.workflow-condition-type-picker .btn-outline-secondary {
    font-size: var(--text-sm);
    font-weight: 500;
    padding: var(--space-2) var(--space-3);
    border: 1px dashed var(--border);
    color: var(--text-muted);
    background: transparent;
    border-radius: var(--radius-md);
    transition: all var(--duration-fast) var(--ease-default);
}
.workflow-condition-type-picker .btn-outline-secondary:hover {
    border-color: var(--accent);
    border-style: solid;
    color: var(--accent);
    background: color-mix(in srgb, var(--accent) 5%, transparent);
}
.workflow-condition-type-picker .dropdown-menu {
    padding: var(--space-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    min-width: 200px;
}
.workflow-condition-type-picker .dropdown-item {
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    color: var(--text-secondary);
    transition: all var(--duration-fast) var(--ease-default);
}
.workflow-condition-type-picker .dropdown-item:hover {
    background: var(--selected);
    color: var(--text);
}
.workflow-condition-type-picker > turbo-frame:not(:empty) {
    display: block;
    margin-top: var(--space-3);
}
/* ============================================
   Condition Form
   ============================================ */
.workflow-condition-form {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.workflow-condition-form__header {
    padding: var(--space-3) var(--space-4);
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}
.workflow-condition-form__type {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text);
}
.workflow-condition-form__fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: var(--space-4);
    padding: var(--space-4);
}
.workflow-condition-form__field {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}
.workflow-condition-form__label {
    font-size: var(--text-xs);
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.workflow-condition-form .form-select,
.workflow-condition-form .form-control {
    font-size: var(--text-sm);
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background-color: var(--bg);
    color: var(--text);
    transition: all var(--duration-fast) var(--ease-default);
}
.workflow-condition-form .form-select {
    padding-right: 2.25rem;
}
.workflow-condition-form .form-select:hover,
.workflow-condition-form .form-control:hover {
    border-color: var(--text-muted);
}
.workflow-condition-form .form-select:focus,
.workflow-condition-form .form-control:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent);
    outline: none;
}
.workflow-condition-form__actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-4);
    background: var(--bg);
    border-top: 1px solid var(--border);
}
/* ============================================
   Actions Step
   ============================================ */
.workflow-actions-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}
/* Action Card */
.workflow-action-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: all var(--duration-fast) var(--ease-default);
}
.workflow-action-card:hover {
    border-color: var(--text-muted);
}
.workflow-action-card__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
}
.workflow-action-card__content {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    flex-wrap: wrap;
}
.workflow-action-card__content strong {
    font-weight: 600;
    color: var(--text);
    font-size: var(--text-sm);
}
.workflow-action-card__content .text-muted {
    color: var(--text-muted);
    font-size: var(--text-sm);
}
.workflow-action-card__actions {
    display: flex;
    gap: var(--space-2);
    flex-shrink: 0;
}
.workflow-action-card > turbo-frame:not(:empty) {
    display: block;
    padding: var(--space-3) var(--space-4);
    border-top: 1px solid var(--border);
}
/* Action Type Picker */
.workflow-action-type-picker {
    overflow: visible;
}
.workflow-action-type-picker .btn-outline-primary {
    font-size: var(--text-sm);
    font-weight: 500;
    padding: var(--space-2) var(--space-3);
    border: 1px dashed var(--accent);
    color: var(--accent);
    background: transparent;
    border-radius: var(--radius-md);
    transition: all var(--duration-fast) var(--ease-default);
}
.workflow-action-type-picker .btn-outline-primary:hover {
    border-style: solid;
    background: color-mix(in srgb, var(--accent) 8%, transparent);
}
.workflow-action-type-picker .dropdown-menu {
    padding: var(--space-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    min-width: 200px;
}
.workflow-action-type-picker .dropdown-item {
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    color: var(--text-secondary);
    transition: all var(--duration-fast) var(--ease-default);
}
.workflow-action-type-picker .dropdown-item:hover {
    background: var(--selected);
    color: var(--text);
}
.workflow-action-type-picker > turbo-frame:not(:empty) {
    display: block;
    margin-top: var(--space-3);
}
/* ============================================
   Action Form (reuses condition form styles)
   ============================================ */
.workflow-action-form {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.workflow-action-form__header {
    padding: var(--space-3) var(--space-4);
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}
.workflow-action-form__type {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text);
}
.workflow-action-form__fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: var(--space-4);
    padding: var(--space-4);
}
.workflow-action-form__field {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}
.workflow-action-form__label {
    font-size: var(--text-xs);
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.workflow-action-form .form-select,
.workflow-action-form .form-control {
    font-size: var(--text-sm);
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background-color: var(--bg);
    color: var(--text);
    transition: all var(--duration-fast) var(--ease-default);
}
.workflow-action-form .form-select {
    padding-right: 2.25rem;
}
.workflow-action-form .form-select:hover,
.workflow-action-form .form-control:hover {
    border-color: var(--text-muted);
}
.workflow-action-form .form-select:focus,
.workflow-action-form .form-control:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent);
    outline: none;
}
.workflow-action-form__actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-4);
    background: var(--bg);
    border-top: 1px solid var(--border);
}
/* ============================================
   Add Group Button
   ============================================ */
.workflow-condition-groups > .mt-4 .btn-outline-primary {
    font-size: var(--text-sm);
    font-weight: 500;
    padding: var(--space-2) var(--space-4);
    border: 1px dashed var(--accent);
    color: var(--accent);
    background: transparent;
    border-radius: var(--radius-md);
    transition: all var(--duration-fast) var(--ease-default);
}
.workflow-condition-groups > .mt-4 .btn-outline-primary:hover {
    border-style: solid;
    background: color-mix(in srgb, var(--accent) 8%, transparent);
}
[data-theme="dark"] .workflow-condition-groups__and-divider .badge {
    color: var(--surface);
}
/* Pages */
/* ============================================
   Auth Pages (Sign In, Sign Up, Forgot Password)
   ============================================ */
.auth-container,
.signin-container,
.signup-container {
    width: 100%;
    max-width: 360px;
    padding: var(--space-6);
}
.signup-container {
    max-width: 400px;
}
.auth-header,
.signin-header,
.signup-header {
    text-align: center;
    margin-bottom: var(--space-6);
}
.auth-header h1,
.signin-header h1,
.signup-header h1 {
    font-size: var(--text-2xl);
    font-weight: 600;
    margin-bottom: var(--space-2);
}
.auth-header p,
.signin-header p,
.signup-header p {
    color: var(--text-muted);
    font-size: var(--text-sm);
}
.auth-form,
.signin-form,
.signup-form {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
}
.auth-footer,
.signin-footer,
.signup-footer {
    text-align: center;
    margin-top: var(--space-5);
    font-size: var(--text-xs);
    color: var(--text-muted);
}
.auth-footer a,
.signin-footer a,
.signup-footer a {
    color: var(--accent);
    text-decoration: none;
}
.auth-footer a:hover,
.signin-footer a:hover,
.signup-footer a:hover {
    text-decoration: underline;
}
.auth-footer a:focus-visible,
.signin-footer a:focus-visible,
.signup-footer a:focus-visible {
    outline: var(--focus-ring);
    outline-offset: var(--focus-ring-offset);
}
.forgot-link {
    display: block;
    text-align: right;
    font-size: var(--text-xs);
    color: var(--text-muted);
    margin-top: var(--space-2);
}
.forgot-link:hover {
    color: var(--accent);
}
.forgot-link:focus-visible {
    outline: var(--focus-ring);
    outline-offset: var(--focus-ring-offset);
}
.divider {
    display: flex;
    align-items: center;
    margin: var(--space-5) 0;
    color: var(--text-muted);
    font-size: var(--text-xs);
}
.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}
.divider span {
    padding: 0 var(--space-3);
}
.btn-signin,
.btn-signup {
    width: 100%;
    padding: var(--space-3);
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-weight: 500;
    cursor: pointer;
    transition: background var(--duration-normal) var(--ease-default);
}
.btn-signin:hover,
.btn-signup:hover {
    background: var(--accent-hover);
}
.btn-signin:focus-visible,
.btn-signup:focus-visible {
    outline: var(--focus-ring);
    outline-offset: var(--focus-ring-offset);
}
.btn-google {
    width: 100%;
    padding: var(--space-2) var(--space-3);
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    transition: background var(--duration-normal) var(--ease-default);
}
.btn-google:hover {
    background: var(--bg);
}
.btn-google:focus-visible {
    outline: var(--focus-ring);
    outline-offset: var(--focus-ring-offset);
}
.terms {
    font-size: var(--text-xs);
    color: var(--text-muted);
    text-align: center;
    margin-top: var(--space-5);
}
.terms a {
    color: var(--text-secondary);
    text-decoration: underline;
}
.terms a:focus-visible {
    outline: var(--focus-ring);
    outline-offset: var(--focus-ring-offset);
}
/* Settings Pages */
/* Settings Table */
.settings-table {
    width: 100%;
    border-collapse: collapse;
}
.settings-table__head {
    border-bottom: 1px solid var(--border);
}
.settings-table__header {
    text-align: left;
    font-size: var(--text-xs);
    font-weight: 500;
    color: var(--text-muted);
    padding: var(--space-3) var(--space-4);
    white-space: nowrap;
}
.settings-table__header:first-child {
    padding-left: var(--space-4);
}
.settings-table__header:last-child {
    padding-right: var(--space-4);
}
.settings-table__header--actions {
    text-align: right;
    width: 1%;
}
.settings-table__header--narrow {
    width: 1%;
}
.settings-table__row {
    border-bottom: 1px solid var(--border);
    transition: background var(--duration-fast);
}
.settings-table__row:last-child {
    border-bottom: none;
}
.settings-table__row:hover {
    background: var(--bg);
}
[data-theme="dark"] .settings-table__row:hover {
    background: var(--surface-raised);
}
.settings-table__cell {
    padding: var(--space-3) var(--space-4);
    font-size: var(--text-sm);
    color: var(--text);
    vertical-align: middle;
}
.settings-table__cell:first-child {
    padding-left: var(--space-4);
}
.settings-table__cell:last-child {
    padding-right: var(--space-4);
}
.settings-table__cell--muted {
    color: var(--text-muted);
}
.settings-table__cell--actions {
    text-align: right;
    white-space: nowrap;
}
.settings-table__cell--narrow {
    white-space: nowrap;
}
.settings-table__cell--truncate {
    max-width: 0;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.settings-table__link {
    color: var(--text);
    text-decoration: none;
}
.settings-table__link:hover {
    color: var(--accent);
}
.settings-table__secondary {
    color: var(--text-muted);
    font-size: var(--text-xs);
    margin-left: var(--space-2);
}
.settings-table__timestamp {
    color: var(--text-muted);
    font-size: var(--text-sm);
    white-space: nowrap;
}
/* Settings Shell Layout */
.settings-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--bg);
}
.settings-shell__body {
    display: flex;
    flex: 1;
    min-height: 0;
    margin: 0 auto;
    width: 100%;
}
/* Settings Header (Sticky Two-Row) */
.settings-header {
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}
.settings-header__top {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-2) var(--space-4);
    border-bottom: 1px solid var(--border);
}
.settings-header__back {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-sm);
    color: var(--text-muted);
    text-decoration: none;
    flex-shrink: 0;
}
.settings-header__back:hover {
    color: var(--text);
}
.settings-header__divider {
    width: 1px;
    height: 20px;
    background: var(--border);
}
.settings-header__title {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text);
    margin: 0;
}
.settings-header__tabs {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    padding: 0 var(--space-4);
    height: 44px;
}
.settings-header__tab {
    display: flex;
    align-items: center;
    height: 100%;
    padding: 0 var(--space-3);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: color var(--duration-fast), border-color var(--duration-fast);
}
.settings-header__tab:hover {
    color: var(--text);
}
.settings-header__tab--active {
    color: var(--text);
    border-bottom-color: var(--accent);
}
button.settings-header__tab--dropdown {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
}
button.settings-header__tab--dropdown:focus {
    outline: none;
}
/* Settings Navigation Sidebar */
.settings-nav {
    width: 200px;
    flex-shrink: 0;
    padding: var(--space-4) var(--space-3);
    border-right: 1px solid var(--border);
    background: var(--surface);
}
.settings-nav__list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.settings-nav__item {
    margin-bottom: 2px;
}
.settings-nav__link {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    color: var(--text-secondary);
    text-decoration: none;
    transition: background var(--duration-fast), color var(--duration-fast);
}
.settings-nav__link:hover {
    background: var(--bg);
    color: var(--text);
}
[data-theme="dark"] .settings-nav__link:hover {
    background: var(--surface-raised);
}
.settings-nav__link--active {
    background: var(--selected);
    color: var(--text);
    font-weight: 500;
}
.settings-nav__link--danger {
    color: var(--danger);
}
.settings-nav__link--danger:hover {
    background: color-mix(in srgb, var(--danger) 10%, transparent);
    color: var(--danger);
}
.settings-nav__icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    opacity: 0.7;
}
.settings-nav__link--active .settings-nav__icon {
    opacity: 1;
}
.settings-nav__divider {
    height: 1px;
    background: var(--border);
    margin: var(--space-3) 0;
}
.settings-nav__label {
    padding: var(--space-3) var(--space-3) var(--space-2);
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}
/* Settings Main Content */
.settings-main {
    flex: 1;
    padding: var(--space-5);
    min-width: 0;
}
/* Page Header */
.settings-page-header {
    margin-bottom: var(--space-5);
}
.settings-page-header__row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--space-4);
}
.settings-page-header__title {
    font-size: var(--text-lg);
    font-weight: 600;
    margin: 0 0 var(--space-1) 0;
}
.settings-page-header__desc {
    font-size: var(--text-sm);
    color: var(--text-muted);
    margin: 0;
}
.settings-page-header__actions {
    flex-shrink: 0;
}
/* Context Label (Workspace/Inbox name) */
.settings-context-label {
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    opacity: 0.6;
    margin-bottom: var(--space-1);
}
/* Card Base Styling */
.settings-main .card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.settings-main .card-header {
    background: transparent;
    border-bottom: 1px solid var(--border);
    padding: var(--space-4);
}
.settings-main .card-body {
    padding: var(--space-4);
}
.settings-main .card-body.py-0 {
    padding-top: 0;
    padding-bottom: 0;
    padding-left: var(--space-4);
    padding-right: var(--space-4);
}
.settings-main .card-footer {
    background: var(--bg);
    border-top: 1px solid var(--border);
    padding: var(--space-3) var(--space-4);
}
/* Settings List Item - Unified component for all settings list pages */
.settings-list-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--border);
    margin-left: calc(-1 * var(--space-4));
    margin-right: calc(-1 * var(--space-4));
    padding-left: var(--space-4);
    padding-right: var(--space-4);
    transition: background var(--duration-fast);
}
.settings-list-item:last-child {
    border-bottom: none;
}
.settings-list-item:hover {
    background: var(--bg);
}
[data-theme="dark"] .settings-list-item:hover {
    background: var(--surface-raised);
}
.settings-list-item--clickable {
    cursor: pointer;
    color: var(--text);
    text-decoration: none;
}
.settings-list-item--clickable:hover .settings-list-item__name {
    color: var(--accent);
}
.settings-list-item__main {
    flex: 1;
    min-width: 0;
}
.settings-list-item__header {
    display: flex;
    align-items: baseline;
    gap: var(--space-2);
    margin-bottom: var(--space-1);
    flex-wrap: wrap;
}
.settings-list-item__header--inline {
    align-items: center;
}
.settings-list-item__name {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text);
    text-decoration: none;
}
a.settings-list-item__name:hover {
    color: var(--accent);
}
.settings-list-item__code {
    font-size: 11px;
    font-family: var(--font-mono, monospace);
    color: var(--text-muted);
    background: var(--bg);
    padding: 1px 6px;
    border-radius: var(--radius-sm);
}
.settings-list-item__url {
    font-size: var(--text-xs);
    font-family: var(--font-mono, monospace);
    color: var(--text-muted);
    margin-bottom: var(--space-1);
    word-break: break-all;
}
.settings-list-item__url--copyable {
    cursor: pointer;
    transition: color var(--duration-fast);
}
.settings-list-item__url--copyable:hover {
    color: var(--text);
}
.settings-list-item__body {
    font-size: var(--text-xs);
    color: var(--text-muted);
    line-height: 1.4;
    margin-bottom: var(--space-2);
}
.settings-list-item__desc {
    font-size: var(--text-xs);
    color: var(--text-muted);
    margin-top: var(--space-1);
}
.settings-list-item__meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    font-size: var(--text-xs);
    color: var(--text-muted);
}
.settings-list-item__meta--spaced {
    gap: var(--space-3);
}
.settings-list-item__actions {
    display: flex;
    gap: var(--space-1);
    flex-shrink: 0;
}
.settings-list-item__actions--gap-2 {
    gap: var(--space-2);
}
.settings-list-item__color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    flex-shrink: 0;
}
.settings-list-item__leading {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    flex: 1;
    min-width: 0;
}
.settings-list-item--with-avatar {
    align-items: center;
}
.settings-list-item__avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-xs);
    font-weight: 600;
    flex-shrink: 0;
    text-transform: uppercase;
}
.settings-list-item__avatar--pending {
    background: var(--text-muted);
}
.settings-list-item__badge {
    flex-shrink: 0;
}
/* Card Variants */
.card--danger {
    border-color: var(--danger);
}
.card--danger .card-header {
    background: color-mix(in srgb, var(--danger) 5%, transparent);
    border-bottom-color: color-mix(in srgb, var(--danger) 20%, transparent);
}
.card--danger .card-header h2,
.card--danger .card-header .card-title {
    color: var(--danger);
}
.card--highlight {
    background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 5%, transparent) 0%, color-mix(in srgb, var(--accent) 2%, transparent) 100%);
    border-color: color-mix(in srgb, var(--accent) 20%, transparent);
}
/* Badge Variants for Scope */
.badge--workspace {
    background: var(--bg);
    color: var(--text-muted);
}
.badge--inbox {
    background: color-mix(in srgb, var(--accent) 10%, transparent);
    color: var(--accent);
}
.badge--personal {
    background: color-mix(in srgb, #6366f1 10%, transparent);
    color: #6366f1;
}
[data-theme="dark"] .badge--personal {
    background: color-mix(in srgb, #818cf8 15%, transparent);
    color: #818cf8;
}
.badge--success {
    background: #dcfce7;
    color: #166534;
}
[data-theme="dark"] .badge--success {
    background: color-mix(in srgb, var(--success) 20%, transparent);
    color: var(--success);
}
.badge--warning {
    background: #fef3c7;
    color: #92400e;
}
[data-theme="dark"] .badge--warning {
    background: color-mix(in srgb, var(--warning) 20%, transparent);
    color: var(--warning);
}
.badge--danger {
    background: #fee2e2;
    color: #dc2626;
}
[data-theme="dark"] .badge--danger {
    background: color-mix(in srgb, var(--danger) 20%, transparent);
    color: var(--danger);
}
/* Toggle Switch */
.settings-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    flex-shrink: 0;
}
.settings-toggle__input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}
.settings-toggle__switch {
    width: 40px;
    height: 22px;
    background: #d1d5db;
    border-radius: 11px;
    transition: background var(--duration-normal);
    position: relative;
}
.settings-toggle__switch::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    transition: transform var(--duration-normal);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
.settings-toggle__input:checked + .settings-toggle__switch {
    background: #16a34a;
}
.settings-toggle__input:checked + .settings-toggle__switch::after {
    transform: translateX(18px);
}
.settings-toggle__input:focus-visible + .settings-toggle__switch {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}
[data-theme="dark"] .settings-toggle__switch {
    background: #4b5563;
}
[data-theme="dark"] .settings-toggle__input:checked + .settings-toggle__switch {
    background: #22c55e;
}
/* Notification Preferences Row */
.notification-pref-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--border);
}
.notification-pref-row:last-child {
    border-bottom: none;
}
.notification-pref-row__info {
    flex: 1;
    min-width: 0;
}
.notification-pref-row__label {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text);
}
.notification-pref-row__desc {
    font-size: var(--text-xs);
    color: var(--text-muted);
    margin-top: 2px;
}
.notification-pref-row__channels {
    display: flex;
    gap: var(--space-4);
    flex-shrink: 0;
}
.notification-pref-row__checkbox {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    cursor: pointer;
}
.notification-pref-row__checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--accent);
    cursor: pointer;
}
.notification-pref-row__checkbox-label {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    -webkit-user-select: none;
       -moz-user-select: none;
            user-select: none;
}
/* Browser Notifications Card */
.browser-notifications {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
}
.browser-notifications__icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: var(--accent);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.browser-notifications__content {
    flex: 1;
    min-width: 0;
}
.browser-notifications__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    padding-top: var(--space-3);
    margin-top: var(--space-3);
    border-top: 1px solid var(--border);
}
.browser-notifications__status {
    font-size: var(--text-sm);
    font-weight: 500;
}
.browser-notifications__status--success {
    color: var(--success);
}
.browser-notifications__status--error {
    color: var(--danger);
}
.browser-notifications__status--info {
    color: var(--text-muted);
}
/* Scope Selection Options */
.scope-options {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}
.scope-option {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-3);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: border-color var(--duration-fast), background var(--duration-fast);
}
.scope-option:hover {
    border-color: var(--text-muted);
}
.scope-option:has(input:checked) {
    border-color: var(--accent);
    background: color-mix(in srgb, var(--accent) 5%, transparent);
}
.scope-option input[type="radio"] {
    margin-top: 2px;
    flex-shrink: 0;
    accent-color: var(--accent);
}
.scope-option__content {
    flex: 1;
    min-width: 0;
}
.scope-option__label {
    display: block;
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text);
    margin-bottom: 2px;
}
.scope-option__desc {
    display: block;
    font-size: var(--text-xs);
    color: var(--text-muted);
}
/* Icon Button */
.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--text-muted);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background var(--duration-fast), color var(--duration-fast);
}
.btn-icon:hover {
    background: var(--bg);
    color: var(--text);
}
[data-theme="dark"] .btn-icon:hover {
    background: var(--surface-raised);
}
.btn-icon--danger:hover {
    background: color-mix(in srgb, var(--danger) 10%, transparent);
    color: var(--danger);
}
.btn-icon--sm {
    width: 28px;
    height: 28px;
}
/* Empty State */
.settings-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: var(--space-8) var(--space-4);
}
.settings-empty__icon {
    width: 48px;
    height: 48px;
    margin-bottom: var(--space-4);
    color: var(--text-muted);
    opacity: 0.5;
}
.settings-empty__title {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text);
    margin: 0 0 var(--space-2) 0;
}
.settings-empty__desc {
    font-size: var(--text-sm);
    color: var(--text-muted);
    margin: 0 0 var(--space-4) 0;
    max-width: 320px;
}
/* Filter Tabs */
.settings-filter-tabs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
}
.settings-filter-tabs > .dropdown {
    display: flex;
}
.settings-filter-tab {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-xs);
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: background var(--duration-fast), color var(--duration-fast);
}
.settings-filter-tab:hover {
    background: var(--surface);
    color: var(--text);
}
.settings-filter-tab--active {
    background: var(--surface);
    color: var(--text);
}
.settings-filter-tab__count {
    font-size: 10px;
    font-weight: 500;
    color: var(--text-muted);
    background: var(--bg);
    padding: 1px 6px;
    border-radius: 10px;
}
.settings-filter-tab--dropdown {
    border: none;
    background: transparent;
    cursor: pointer;
}
.settings-filter-tab--dropdown:hover,
.settings-filter-tab--dropdown[aria-expanded="true"] {
    background: var(--surface);
    color: var(--text);
}
.settings-filter-tab__caret {
    opacity: 0.5;
    margin-left: -4px;
    transition: transform var(--duration-fast);
}
.settings-filter-tab--dropdown[aria-expanded="true"] .settings-filter-tab__caret {
    transform: rotate(180deg);
}
/* Integration Cards Grid */
.integrations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-4);
}
.integration-card {
    display: flex;
    flex-direction: column;
    padding: var(--space-4);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}
.integration-card__header {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-3);
}
.integration-card__icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}
.integration-card__title {
    font-size: var(--text-sm);
    font-weight: 600;
}
.integration-card__desc {
    font-size: var(--text-xs);
    color: var(--text-muted);
    flex: 1;
    margin-bottom: var(--space-3);
}
.integration-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
    padding-top: var(--space-3);
    border-top: 1px solid var(--border);
}
/* Mobile Navigation */
@media (max-width: 768px) {
    .settings-nav {
        display: none;
    }

    .settings-nav--mobile-open {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 280px;
        z-index: var(--z-overlay);
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
    }

    .settings-main {
        padding: var(--space-4);
    }

    .settings-header__tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .notification-pref-row {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-3);
    }

    .notification-pref-row__channels {
        width: 100%;
        justify-content: flex-start;
    }
}
/* Mobile Menu Toggle */
.settings-mobile-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: var(--text);
    border-radius: var(--radius-md);
    cursor: pointer;
}
.settings-mobile-toggle:hover {
    background: var(--bg);
}
@media (max-width: 768px) {
    .settings-mobile-toggle {
        display: flex;
    }
}
/* Overlay for mobile nav */
.settings-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: var(--overlay-bg);
    z-index: calc(var(--z-overlay) - 1);
}
.settings-overlay--visible {
    display: block;
}
/* Options List for Property Dropdowns */
.options-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}
.option-row {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: background var(--duration-fast), border-color var(--duration-fast);
}
.option-row .form-control {
    flex: 1;
    min-width: 0;
}
.option-row.dragging {
    opacity: 0.5;
}
.option-row.drag-over {
    border-color: var(--accent);
    background: color-mix(in srgb, var(--accent) 5%, transparent);
}
.drag-handle {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    padding: var(--space-1);
    color: var(--text-muted);
    -webkit-user-select: none;
       -moz-user-select: none;
            user-select: none;
    flex-shrink: 0;
}
.drag-handle:hover {
    color: var(--text-secondary);
}
.drag-handle:active {
    cursor: grabbing;
}
/* Danger Zone */
.danger-zone {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
}
.danger-zone__content {
    flex: 1;
    min-width: 0;
}
.danger-zone__title {
    font-size: var(--text-sm);
    font-weight: 500;
    margin: 0 0 var(--space-1) 0;
}
.danger-zone__desc {
    font-size: var(--text-xs);
    color: var(--text-muted);
    margin: 0;
}
/* Checkbox Grid */
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-2);
}
.checkbox-grid .form-check {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    background: var(--bg);
    border-radius: var(--radius-sm);
    cursor: pointer;
    margin: 0;
}
.checkbox-grid .form-check:hover {
    background: var(--surface);
}
.checkbox-grid .form-check-input {
    width: 16px;
    height: 16px;
    margin: 0;
    flex-shrink: 0;
    accent-color: var(--accent);
}
.checkbox-grid .form-check-label {
    font-size: var(--text-xs);
    color: var(--text);
    cursor: pointer;
    -webkit-user-select: none;
       -moz-user-select: none;
            user-select: none;
    margin: 0;
}
@media (max-width: 640px) {
    .checkbox-grid {
        grid-template-columns: 1fr;
    }
}
/* Workflow Wizard */
.workflow-wizard__steps {
    display: flex;
    gap: var(--space-2);
    justify-content: center;
}
.workflow-wizard__step {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background var(--duration-fast);
}
.workflow-wizard__step:hover {
    background: var(--bg);
}
.workflow-wizard__step.active {
    background: var(--selected);
}
.workflow-wizard__step.completed {
    color: var(--success);
}
.workflow-wizard__step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--bg);
    font-size: var(--text-xs);
    font-weight: 600;
}
.workflow-wizard__step.active .workflow-wizard__step-number {
    background: var(--accent);
    color: white;
}
.workflow-wizard__step.completed .workflow-wizard__step-number {
    background: var(--success);
    color: white;
}
.workflow-wizard__step-label {
    font-size: var(--text-sm);
    font-weight: 500;
}
/* Workflow Condition/Action Cards */
.workflow-condition-card,
.workflow-action-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-2);
    cursor: pointer;
    transition: border-color var(--duration-fast);
}
.workflow-condition-card:hover,
.workflow-action-card:hover {
    border-color: var(--text-muted);
}
.workflow-condition-card__header,
.workflow-action-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-2) var(--space-3);
}
.workflow-condition-card__type,
.workflow-action-card__type {
    font-size: var(--text-sm);
    font-weight: 500;
}
.workflow-condition-remove,
.workflow-action-remove {
    padding: var(--space-1);
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius-sm);
}
.workflow-condition-remove:hover,
.workflow-action-remove:hover {
    background: var(--bg);
    color: var(--danger);
}
.workflow-condition-card__body,
.workflow-action-card__body {
    display: none;
    padding: var(--space-3);
    padding-top: 0;
    border-top: 1px solid var(--border);
}
.workflow-condition-card--expanded .workflow-condition-card__body,
.workflow-action-card--expanded .workflow-action-card__body {
    display: block;
}
/* Execution Item */
.execution-item {
    border-bottom: 1px solid var(--border);
}
.execution-item:last-child {
    border-bottom: none;
}
.execution-item__conversation {
    font-size: var(--text-sm);
    font-weight: 500;
}
.execution-item__meta {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}
/* Badge Info */
.badge--info {
    background: color-mix(in srgb, var(--accent) 10%, transparent);
    color: var(--accent);
}
.badge--secondary {
    background: var(--bg);
    color: var(--text-muted);
}
/* Sortable List */
.sortable-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}
.sortable-list__item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2) var(--space-3);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    cursor: grab;
    transition: background var(--duration-fast), border-color var(--duration-fast), opacity var(--duration-fast);
}
.sortable-list__item:hover {
    background: var(--surface);
}
.sortable-list__item--dragging {
    opacity: 0.5;
    cursor: grabbing;
}
.sortable-list__item--over {
    border-color: var(--accent);
    background: color-mix(in srgb, var(--accent) 5%, transparent);
}
.sortable-list__handle {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    flex-shrink: 0;
}
.sortable-list__label {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex: 1;
    min-width: 0;
    cursor: pointer;
    font-size: var(--text-sm);
}
.sortable-list__label .form-check-input {
    margin: 0;
    flex-shrink: 0;
}
.system-code-block {
    white-space: pre-wrap;
    word-break: break-all;
}
/* ============================================
   Customer Profile Page
   ============================================ */
.customer-profile {
    max-width: 900px;
    margin: 0 auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
/* Hero Section */
.customer-profile-hero {
    display: flex;
    align-items: flex-start;
    gap: var(--space-5);
    padding: var(--space-6);
    background: var(--bg);
}
.customer-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: var(--accent);
    color: white;
    font-weight: 600;
    font-size: var(--text-sm);
    border-radius: 50%;
    flex-shrink: 0;
}
.customer-avatar-lg {
    width: 100px;
    height: 100px;
    font-size: var(--text-2xl);
}
.customer-profile-info {
    flex: 1;
    min-width: 0;
}
.customer-profile-name {
    font-size: var(--text-2xl);
    font-weight: 600;
    margin: 0 0 var(--space-1) 0;
    color: var(--text);
}
.customer-profile-company {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin-bottom: 2px;
}
.customer-profile-location {
    font-size: var(--text-sm);
    color: var(--text-muted);
}
.customer-profile-actions {
    flex-shrink: 0;
}
/* Tabs */
.customer-profile-tabs {
    display: flex;
    justify-content: center;
    gap: var(--space-1);
    padding: 0 var(--space-6);
    border-bottom: 1px solid var(--border);
    background: var(--bg);
}
.customer-tab {
    position: relative;
    display: inline-flex;
    align-items: center;
    padding: var(--space-3) var(--space-4);
    background: none;
    border: none;
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    cursor: pointer;
    transition: color var(--duration-fast);
}
.customer-tab:hover {
    color: var(--text);
    text-decoration: none;
}
.customer-tab-active {
    color: var(--text);
}
.customer-tab-active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent);
}
.customer-tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 var(--space-1);
    margin-left: var(--space-1);
    background: var(--bg-alt, var(--border));
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 500;
    color: var(--text-muted);
}
.customer-tab-active .customer-tab-count {
    background: color-mix(in srgb, var(--accent) 15%, transparent);
    color: var(--accent);
}
/* Tab Panels */
.customer-tab-panel {
    padding: var(--space-6);
}
.customer-tab-panel[hidden] {
    display: none;
}
/* Sections */
.customer-section {
    margin-bottom: var(--space-6);
}
.customer-section:last-child {
    margin-bottom: 0;
}
.customer-section-header {
    margin-bottom: var(--space-3);
}
.customer-section-header h2 {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text);
    margin: 0;
}
/* Fields */
.customer-field {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--border);
}
.customer-field:last-child {
    border-bottom: none;
}
.customer-field-label {
    font-size: var(--text-xs);
    font-weight: 500;
    color: var(--text-muted);
}
.customer-field-value {
    font-size: var(--text-sm);
    color: var(--text);
}
/* Conversations Table */
.customer-conversations-table {
    width: 100%;
    border-collapse: collapse;
}
.customer-conversations-table thead th {
    text-align: left;
    font-size: var(--text-xs);
    font-weight: 500;
    color: var(--text-muted);
    padding: var(--space-2) var(--space-3);
    border-bottom: 1px solid var(--border);
}
.customer-conversations-table tbody tr {
    border-bottom: 1px solid var(--border);
}
.customer-conversations-table tbody tr:last-child {
    border-bottom: none;
}
.customer-conversations-table tbody td {
    padding: var(--space-3);
    font-size: var(--text-sm);
    vertical-align: top;
}
.customer-conversation-link {
    display: block;
    color: var(--text);
}
.customer-conversation-link:hover {
    text-decoration: none;
}
.customer-conversation-link:hover .customer-conversation-subject {
    color: var(--accent);
}
.customer-conversation-inbox-tag {
    display: inline-block;
    padding: 2px var(--space-2);
    margin-bottom: var(--space-1);
    background: color-mix(in srgb, var(--success) 15%, transparent);
    color: var(--success);
    font-size: var(--text-xs);
    font-weight: 500;
    border-radius: var(--radius-sm);
}
.customer-conversation-subject {
    font-weight: 500;
    margin-bottom: 2px;
    transition: color var(--duration-fast);
}
.customer-conversation-preview {
    font-size: var(--text-xs);
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 400px;
}
.customer-conversation-assignee,
.customer-conversation-number {
    color: var(--text-secondary);
}
.customer-conversation-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    text-align: right;
}
.customer-conversation-status {
    font-weight: 500;
    color: var(--text-secondary);
}
.customer-conversation-status.is-open {
    color: var(--accent);
}
.customer-conversation-date {
    font-size: var(--text-xs);
    color: var(--text-muted);
}
/* Notes List */
.customer-notes-list {
    display: flex;
    flex-direction: column;
}
.customer-note-item {
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--border);
}
.customer-note-item:last-child {
    border-bottom: none;
}
.customer-note-content {
    font-size: var(--text-sm);
    color: var(--text);
    line-height: 1.5;
    margin-bottom: var(--space-2);
}
.customer-note-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.customer-note-meta {
    font-size: var(--text-xs);
    color: var(--text-muted);
}
.btn-text-danger {
    background: none;
    border: none;
    padding: 0;
    font-size: var(--text-xs);
    color: var(--text-muted);
    cursor: pointer;
    transition: color var(--duration-fast);
}
.btn-text-danger:hover {
    color: var(--danger);
}
/* Note Form */
.customer-note-form {
    margin-top: var(--space-4);
    padding-top: var(--space-4);
    border-top: 1px solid var(--border);
}
.customer-note-form .form-control {
    font-size: var(--text-sm);
}
.customer-note-form-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: var(--space-2);
}
/* Properties List */
.customer-properties-list {
    display: flex;
    flex-direction: column;
}
.customer-properties-list .customer-detail-property {
    display: grid;
    grid-template-columns: minmax(140px, 220px) 1fr auto;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--border);
    font-size: var(--text-sm);
}
.customer-properties-list turbo-frame:last-child .customer-detail-property {
    border-bottom: none;
}
.customer-properties-list .customer-detail-label {
    color: var(--text-muted);
}
.customer-properties-list .customer-detail-property .customer-detail-value {
    display: block;
    text-align: left;
    color: var(--text);
    word-break: break-word;
}
.customer-properties-list .customer-detail-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 2px;
}
.customer-properties-list .customer-detail-actions form {
    display: inline-flex;
    margin: 0;
}
.customer-properties-list .customer-detail-actions .btn-icon {
    transition: opacity var(--duration-fast), background var(--duration-fast), color var(--duration-fast);
}
@media (hover: hover) {
    .customer-properties-list .customer-detail-actions .btn-icon {
        opacity: 0;
    }

    .customer-properties-list .customer-detail-property:hover .customer-detail-actions .btn-icon,
    .customer-properties-list .customer-detail-actions .btn-icon:focus-visible {
        opacity: 1;
    }
}
/* Empty State */
.customer-empty {
    text-align: center;
    padding: var(--space-8) var(--space-4);
    color: var(--text-muted);
}
.customer-empty p {
    margin-bottom: var(--space-3);
}
/* ============================================
   Customer Merge Modal
   ============================================ */
.customer-merge-source {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}
.customer-merge-label {
    font-size: var(--text-xs);
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}
.customer-merge-card {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: var(--space-3);
    background: var(--bg);
    border-radius: var(--radius-sm);
}
.customer-merge-name {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text);
}
.customer-merge-email {
    font-size: var(--text-xs);
    color: var(--text-muted);
}
.customer-merge-warning {
    margin-top: var(--space-3);
    padding: var(--space-3);
    background: rgba(var(--danger-rgb), 0.05);
    border: 1px solid rgba(var(--danger-rgb), 0.2);
    border-radius: var(--radius-sm);
    font-size: var(--text-xs);
    color: var(--danger);
}
[data-theme="dark"] .customer-merge-warning {
    background: rgba(var(--danger-rgb), 0.1);
}
/* ============================================
   Customer List (Index Page)
   ============================================ */
.search-bar {
    margin-bottom: var(--space-5);
}
.search-bar .search-wrapper {
    max-width: none;
}
.search-bar .search-wrapper svg {
    left: var(--space-3);
}
.search-bar .search-input {
    padding: var(--space-3) var(--space-4) var(--space-3) 2.5rem;
    font-size: var(--text-sm);
    border-radius: var(--radius-md);
}
.customer-list {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.customer-list-header {
    display: flex;
    align-items: baseline;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    font-size: var(--text-xs);
    font-weight: 500;
    color: var(--text-muted);
}
.customer-row {
    display: flex;
    align-items: baseline;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    border-bottom: 1px solid var(--border);
    color: var(--text);
    transition: background var(--duration-fast) var(--ease-default);
}
.customer-row:last-child {
    border-bottom: none;
}
.customer-row:hover {
    background: var(--bg);
    text-decoration: none;
}
.customer-row:focus-visible {
    outline: var(--focus-ring);
    outline-offset: -2px;
}
.customer-name {
    font-weight: 500;
}
.customer-email {
    font-size: var(--text-xs);
    color: var(--text-muted);
}
.customer-company {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    margin-left: auto;
}
.customer-convos {
    font-size: var(--text-xs);
    color: var(--text-muted);
    min-width: 50px;
    text-align: right;
}
.customer-list .empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: var(--space-8) var(--space-4);
}
.customer-list .empty-state-icon {
    width: 48px;
    height: 48px;
    margin-bottom: var(--space-4);
    color: var(--text-muted);
    opacity: 0.5;
}
.customer-list .empty-state-title {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text);
    margin: 0 0 var(--space-2) 0;
}
.customer-list .empty-state p {
    font-size: var(--text-sm);
    color: var(--text-muted);
    margin: 0;
}
/* Company Profile Page */
.company-profile {
    max-width: 900px;
    margin: 0 auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
/* Hero Section */
.company-profile-hero {
    display: flex;
    align-items: flex-start;
    gap: var(--space-5);
    padding: var(--space-6);
    background: var(--bg);
}
.company-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: var(--accent);
    color: white;
    font-weight: 600;
    font-size: var(--text-sm);
    border-radius: var(--radius-md);
    flex-shrink: 0;
}
.company-avatar-lg {
    width: 100px;
    height: 100px;
    font-size: var(--text-2xl);
}
.company-profile-info {
    flex: 1;
    min-width: 0;
}
.company-profile-name {
    font-size: var(--text-2xl);
    font-weight: 600;
    margin: 0 0 var(--space-1) 0;
    color: var(--text);
}
.company-profile-domain {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin-bottom: 2px;
}
.company-profile-location {
    font-size: var(--text-sm);
    color: var(--text-muted);
}
.company-profile-actions {
    flex-shrink: 0;
}
/* Company List (Index Page) */
.company-list {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.company-row {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--border);
    color: var(--text);
    transition: background var(--duration-fast) var(--ease-default);
}
.company-row:last-child {
    border-bottom: none;
}
.company-row:hover {
    background: var(--bg);
    text-decoration: none;
}
.company-row:focus-visible {
    outline: var(--focus-ring);
    outline-offset: -2px;
}
.company-row .company-avatar {
    width: 40px;
    height: 40px;
    font-size: var(--text-sm);
}
.company-name {
    font-weight: 500;
    flex: 1;
}
.company-domain {
    font-size: var(--text-xs);
    color: var(--text-muted);
    min-width: 120px;
}
.company-customers {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    min-width: 100px;
    text-align: right;
}
.company-count {
    font-weight: 400;
    color: var(--text-muted);
}
/* Company Form */
.company-form-container {
    max-width: 600px;
}
.company-form .form-group {
    margin-bottom: var(--space-4);
}
.company-form .form-actions {
    margin-top: var(--space-6);
    display: flex;
    gap: var(--space-2);
}
/* Company Customers List */
.company-customers-list {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
}
/* Editable field style */
.customer-field-editable {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}
.customer-field-editable .btn-icon {
    opacity: 0;
    transition: opacity var(--duration-fast);
}
.customer-field:hover .customer-field-editable .btn-icon {
    opacity: 1;
}
/* Settings Tabs */
.settings-tabs {
    display: flex;
    gap: var(--space-1);
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-3);
    border-bottom: 1px solid var(--border);
}
.settings-tab {
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-muted);
    border-radius: var(--radius-md);
    transition: all var(--duration-fast);
}
.settings-tab:hover {
    color: var(--text);
    text-decoration: none;
    background: var(--bg);
}
.settings-tab-active {
    color: var(--text);
    background: var(--bg);
}
.settings-tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 var(--space-1);
    margin-left: var(--space-1);
    background: var(--border);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 500;
    color: var(--text-muted);
}
.settings-tab-active .settings-tab-count {
    background: color-mix(in srgb, var(--accent) 15%, transparent);
    color: var(--accent);
}
/* ============================================
   Onboarding Page
   ============================================ */
.onboarding-container {
    flex: 1;
    max-width: 560px;
    margin: 0 auto;
    padding: var(--space-7) var(--space-6);
}
.welcome-header {
    text-align: center;
    margin-bottom: 2.5rem;
}
.welcome-header h1 {
    font-size: var(--text-2xl);
    font-weight: 600;
    margin-bottom: var(--space-2);
}
.welcome-header p {
    font-size: var(--text-sm);
    color: var(--text-secondary);
}
/* ============================================
   Setup Steps
   ============================================ */
.setup-steps {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}
.setup-step {
    display: flex;
    gap: var(--space-4);
    padding: var(--space-4) var(--space-5);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    transition: border-color var(--duration-normal) var(--ease-default);
}
.setup-step:hover {
    border-color: var(--text-muted);
}
.setup-step.completed {
    background: #f0fdf4;
    border-color: #bbf7d0;
}
[data-theme="dark"] .setup-step.completed {
    background: color-mix(in srgb, var(--success) 10%, var(--surface));
    border-color: color-mix(in srgb, var(--success) 30%, transparent);
}
.step-number {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--text-secondary);
    flex-shrink: 0;
}
.setup-step.completed .step-number {
    background: var(--success);
    color: white;
}
.step-content {
    flex: 1;
    min-width: 0;
}
.step-title {
    font-weight: 500;
    margin-bottom: var(--space-1);
}
.step-desc {
    font-size: var(--text-xs);
    color: var(--text-muted);
    margin-bottom: var(--space-3);
}
.step-action {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-1) var(--space-3);
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: var(--text-xs);
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: background var(--duration-normal) var(--ease-default);
}
.step-action:hover {
    background: var(--accent-hover);
    color: white;
    text-decoration: none;
}
.step-action:focus-visible {
    outline: var(--focus-ring);
    outline-offset: var(--focus-ring-offset);
}
.step-action.secondary {
    background: none;
    color: var(--accent);
    border: 1px solid var(--border);
}
.step-action.secondary:hover {
    background: var(--bg);
}
.setup-step.completed .step-action {
    display: none;
}
.step-complete-label {
    display: none;
    font-size: var(--text-xs);
    color: var(--success);
    font-weight: 500;
}
.setup-step.completed .step-complete-label {
    display: block;
}
/* ============================================
   Help Section
   ============================================ */
.help-section {
    margin-top: 2.5rem;
    padding-top: var(--space-6);
    border-top: 1px solid var(--border);
    text-align: center;
}
.help-section h3 {
    font-size: var(--text-sm);
    font-weight: 500;
    margin-bottom: var(--space-2);
}
.help-section p {
    font-size: var(--text-xs);
    color: var(--text-muted);
    margin-bottom: var(--space-4);
}
.help-links {
    display: flex;
    justify-content: center;
    gap: var(--space-5);
}
.help-link {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    font-size: var(--text-xs);
    color: var(--text-secondary);
    text-decoration: none;
}
.help-link:hover {
    color: var(--accent);
}
.help-link:focus-visible {
    outline: var(--focus-ring);
    outline-offset: var(--focus-ring-offset);
}
.skip-link {
    display: block;
    margin-top: var(--space-6);
    text-align: center;
    font-size: var(--text-xs);
    color: var(--text-muted);
    text-decoration: none;
}
.skip-link:hover {
    color: var(--text);
}
.skip-link:focus-visible {
    outline: var(--focus-ring);
    outline-offset: var(--focus-ring-offset);
}
.folders-page {
    min-height: 100vh;
    background: var(--bg);
}
.folders-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: var(--space-6) var(--space-5);
}
.folders-header-content {
    max-width: 800px;
    margin: 0 auto;
}
.folders-header h1 {
    font-size: var(--text-2xl);
    font-weight: 600;
    margin: 0 0 var(--space-1) 0;
    color: var(--text);
}
.folders-subtitle {
    font-size: var(--text-sm);
    color: var(--text-muted);
    margin: 0;
}
.folders-container {
    max-width: 800px;
    margin: 0 auto;
    padding: var(--space-5);
}
.inbox-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    overflow: hidden;
    margin-bottom: var(--space-3);
}
.inbox-card-primary {
    border-color: var(--accent);
    border-width: 2px;
}
.inbox-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}
.inbox-card-primary .inbox-card-header {
    background: color-mix(in srgb, var(--accent) 5%, var(--surface));
}
[data-theme="dark"] .inbox-card-primary .inbox-card-header {
    background: color-mix(in srgb, var(--accent) 10%, var(--surface));
}
.inbox-card-title {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text);
}
.inbox-card-total {
    font-size: var(--text-xs);
    color: var(--text-muted);
}
.inbox-card-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
}
.inbox-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--space-4) var(--space-3);
    text-decoration: none;
    border-right: 1px solid var(--border);
    transition: background var(--duration-fast) var(--ease-default);
}
.inbox-stat:last-child {
    border-right: none;
}
.inbox-stat:hover {
    background: var(--selected);
    text-decoration: none;
}
[data-theme="dark"] .inbox-stat:hover {
    background: var(--surface-raised);
}
.inbox-stat:focus-visible {
    outline: var(--focus-ring);
    outline-offset: -2px;
}
.inbox-stat-count {
    font-size: var(--text-xl);
    font-weight: 600;
    color: var(--text);
    line-height: 1;
    margin-bottom: var(--space-1);
}
.inbox-stat-label {
    font-size: var(--text-xs);
    color: var(--text-muted);
}
.folders-section {
    margin-top: var(--space-6);
}
.folders-section-title {
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin: 0 0 var(--space-3) 0;
    padding-left: var(--space-1);
}
.folders-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}
.folders-list .inbox-card {
    margin-bottom: 0;
}
@media (max-width: 600px) {
    .folders-header {
        padding: var(--space-5) var(--space-4);
    }

    .folders-container {
        padding: var(--space-4);
    }

    .inbox-card-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .inbox-stat {
        border-bottom: 1px solid var(--border);
    }

    .inbox-stat:nth-child(2) {
        border-right: none;
    }

    .inbox-stat:nth-child(3),
    .inbox-stat:nth-child(4) {
        border-bottom: none;
    }
}
/* ============================================
   Empty States
   ============================================ */
.empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-7);
    text-align: center;
}
.empty-state-icon {
    width: 48px;
    height: 48px;
    margin-bottom: var(--space-3);
    color: var(--accent);
    opacity: 0.7;
}
.empty-state h3 {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text);
    margin-bottom: var(--space-1);
}
.empty-state p {
    font-size: var(--text-xs);
    color: var(--text-muted);
    max-width: 220px;
}
/* ============================================
   No Selection State
   ============================================ */
.no-selection {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-6);
    text-align: center;
    color: var(--text-muted);
}
.no-selection-icon {
    width: 48px;
    height: 48px;
    margin-bottom: var(--space-4);
    color: var(--border);
}
.no-selection h3 {
    font-size: var(--text-base);
    font-weight: 500;
    color: var(--text);
    margin-bottom: var(--space-1);
}
.no-selection p {
    font-size: var(--text-sm);
}
/* ============================================
   Error Pages (404, 500, etc.)
   ============================================ */
.error-page {
    text-align: center;
    padding: var(--space-6);
    max-width: 400px;
}
.error-code {
    font-size: var(--text-display);
    font-weight: 600;
    color: var(--border);
    line-height: 1;
    margin-bottom: var(--space-4);
}
.error-title {
    font-size: var(--text-xl);
    font-weight: 600;
    margin-bottom: var(--space-2);
}
.error-message {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin-bottom: var(--space-6);
}
.error-actions {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    align-items: center;
}
.error-actions.horizontal {
    flex-direction: row;
    justify-content: center;
}
/* ============================================
   Error Container (Inline Errors)
   ============================================ */
.error-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-6);
    text-align: center;
}
.error-icon {
    width: 64px;
    height: 64px;
    margin-bottom: var(--space-5);
    color: var(--warning);
}
.error-container .error-message {
    max-width: 320px;
    margin-bottom: var(--space-5);
}
.help-link {
    font-size: var(--text-xs);
    color: var(--text-muted);
}
.help-link a {
    color: var(--accent);
    text-decoration: none;
}
.help-link a:hover {
    text-decoration: underline;
}
.help-link a:focus-visible {
    outline: var(--focus-ring);
    outline-offset: var(--focus-ring-offset);
}
/* ============================================
   Connection Status
   ============================================ */
.connection-status {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-top: var(--space-6);
    padding: var(--space-2) var(--space-4);
    background: color-mix(in srgb, var(--warning) 15%, transparent);
    border-radius: var(--radius-md);
    font-size: var(--text-xs);
    color: var(--text);
}
[data-theme="dark"] .connection-status {
    background: color-mix(in srgb, var(--warning) 20%, var(--surface));
}
.status-dot {
    width: 8px;
    height: 8px;
    background: var(--warning);
    border-radius: var(--radius-full);
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}
/* ============================================
   Views Page
   ============================================ */
.views-section {
    margin-bottom: var(--space-6);
}
.views-section-title {
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: var(--space-3);
}
.views-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}
.view-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}
.view-item-main {
    flex: 1;
    min-width: 0;
}
.view-item-link {
    display: block;
    color: inherit;
    text-decoration: none;
}
.view-item-link:hover .view-item-name {
    color: var(--accent);
}
.view-item-name {
    font-weight: 500;
    margin-bottom: var(--space-1);
}
.view-item-query {
    display: block;
    font-size: var(--text-xs);
    color: var(--text-muted);
    background: var(--bg);
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.view-item-meta {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-xs);
}
.view-item-badge {
    padding: var(--space-1) var(--space-2);
    background: var(--bg);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
}
.view-item-badge-shared {
    background: var(--accent-bg);
    color: var(--accent);
}
.view-item-count {
    color: var(--text-muted);
}
.view-item-actions {
    display: flex;
    align-items: center;
    gap: var(--space-1);
}
/* View Show Page */
.view-query-display {
    display: inline-block;
    font-size: var(--text-sm);
    color: var(--text-secondary);
    background: var(--bg);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-md);
    margin-top: var(--space-2);
}
.view-info {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-3) 0;
    margin-bottom: var(--space-4);
    border-bottom: 1px solid var(--border);
    font-size: var(--text-sm);
    color: var(--text-muted);
}
.view-info-item {
    display: flex;
    align-items: center;
    gap: var(--space-1);
}
.view-conversations {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
}
/* Sidebar Section */
.sidebar-section {
    padding: var(--space-3) 0;
    border-top: 1px solid var(--border);
}
.sidebar-section__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-4) var(--space-2);
    font-size: var(--text-2xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}
.sidebar-section__link {
    font-size: var(--text-2xs);
    color: var(--text-muted);
    text-decoration: none;
    text-transform: none;
    font-weight: normal;
}
.sidebar-section__link:hover {
    color: var(--text);
}
.sidebar-section__empty {
    padding: var(--space-2) var(--space-4);
    font-size: var(--text-xs);
    color: var(--text-muted);
}
.sidebar-section__empty a {
    color: var(--text-muted);
    text-decoration: none;
}
.sidebar-section__empty a:hover {
    color: var(--accent);
}
/* Theme overrides */
:root[data-theme="dark"] {
    color-scheme: dark;

    --bs-body-color: var(--text);
    --bs-body-color-rgb: 235, 235, 235;
    --bs-body-bg: var(--surface);
    --bs-body-bg-rgb: 28, 28, 28;
    --bs-secondary-color: var(--text-muted);
    --bs-secondary-color-rgb: 143, 143, 143;
    --bs-secondary-bg: var(--surface-raised);
    --bs-secondary-bg-rgb: 38, 38, 38;
    --bs-tertiary-color: rgba(235, 235, 235, 0.5);
    --bs-tertiary-color-rgb: 235, 235, 235;
    --bs-tertiary-bg: var(--bg);
    --bs-tertiary-bg-rgb: 20, 20, 20;
    --bs-border-color: var(--border);
    --bs-border-color-translucent: rgba(255, 255, 255, 0.1);

    --lexxy-color-ink: var(--text);
    --lexxy-color-ink-medium: var(--text-secondary);
    --lexxy-color-ink-light: var(--text-muted);
    --lexxy-color-ink-lighter: var(--border);
    --lexxy-color-ink-lightest: var(--surface-raised);
    --lexxy-color-ink-inverted: var(--surface);
    --lexxy-color-accent-dark: oklch(72% 0.14 258);
    --lexxy-color-accent-medium: oklch(80% 0.11 258);
    --lexxy-color-accent-light: oklch(36% 0.08 258);
    --lexxy-color-accent-lightest: oklch(29% 0.06 258);
    --lexxy-color-code-token-att: #ff7b72;
    --lexxy-color-code-token-comment: #8b949e;
    --lexxy-color-code-token-function: #d2a8ff;
    --lexxy-color-code-token-operator: #ff7b72;
    --lexxy-color-code-token-property: #79c0ff;
    --lexxy-color-code-token-punctuation: #c9d1d9;
    --lexxy-color-code-token-selector: #7ee787;
    --lexxy-color-code-token-variable: #ffa657;
    --lexxy-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}
[data-theme="dark"] .btn-ghost:hover {
    background: var(--surface-raised);
}
[data-theme="dark"] .ticket-row:hover {
    background: var(--surface-raised);
}
[data-theme="dark"] .search-input {
    background: var(--surface-raised);
}
[data-theme="dark"] .sort-dropdown {
    background: var(--surface-raised);
}
[data-theme="dark"] .filter-condition-card {
    background: var(--surface-raised);
}
[data-theme="dark"] .filter-type-picker {
    background: var(--surface-raised);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3), 0 1px 3px rgba(0, 0, 0, 0.2);
}
[data-theme="dark"] .filter-operator-menu {
    background: var(--surface-raised);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3), 0 1px 3px rgba(0, 0, 0, 0.2);
}
[data-theme="dark"] .filter-value-checkbox:has(input:checked) {
    background: color-mix(in srgb, var(--accent) 20%, transparent);
}
[data-theme="dark"] .filter-picker-container,
[data-theme="dark"] .filter-config-container {
    background: var(--surface-raised);
}
[data-theme="dark"] .filter-condition-card-compact {
    background: var(--surface-raised);
}
[data-theme="dark"] .command-filter__dropdown {
    background: var(--surface-raised);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3), 0 1px 3px rgba(0, 0, 0, 0.2);
}
[data-theme="dark"] .command-filter__pill {
    background: var(--surface-raised);
}
[data-theme="dark"] .command-filter__value-picker {
    background: var(--surface);
}
/* Responsive - last for cascade priority */
/* ============================================
   Responsive Styles - 768px Breakpoint
   ============================================ */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        z-index: var(--z-modal);
        transform: translateX(-100%);
        transition: transform var(--duration-slow) var(--ease-default);
        box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
    }

    .sidebar--visible {
        transform: translateX(0);
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: var(--overlay-bg);
        z-index: calc(var(--z-modal) - 1);
    }

    .sidebar-overlay--visible {
        display: block;
    }

    .menu-toggle {
        display: flex;
    }

    .conversation-list:not(.conversation-list--full-width) {
        display: none;
    }

    .mobile-back {
        display: flex;
    }

    .search-modal-shortcut svg {
        display: block;
        width: 16px;
        height: 16px;
    }

    .search-modal-shortcut span {
        display: none;
    }

    .search-modal-shortcut {
        padding: var(--space-2);
        background: transparent;
    }

    .detail-header {
        padding: var(--space-4);
        flex-direction: column;
        gap: var(--space-3);
        align-items: stretch;
    }

    .detail-header > div:first-child {
        min-width: 0;
    }

    .detail-subject {
        font-size: var(--text-base);
        white-space: normal;
        line-height: 1.3;
    }

    .action-buttons {
        flex-wrap: wrap;
        gap: var(--space-2);
    }

    .action-buttons .dropdown .btn {
        font-size: var(--text-xs);
        padding: var(--space-1) var(--space-2);
    }

    .action-buttons > .btn {
        font-size: var(--text-xs);
        padding: var(--space-1) var(--space-2);
    }

    .compose-form-container {
        padding: var(--space-4);
    }

    .compose-field-row {
        flex-direction: column;
    }

    .composer {
        padding: var(--space-3) var(--space-4);
    }

    .composer-actions {
        flex-direction: column;
        gap: var(--space-3);
        align-items: stretch;
    }

    .composer-actions > div {
        justify-content: space-between;
    }

    .composer-actions .btn-send {
        width: 100%;
    }

    .thread {
        padding: var(--space-4);
    }

    .message {
        gap: var(--space-3);
    }

    .message-body {
        padding: var(--space-3) var(--space-4);
    }

    .list-toolbar {
        padding: var(--space-3) var(--space-4);
    }

    .search-wrapper {
        max-width: none;
        flex: 1;
    }

    .btn-compose span {
        display: none;
    }

    .btn-compose {
        padding: var(--space-2);
    }

    .onboarding-container {
        padding: var(--space-6) var(--space-4);
    }

    .ticket-table-header {
        display: none;
    }

    .list-header {
        display: none;
    }

    .mobile-header {
        display: flex;
        align-items: center;
        padding: var(--space-2) var(--space-3);
        border-bottom: 1px solid var(--border);
        background: var(--surface);
    }

    .conversation-item__desktop {
        display: none;
    }

    .conversation-item__mobile {
        display: flex;
    }

    .conversation-item__checkbox {
        display: none;
        padding: var(--space-4) 0 var(--space-4) var(--space-4);
        align-items: flex-start;
    }

    .conversation-item__checkbox .ticket-checkbox {
        -webkit-appearance: none;
           -moz-appearance: none;
                appearance: none;
        width: 24px;
        height: 24px;
        border: 2px solid var(--text-muted);
        border-radius: 50%;
        background: transparent;
    }

    .conversation-item__checkbox .ticket-checkbox:checked {
        border-color: var(--accent);
        background: var(--accent);
    }

    .conversation-list--bulk-mode .conversation-item__checkbox {
        display: flex;
    }

    kbd {
        display: none;
    }
}
/* ============================================
   Responsive Styles - 640px Breakpoint
   ============================================ */
@media (max-width: 640px) {
    .filter-form {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        gap: var(--space-2);
        padding: var(--space-3) var(--space-4);
        background: var(--surface);
        border-bottom: 1px solid var(--border);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        z-index: var(--z-dropdown);
    }

    .filter-form--visible {
        display: flex;
    }

    [data-theme="dark"] .filter-form {
        background: var(--surface-raised);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    }

    .filter-form .filter-dropdown,
    .filter-form .sort-dropdown {
        display: block;
        width: 100%;
    }

    .filter-trigger-mobile {
        display: flex;
    }

    .list-toolbar {
        position: relative;
    }

    .ticket-row {
        padding: var(--space-3) var(--space-4);
    }

    .ticket-folder {
        display: none;
    }

    .list-toolbar {
        padding: var(--space-3) var(--space-4);
    }

    .search-trigger {
        flex: 1;
        min-width: 0;
    }

    .search-trigger-text {
        display: none;
    }

    .customer-meta {
        flex-direction: column;
        gap: var(--space-1);
    }

    .page-content {
        padding: var(--space-5) var(--space-4);
    }

    .page-content.narrow {
        padding: var(--space-5) var(--space-4) var(--space-7);
    }

    .customer-company {
        display: none;
    }

    .action-buttons {
        justify-content: flex-start;
    }

    .action-buttons .dropdown .btn,
    .action-buttons > .btn {
        font-size: var(--text-xs);
        padding: var(--space-1) var(--space-1);
    }

    .form-row-inline {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-2);
    }

    .search-modal-overlay {
        padding-top: 0;
        align-items: stretch;
    }

    .search-modal--visible {
        max-width: none;
        border-radius: 0;
        height: 100%;
        display: flex;
        flex-direction: column;
    }

    .search-modal-results {
        flex: 1;
        max-height: 90vh;
    }

    .search-modal-filters {
        grid-template-columns: repeat(2, 1fr);
    }
}
/* ============================================
   Responsive Styles - 480px Breakpoint
   ============================================ */
@media (max-width: 480px) {
    .modal-overlay {
        padding-top: 0;
        align-items: flex-end;
    }

    .modal-panel {
        max-width: none;
        border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    }

    .skeleton-from,
    .skeleton-folder {
        display: none;
    }
}
/* fixes bootstrap's reboot */
lexxy-editor summary {
    display: grid !important;
}
.lexxy-editor__content:focus-visible { outline: none !important; }
.composer:has(#modeNote:checked) .lexxy-editor__content {
    background: var(--note-bg);
}
