/**
 * AF Translate — Elite Accessibility UI Framework
 * Architecture: California Inclusive Design Specification (A11y/UX Winner)
 */

 :root {
    /* Color Tokens - Optimized Contextual Contrast (WCAG 2.2 Triple-A Target) */
    --aft-bg-app: #f8fafc;
    --aft-surface: #ffffff;
    --aft-border-muted: #cbd5e1;       /* Accessible 3:1 boundary gray */
    --aft-border-focus: #0f172a;       /* Prominent interactive focus edge */

    --aft-text-main: #0f172a;          /* Rich contrast off-black */
    --aft-text-muted: #475569;         /* High-contrast functional subtext */
    --aft-text-ghost: #64748b;         /* Minimum descriptive text baseline */

    /* Accessible Luxury Accents */
    --aft-brand: #1d4ed8;              /* High-contrast calibrated Cobalt Blue */
    --aft-brand-focus-ring: rgba(29, 78, 216, 0.24);

    /* Accessible High-Contrast Semantic Micro-Pills */
    --aft-status-ok-txt: #064e3b;
    --aft-status-ok-bg: #d1fae5;
    --aft-status-warn-txt: #7f1d1d;
    --aft-status-warn-bg: #fee2e2;
    --aft-status-neutral-txt: #1e293b;
    --aft-status-neutral-bg: #e2e8f0;

    /* Structural Geometry & Target Safety */
    --aft-radius-sm: 8px;
    --aft-radius-md: 12px;
    --aft-radius-lg: 16px;
    --aft-transition-smooth: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);

    /* Clean Shadows (Enhanced depth separation for focus elements) */
    --aft-shadow-sm: 0 1px 3px 0 rgba(15, 23, 42, 0.05);
    --aft-shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
    --aft-shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.04);
}

/* --- Layout Frame System --- */
.af-translate-wrapper {
    margin: 2rem auto;
    max-width: 1280px;
    padding: 0 1.5rem;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    color: var(--aft-text-main);
    line-height: 1.5;
}

/* --- Header Architecture --- */
.af-translate-header {
    border-bottom: 2px solid var(--aft-border-muted);
    padding-bottom: 1.5rem;
    margin-bottom: 2.5rem;
}

.af-translate-header h1 {
    font-size: 1.875rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    color: var(--aft-text-main);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0;
}

.af-translate-header h1 span {
    color: var(--aft-brand);
    font-weight: 500;
}

.section-title {
    font-size: 1.125rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin: 2.5rem 0 1rem;
    color: var(--aft-text-main);
}

/* --- The Cards Ecosystem --- */
.af-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.af-sys-card {
    background: var(--aft-surface);
    border: 1px solid var(--aft-border-muted);
    box-shadow: var(--aft-shadow-md);
    padding: 1.5rem;
    border-radius: var(--aft-radius-md);
    transition: var(--aft-transition-smooth);
}

.af-sys-card:hover {
    border-color: var(--aft-text-ghost);
    box-shadow: var(--aft-shadow-lg);
}

/* --- Split Canvas System Layout --- */
.af-editor-canvas {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin-top: 1rem;
    width: 100%;
}

.split-workspace-container {
    display: grid;
    grid-template-columns: 55% 45%;
    gap: 1.5rem;
    min-height: 600px;
    align-items: start;
}

@media (max-width: 1024px) {
    .split-workspace-container {
        grid-template-columns: 1fr;
    }
}

.pane-card {
    background: var(--aft-surface);
    border: 1px solid var(--aft-border-muted);
    border-radius: var(--aft-radius-md);
    box-shadow: var(--aft-shadow-sm);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.pane-header {
    padding: 1rem 1.25rem;
    background: var(--aft-bg-app);
    border-bottom: 1px solid var(--aft-border-muted);
    font-weight: 700;
    font-size: 0.9375rem;
    color: var(--aft-text-main);
    display: flex;
    align-items: center;
}

.scrollable-table-wrapper {
    max-height: 620px;
    overflow-y: auto;
    position: relative;
}

/* --- Interactive Workspace Data Tables --- */
.strings-manager-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 0;
}

