/* TXH AI Manager Shortcode */
.txh-sc-wrap { direction: rtl; font-family: inherit; }

/* Search bar */
.txh-sc-search-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}
.txh-sc-search-bar input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    direction: rtl;
}
.txh-sc-count {
    font-size: 13px;
    color: #888;
    white-space: nowrap;
}

/* Table */
.txh-sc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.txh-sc-table th {
    background: #f5f5f5;
    padding: 10px 12px;
    text-align: right;
    border-bottom: 2px solid #e0e0e0;
    font-weight: 600;
}
.txh-sc-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}
.txh-sc-table tr:hover td { background: #fafafa; }

/* Generate button */
.txh-sc-btn {
    background: #2271b1;
    color: #fff;
    border: none;
    padding: 7px 14px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 13px;
    transition: background .2s;
}
.txh-sc-btn:hover { background: #135e96; }
.txh-sc-btn:disabled { background: #aaa; cursor: not-allowed; }

.txh-sc-status {
    margin-right: 8px;
    font-size: 16px;
}

/* Overlay */
#txh-sc-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 9998;
}

/* Modal */
.txh-sc-modal {
    position: fixed;
    top: 5vh;
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    border-radius: 8px;
    width: 92%;
    max-width: 860px;
    z-index: 99999;
    box-shadow: 0 8px 32px rgba(0,0,0,.25);
    direction: rtl;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 88vh;
}
.txh-sc-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    border-bottom: 1px solid #eee;
    font-size: 15px;
    flex-shrink: 0;
}
.txh-sc-modal-header button {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #333;
    line-height: 1;
    padding: 0 4px;
}
.txh-sc-modal-body {
    padding: 16px 20px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
}
.txh-sc-modal-links {
    margin-bottom: 10px;
    font-size: 13px;
}
.txh-sc-modal-links a { color: #2271b1; text-decoration: none; margin: 0 4px; }
.txh-sc-modal-footer {
    padding: 14px 20px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    flex-shrink: 0;
    background: #fff;
}

/* Fields table inside modal */
.txh-sc-fields-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.txh-sc-fields-table th {
    background: #f5f5f5;
    padding: 8px 10px;
    text-align: right;
    border-bottom: 1px solid #e0e0e0;
}
.txh-sc-fields-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}

.txh-empty     { color: #999; font-size: 12px; }
.txh-has-val {
    color: #2271b1;
    font-size: 12px;
    display: block;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 120px;
    overflow-y: auto;
    line-height: 1.5;
}

/* Buttons */
.txh-sc-run-btn {
    background: #2271b1;
    color: #fff;
    border: none;
    padding: 9px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
}
.txh-sc-run-btn:disabled { background: #aaa; }
.txh-sc-cancel-btn {
    background: #f0f0f0;
    color: #333;
    border: none;
    padding: 9px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
}

/* ═══════════════════════════════════════
   Self Shortcode [txh_ai_self]
═══════════════════════════════════════ */
.txh-self-wrap { max-width: 860px; margin: 0 auto; }

.txh-self-header { margin-bottom: 20px; }
.txh-self-header h3 { margin: 0 0 4px; font-size: 20px; }
.txh-self-sub { margin: 0; color: #666; font-size: 14px; }

.txh-self-url-box {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 16px 20px;
    margin-bottom: 16px;
}
.txh-self-url-box label { display: block; margin-bottom: 10px; }
.txh-self-url-row {
    display: flex;
    gap: 10px;
    align-items: center;
}
.txh-self-url-row input {
    flex: 1;
    padding: 9px 14px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    direction: ltr;
}
#txh-self-url-status { font-size: 13px; margin-right: 8px; }

.txh-self-fields-box {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 16px 20px;
    margin-bottom: 16px;
}
.txh-self-fields-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.txh-self-fields-list { overflow-x: auto; }

.txh-self-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}
#txh-self-status { font-size: 14px; font-weight: bold; }

.txh-btn-secondary {
    background: #f0f0f0 !important;
    color: #333 !important;
    white-space: nowrap;
}
.txh-btn-secondary:hover { background: #e0e0e0 !important; }