.strings-manager-table th {
    position: sticky;
    top: 0;
    background: var(--aft-bg-app);
    z-index: 2;
    padding: 0.875rem 1.25rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--aft-text-muted);
    border-bottom: 2px solid var(--aft-border-muted);
}

.strings-manager-table td {
    padding: 1.125rem 1.25rem; /* Enhanced 44px minimum target safe click zone */
    font-size: 0.875rem;
    color: var(--aft-text-main);
    border-bottom: 1px solid var(--aft-border-muted);
    vertical-align: top;
    cursor: pointer;
    transition: var(--aft-transition-smooth);
}

.strings-manager-table tr.string-row:hover td {
    background: rgba(241, 245, 249, 0.7);
}

/* Explicit accessibility active target focus mapping */
.strings-manager-table tr.string-row.is-active td {
    background: #eff6ff;
    border-bottom-color: #bfdbfe;
}
.strings-manager-table tr.string-row.is-active td:first-child {
    box-shadow: inset 4px 0 0 0 var(--aft-brand);
}

/* --- High-Contrast Badges & Dots --- */
.badge-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    font-size: 0.6875rem;
    font-weight: 700;
    border-radius: var(--aft-radius-sm);
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.badge-context {
    background: #f5f3ff;
    color: #5b21b6;
    border: 1px solid #ddd6fe;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.badge-plural {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
    margin-left: 0.5rem;
}

.state-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 0.625rem;
    vertical-align: middle;
}

.dot-untranslated { background: #b45309; } /* Calibrated for dark gold visibility */
.dot-translated { background: #15803d; }   /* Solid accessible forest green */
.dot-dirty {
    background: #b91c1c;
    box-shadow: 0 0 0 2px #fef2f2, 0 0 4px #b91c1c;
}

/* --- High-Precision Progress Engine --- */
.progress-bar-container {
    width: 100%;
    height: 8px;
    background: var(--aft-status-neutral-bg);
    border-radius: 100px;
    overflow: hidden;
    /* margin-bottom: 0.5rem; */
}

.progress-bar-fill {
    height: 100%;
    background: var(--aft-brand);
    border-radius: 100px;
    transition: var(--aft-transition-smooth);
}

.progress-lbl {
    font-size: 0.875rem;
    color: var(--aft-text-muted);
    font-weight: 600;
}

/* --- Search & Filtering Control Center --- */
.workspace-filter-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    background: var(--aft-surface);
    padding: 1rem;
    border: 1px solid var(--aft-border-muted);
    border-radius: var(--aft-radius-md);
    margin-bottom: 1.5rem;
    box-shadow: var(--aft-shadow-sm);
}

.workspace-filter-toolbar input,
.workspace-filter-toolbar select {
    height: 44px; /* Native tap/click optimization minimum size */
    padding: 0 1rem;
    background: var(--aft-surface);
    border: 1px solid var(--aft-border-muted);
    border-radius: var(--aft-radius-sm);
    font-size: 0.9375rem;
    color: var(--aft-text-main);
    transition: var(--aft-transition-smooth);
    outline: none;
}

.workspace-filter-toolbar input { flex-grow: 1; }
.workspace-filter-toolbar select { min-width: 240px; }

/* Enhanced Focus States (No hidden outlines) */
.workspace-filter-toolbar input:focus-visible,
.workspace-filter-toolbar select:focus-visible {
    border-color: var(--aft-brand);
    box-shadow: 0 0 0 3px var(--aft-brand-focus-ring);
}

/* --- Interactive Workbench Editor Controls --- */
.workbench-inner {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.meta-block-card {
    background: var(--aft-bg-app);
    padding: 1rem;
    border-radius: var(--aft-radius-sm);
    border-left: 4px solid var(--aft-text-ghost);
    font-size: 0.875rem;
    color: var(--aft-text-muted);
    line-height: 1.6;
}

.workbench-field-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.workbench-field-group label {
    font-weight: 600;
    color: var(--aft-text-main);
    font-size: 0.875rem;
}

.read-reference-box {
    background: #f1f5f9;
    padding: 1rem;
    border-radius: var(--aft-radius-sm);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.875rem;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-all;
    color: #334155;
    border: 1px solid var(--aft-border-muted);
}

.workbench-textarea {
    width: 100%;
    border-radius: var(--aft-radius-sm);
    border: 1px solid var(--aft-border-muted);
    padding: 1rem;
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--aft-text-main);
    background: var(--aft-surface);
    transition: var(--aft-transition-smooth);
    resize: vertical;
}

.workbench-textarea:focus-visible {
    border-color: var(--aft-brand);
    box-shadow: 0 0 0 3px var(--aft-brand-focus-ring);
    outline: none;
}

.workbench-empty-state {
    padding: 5rem 1.5rem;
    text-align: center;
    color: var(--aft-text-ghost);
    font-style: italic;
    font-size: 0.9375rem;
}

/* --- Floating Command Sticky Bar --- */
.editor-sticky-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1.5rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--aft-border-muted);
    padding: 1.25rem 2rem;
    border-radius: var(--aft-radius-lg);
    margin-top: 2.5rem;
    position: sticky;
    bottom: 1.5rem;
    box-shadow: var(--aft-shadow-lg);
    z-index: 99;
}

/* Global Canvas Layout */
.af-workspace-wrapper {
    margin: 20px 20px 0 0;
    max-width: 1400px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Navigation Utility Elements */
.af-back-link {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    margin-bottom: 16px;
    font-weight: 500;
}

/* Consolidated Control Center Hub */
.af-dashboard-header-hub {
    background: #ffffff;
    border: 1px solid #dcdcde;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    margin-bottom: 24px;
}
.af-hub-primary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #f0f0f1;
}
.af-hub-title-area h2 {
    margin: 0 0 6px 0;
    font-size: 20px;
    font-weight: 600;
    color: #1d2327;
    display: flex;
    align-items: center;
    gap: 10px;
}
.af-context-badge {
    background: #f0f6fc;
    color: #0a4b78;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.af-hub-meta-text {
    font-size: 13px;
    color: #646970;
    margin: 0;
}
.af-hub-secondary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 24px;
    background: #f8f9fa;
    border-radius: 0 0 6px 6px;
}
.af-button-cluster {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Core Data Table View Card */
.af-data-view-card {
    background: #ffffff;
    border: 1px solid #dcdcde;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    padding: 24px;
}
.af-card-title {
    margin: 0 0 18px 0;
    font-size: 16px;
    font-weight: 600;
    color: #1d2327;
}

/* Table Grid Row Polish overrides */
table.af-localization-table {
    border: none;
    box-shadow: none;
}
table.af-localization-table thead th {
    background: #f0f0f1;
    font-weight: 600;
    padding: 12px;
    color: #2c3338;
}
table.af-localization-table tbody td {
    padding: 16px 12px;
    vertical-align: middle;
}

/* Dashboard Progress Tracks */
.af-progress-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}
.af-progress-track {
    width: 140px;
    background: #e0e0e0;
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
}
.af-progress-fill {
    height: 100%;
    background: #00a32a;
    transition: width 0.3s ease;
}
.af-progress-label {
    font-size: 13px;
    font-weight: 600;
    color: #2c3338;
}

/* Dynamic Action Modals */
.af-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(30, 30, 37, 0.5);
    backdrop-filter: blur(2px);
    z-index: 99999;
    justify-content: center;
    align-items: center;
}
.af-modal-box {
    background: #ffffff;
    padding: 32px;
    border-radius: 8px;
    max-width: 480px;
    width: 100%;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
}

/* --- Native Clean Canvas Safeguard --- */
body.toplevel_page_af-translate div.fs-notice.promotion,
body.toplevel_page_af-translate div.fs-notice.success,
body.toplevel_page_af-translate div.fs-notice.updated,
body.toplevel_page_af-translate .notice-success,
body.toplevel_page_af-translate div.updated,
body.toplevel_page_af-translate div.notice {
    display: none !important;
}
body.af-translate_page_af-translate-themes div.fs-notice.promotion,
body.af-translate_page_af-translate-themes div.fs-notice.success,
body.af-translate_page_af-translate-themes div.fs-notice.updated,
body.af-translate_page_af-translate-themes .notice-success,
body.af-translate_page_af-translate-themes div.updated,
body.af-translate_page_af-translate-themes div.notice {
    display: none !important;
}
body.af-translate_page_af-translate-plugins div.fs-notice.promotion,
body.af-translate_page_af-translate-plugins div.fs-notice.success,
body.af-translate_page_af-translate-plugins div.fs-notice.updated,
body.af-translate_page_af-translate-plugins .notice-success,
body.af-translate_page_af-translate-plugins div.updated,
body.af-translate_page_af-translate-plugins div.notice {
    display: none !important;
}
body.af-translate_page_af-translate-ai-connecter div.fs-notice.promotion,
body.af-translate_page_af-translate-ai-connecter div.fs-notice.success,
body.af-translate_page_af-translate-ai-connecter div.fs-notice.updated,
body.af-translate_page_af-translate-ai-connecter .notice-success,
body.af-translate_page_af-translate-ai-connecter div.updated,
body.af-translate_page_af-translate-ai-connecter div.notice {
    display: none !important;
}
body.af-translate_page_af-translate-core div.fs-notice.promotion,
body.af-translate_page_af-translate-core div.fs-notice.success,
body.af-translate_page_af-translate-core div.fs-notice.updated,
body.af-translate_page_af-translate-core .notice-success,
body.af-translate_page_af-translate-core div.updated,
body.af-translate_page_af-translate-core div.notice {
    display: none !important;
}
body.af-translate_page_af-translate-pro-glossary div.fs-notice.promotion,
body.af-translate_page_af-translate-pro-glossary div.fs-notice.success,
body.af-translate_page_af-translate-pro-glossary div.fs-notice.updated,
body.af-translate_page_af-translate-pro-glossary .notice-success,
body.af-translate_page_af-translate-pro-glossary div.updated,
body.af-translate_page_af-translate-pro-glossary div.notice {
    display: none !important;
}

/* Scope styles cleanly to prevent admin pollution */
    .af-dashboard-wrapper {
        margin: 20px 20px 0 0;
        font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    }
    
    /* Top Toolbar Framework */
    .af-dashboard-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding-bottom: 20px;
        border-bottom: 1px solid #e2e8f0;
        margin-bottom: 20px;
    }
    .af-header-title {
        margin: 0 0 6px 0;
        font-weight: 700;
        font-size: 24px;
        color: #0f172a;
        letter-spacing: -0.02em;
    }
    .af-header-desc {
        margin: 0;
        font-size: 13.5px;
        color: #64748b;
    }

    /* Action Control Utilities */
    .af-action-group {
        display: flex;
        gap: 10px;
        align-items: center;
    }
    .af-btn-modern {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        height: 38px;
        padding: 0 16px;
        border-radius: 6px;
        font-weight: 600;
        font-size: 13px;
        cursor: pointer;
        transition: all 0.15s ease-in-out;
        border: 1px solid transparent;
        text-decoration: none;
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    }
    .af-btn-modern.primary {
        background: #2563eb;
        color: #ffffff;
    }
    .af-btn-modern.primary:hover {
        background: #1d4ed8;
        color: #ffffff;
    }
    .af-btn-modern.secondary {
        background: #ffffff;
        border-color: #cbd5e1;
        color: #334155;
    }
    .af-btn-modern.secondary:hover {
        background: #f8fafc;
        border-color: #94a3b8;
        color: #0f172a;
    }

    /* Search & Filter Component */
    .af-search-panel {
        background: #ffffff;
        border: 1px solid #e2e8f0;
        border-radius: 8px;
        padding: 16px;
        margin-bottom: 20px;
        box-shadow: 0 1px 3px rgba(0,0,0,0.02);
    }
    .af-search-input-wrapper {
        position: relative;
        max-width: 480px;
        width: 100%;
    }
    .af-search-input-wrapper .dashicons {
        position: absolute;
        left: 12px;
        top: 50%;
        transform: translateY(-50%);
        color: #94a3b8;
        font-size: 18px;
        width: 18px;
        height: 18px;
    }
    .af-search-input-field {
        width: 100%;
        height: 40px;
        padding: 0 12px 0 38px !important;
        border: 1px solid #cbd5e1 !important;
        border-radius: 6px !important;
        background: #f8fafc !important;
        font-size: 14px !important;
        transition: all 0.15s ease-in-out !important;
    }
    .af-search-input-field:focus {
        background: #ffffff !important;
        border-color: #2563eb !important;
        box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15) !important;
        outline: none;
    }

    /* FIXED VIEW HEIGHT MATRIX CONTAINER */
    .af-table-scroll-frame {
        background: #ffffff;
        border: 1px solid #e2e8f0;
        border-radius: 8px;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
        overflow-y: auto;
        /* Dynamic viewport computation or clean 600px threshold fallback */
        height: calc(100vh - 290px);
        min-height: 400px;
        max-height: 600px;
        position: relative;
    }

    /* Modern Table Architectural Overrides */
    table.af-dashboard-table {
        width: 100%;
        border-collapse: separate;
        border-spacing: 0;
        margin: 0;
    }
    .af-dashboard-table thead th {
        position: sticky;
        top: 0;
        background: #f8fafc;
        z-index: 10;
        font-weight: 600;
        font-size: 13px;
        color: #475569;
        padding: 14px 16px;
        border-bottom: 2px solid #e2e8f0;
        text-align: left;
        box-shadow: inset 0 -1px 0 #e2e8f0;
    }
    .af-dashboard-table tbody td {
        padding: 14px 16px;
        vertical-align: middle;
        font-size: 13.5px;
        color: #334155;
        border-bottom: 1px solid #f1f5f9;
    }
    .af-dashboard-table tbody tr:last-child td {
        border-bottom: none;
    }
    .af-dashboard-table tbody tr:hover td {
        background: #f8fafc;
    }

    /* Specialized Micro-elements & Badges */
    .af-term-token {
        font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
        font-size: 13px;
        font-weight: 600;
        color: #dc2626;
        background: #fef2f2;
        padding: 4px 8px;
        border-radius: 4px;
        border: 1px solid #fee2e2;
    }
    .af-pos-tag {
        font-size: 11px;
        font-weight: 700;
        text-transform: uppercase;
        background: #e2e8f0;
        padding: 2px 6px;
        border-radius: 4px;
        color: #475569;
        letter-spacing: 0.03em;
    }
    .af-status-pill {
        font-size: 10.5px;
        font-weight: 600;
        padding: 2px 7px;
        border-radius: 12px;
        margin-left: 8px;
        text-transform: uppercase;
        display: inline-flex;
        align-items: center;
        letter-spacing: 0.02em;
    }
    .af-status-pill.custom {
        background: #dcfce7;
        color: #15803d;
        border: 1px solid #bbf7d0;
    }
    .af-status-pill.synced {
        background: #dbeafe;
        color: #1d4ed8;
        border: 1px solid #bfdbfe;
    }

    /* Action Links UI */
    .af-row-actions-flex {
        display: flex;
        justify-content: flex-end;
        align-items: center;
        gap: 10px;
    }
    .af-inline-link {
        background: none !important;
        border: none !important;
        padding: 0 !important;
        margin: 0 !important;
        font-weight: 600 !important;
        font-size: 13px !important;
        cursor: pointer;
        text-decoration: none !important;
        box-shadow: none !important;
    }
    .af-inline-link.edit { color: #2563eb !important; }
    .af-inline-link.edit:hover { color: #1d4ed8 !important; text-decoration: underline !important; }
    .af-inline-link.delete { color: #df2c2c !important; }
    .af-inline-link.delete:hover { color: #b91c1c !important; text-decoration: underline !important; }

    /* Modern Application Modals */
    .af-modal-overlay {
        display: none;
        position: fixed;
        z-index: 999999;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        background: rgba(15, 23, 42, 0.6);
        backdrop-filter: blur(4px);
        align-items: center;
        justify-content: center;
    }
    .af-modal-box {
        background: #ffffff;
        border-radius: 12px;
        max-width: 500px;
        width: 100%;
        padding: 28px;
        position: relative;
        box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
        border: 1px solid #e2e8f0;
    }
    .af-modal-title {
        margin: 0 0 16px 0;
        font-size: 18px;
        font-weight: 700;
        color: #0f172a;
        padding-bottom: 12px;
        border-bottom: 1px solid #e2e8f0;
    }
    .af-modal-box label {
        font-weight: 600;
        display: block;
        margin-bottom: 6px;
        color: #334155;
        font-size: 13px;
    }
    .af-modal-box input[type="text"], .af-modal-box select, .af-modal-box textarea {
        width: 100%;
        border-radius: 6px !important;
        border: 1px solid #cbd5e1 !important;
        padding: 8px 12px !important;
        font-size: 14px !important;
        background: #f8fafc !important;
    }
    .af-modal-box input:focus, .af-modal-box select:focus, .af-modal-box textarea:focus {
        border-color: #2563eb !important;
        background: #ffffff !important;
        box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15) !important;
    }
    .af-modal-form-p { margin: 0 0 16px 0; }
    .af-modal-footer {
        text-align: right;
        margin-top: 24px;
        display: flex;
        justify-content: flex-end;
        gap: 12px;
    }

    /* Custom Slim Scrollbar Styling */
    .af-table-scroll-frame::-webkit-scrollbar {
        width: 8px;
        height: 8px;
    }
    .af-table-scroll-frame::-webkit-scrollbar-track {
        background: #f1f5f9;
    }
    .af-table-scroll-frame::-webkit-scrollbar-thumb {
        background: #cbd5e1;
        border-radius: 4px;
    }
    .af-table-scroll-frame::-webkit-scrollbar-thumb:hover {
        background: #94a3b8;
    }



    /* glossary highlights */
    .af-glossary-word {
                border-bottom: 1px dashed #2271b1;
                color: #1d2327;
                font-weight: 500;
                cursor: help;
                background: rgba(240, 246, 252, 0.4);
                padding: 0 2px;
                border-radius: 2px;
                transition: background 0.15s ease-in-out;
            }
            .af-glossary-word:hover {
                background: rgba(34, 113, 177, 0.1);
                color: #2271b1;
            }
            
            /* INTERACTIVE TOOLTIP PANEL CONTAINER */
            .af-glossary-tooltip-panel {
                position: absolute;
                z-index: 999999;
                background: #ffffff;
                border: 1px solid #8c8f94;
                border-radius: 6px;
                padding: 12px 14px;
                width: 280px;
                box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
                font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
                display: none;
                pointer-events: auto; /* Crucial: Allows moving mouse inside to click copy button */
            }
            .af-tooltip-item {
                margin-bottom: 8px;
                padding-bottom: 8px;
                border-bottom: 1px dashed #dcdcde;
            }
            .af-tooltip-item:last-child {
                margin-bottom: 0;
                padding-bottom: 0;
                border-bottom: none;
            }
            .af-tooltip-header {
                font-size: 11px;
                font-weight: 700;
                text-transform: uppercase;
                color: #646970;
                margin-bottom: 6px;
                letter-spacing: 0.05em;
            }
            .af-tooltip-header em {
                color: #1d2327;
                font-style: normal;
                background: #f0f0f1;
                padding: 2px 5px;
                border-radius: 3px;
                margin-right: 4px;
            }
            .af-tooltip-translation-wrapper {
                display: flex;
                justify-content: space-between;
                align-items: center;
                gap: 10px;
                margin-top: 4px;
            }
            .af-tooltip-translation {
                font-size: 13px;
                font-weight: 600;
                color: #1d2327;
                font-family: monospace;
            }
            .af-tooltip-comment {
                font-size: 12px;
                color: #646970;
                font-style: italic;
                line-height: 1.4;
                margin-top: 6px;
                background: #fafafa;
                padding: 6px;
                border-left: 2px solid #dcdcde;
            }

            /* INLINE ACTION COPY BUTTON */
            .af-tooltip-copy-btn {
                background: #f0f6fc;
                border: 1px solid #2271b1;
                color: #2271b1;
                border-radius: 3px;
                padding: 3px 6px;
                font-size: 11px;
                font-weight: 500;
                cursor: pointer;
                display: inline-flex;
                align-items: center;
                gap: 4px;
                line-height: 1;
                transition: all 0.1s ease-in-out;
            }
            .af-tooltip-copy-btn:hover {
                background: #2271b1;
                color: #fff;
            }
            .af-tooltip-copy-btn.copied {
                background: #46b450;
                border-color: #46b450;
                color: #fff;
            }