/* TikTok Agency Hub — Public Styles
   Design: inspired by tiktok-live-monitoring-webui (dark theme)
   Font: Geist via Google Fonts
*/
@import url('https://fonts.googleapis.com/css2?family=Geist:wght@300;400;500;600;700&display=swap');

/* ── Design tokens ─────────────────────────────────────────────────────── */
:root {
    --tah-bg:           #0c0a09;
    --tah-bg-card:      #1c1917;
    --tah-bg-input:     #292524;
    --tah-bg-muted:     #1f1d1b;
    --tah-border:       #2e2b28;
    --tah-border-hover: #44403c;
    --tah-text:         #fafaf9;
    --tah-text-muted:   #a8a29e;
    --tah-text-subtle:  #78716c;
    --tah-primary:      #FE2C55;
    --tah-primary-dim:  rgba(254, 44, 85, 0.15);
    --tah-secondary:    #25F4EE;
    --tah-secondary-dim:rgba(37, 244, 238, 0.12);
    --tah-success:      #22c55e;
    --tah-success-dim:  rgba(34, 197, 94, 0.12);
    --tah-warning:      #f59e0b;
    --tah-danger:       #ef4444;
    --tah-radius:       0.75rem;
    --tah-radius-sm:    0.5rem;
    --tah-radius-full:  9999px;
    --tah-shadow:       0 4px 24px rgba(0,0,0,.45);
    --tah-shadow-sm:    0 2px 8px rgba(0,0,0,.3);
    --tah-font:         'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --tah-transition:   0.18s ease;
}

/* ── Base ──────────────────────────────────────────────────────────────── */
.tah-dashboard,
.tah-register-wrap {
    font-family: var(--tah-font);
    color: var(--tah-text);
    -webkit-font-smoothing: antialiased;
    background: var(--tah-bg);
    min-height: 100vh;
}

/* Force dark theme with explicit values for all elements inside tah-dashboard */
.tah-dashboard {
    --tah-bg:           #0c0a09;
    --tah-bg-card:      #1c1917;
    --tah-bg-input:     #292524;
    --tah-bg-muted:     #1f1d1b;
    --tah-border:       #2e2b28;
    --tah-border-hover: #44403c;
    --tah-text:         #fafaf9;
    --tah-text-muted:   #a8a29e;
    --tah-text-subtle:  #78716c;
    --tah-primary:      #FE2C55;
    --tah-primary-dim:  rgba(254, 44, 85, 0.15);
    --tah-secondary:    #25F4EE;
    --tah-secondary-dim:rgba(37, 244, 238, 0.12);
    --tah-success:      #22c55e;
    --tah-success-dim:  rgba(34, 197, 94, 0.12);
    --tah-warning:      #f59e0b;
    --tah-danger:       #ef4444;
    --tah-font:         'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #0c0a09;
}

/* Override WordPress theme styles on dashboard page */
body.tah-dashboard-page,
body.tah-dashboard-page #content,
body.tah-dashboard-page .entry-content,
body.tah-dashboard-page .site-content,
body.tah-dashboard-page .site-main {
    background: #0c0a09 !important;
}

/* ── Notices ────────────────────────────────────────────────────────────── */
.tah-notice {
    padding: 12px 16px;
    border-radius: var(--tah-radius-sm);
    margin: 12px 0;
    font-size: .88rem;
    font-weight: 500;
    border: 1px solid;
    display: flex;
    align-items: center;
    gap: 8px;
}
.tah-notice-warning { background: rgba(245,158,11,.1); color: #fbbf24; border-color: rgba(245,158,11,.25); }
.tah-notice-info    { background: rgba(37,244,238,.08); color: var(--tah-secondary); border-color: rgba(37,244,238,.2); }
.tah-notice-error   { background: rgba(239,68,68,.1);  color: #f87171; border-color: rgba(239,68,68,.25); }
.tah-notice-success { background: var(--tah-success-dim); color: var(--tah-success); border-color: rgba(34,197,94,.25); }

/* ── Dashboard wrapper ──────────────────────────────────────────────────── */
.tah-dashboard {
    max-width: 1040px;
    margin: 0 auto;
    padding: 8px 0 40px;
}

/* ── Header ─────────────────────────────────────────────────────────────── */
.tah-dash-header {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--tah-bg-card);
    border: 1px solid var(--tah-border);
    border-radius: var(--tah-radius);
    padding: 18px 20px;
    margin-bottom: 20px;
    box-shadow: var(--tah-shadow-sm);
}

.tah-avatar-btn {
    position: relative !important;
    background: none !important;
    border: none !important;
    padding: 0 !important;
    cursor: pointer !important;
    width: 52px !important;
    height: 52px !important;
    border-radius: var(--tah-radius-sm) !important;
    flex-shrink: 0 !important;
    overflow: hidden !important;
}
.tah-avatar-btn:hover .tah-avatar-edit-icon { opacity: 1; }

.tah-dash-avatar,
.tah-avatar-btn > span:first-child {
    position: absolute !important;
    inset: 0 !important;
    border-radius: var(--tah-radius-sm);
    background: linear-gradient(135deg, var(--tah-primary) 0%, #ff6b6b 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
}

.tah-avatar-btn img.tah-avatar-img,
#tah-avatar-img {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    border-radius: 0 !important;
    object-fit: cover !important;
    object-position: center top !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
}

.tah-avatar-edit-icon {
    position: absolute;
    bottom: 2px;
    right: 2px;
    background: rgba(0,0,0,.7);
    border-radius: 50%;
    font-size: .6rem;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--tah-transition);
}

.tah-dash-info { flex: 1; min-width: 0; }
.tah-dash-info h2 {
    margin: 0;
    color: var(--tah-text);
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: -.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tah-dash-info p {
    margin: 3px 0 0;
    color: var(--tah-text-muted);
    font-size: .78rem;
}

.tah-dash-status {
    font-size: .72rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: var(--tah-radius-full);
    letter-spacing: .04em;
    text-transform: uppercase;
    background: var(--tah-success-dim);
    color: var(--tah-success);
    border: 1px solid rgba(34,197,94,.2);
    white-space: nowrap;
}
.tah-dash-status.tah-status-suspended {
    background: rgba(239,68,68,.1);
    color: #f87171;
    border-color: rgba(239,68,68,.2);
}

/* ── Metrics grid ───────────────────────────────────────────────────────── */
.tah-metrics-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

@media (max-width: 600px) {
    .tah-metrics-grid { grid-template-columns: repeat(2, 1fr); }
}

.tah-metric-card {
    background: var(--tah-bg-card);
    border: 1px solid var(--tah-border);
    border-radius: var(--tah-radius);
    padding: 18px 16px;
    text-align: center;
    box-shadow: var(--tah-shadow-sm);
    transition: transform var(--tah-transition), border-color var(--tah-transition), box-shadow var(--tah-transition);
    position: relative;
    overflow: hidden;
}
.tah-metric-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    opacity: 0;
    transition: opacity var(--tah-transition);
    pointer-events: none;
}
.tah-metric-card:hover {
    transform: translateY(-2px);
    border-color: var(--tah-border-hover);
    box-shadow: var(--tah-shadow);
}

/* Colored accent strip on top */
.tah-metric-card::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    border-radius: var(--tah-radius) var(--tah-radius) 0 0;
}

.tah-metric-diamonds::after { background: var(--tah-secondary); }
.tah-metric-viewers::after  { background: var(--tah-primary); }
.tah-metric-likes::after    { background: #ff4d6d; }
.tah-metric-gifts::after    { background: var(--tah-warning); }
.tah-metric-sessions::after { background: #a78bfa; }
.tah-metric-peak::after     { background: #f97316; }

/* Placeholder when no metrics data */
.tah-metrics-placeholder {
    background: var(--tah-bg-card);
    border: 1px solid var(--tah-border);
    border-radius: var(--tah-radius);
    padding: 40px 24px;
    text-align: center;
    margin-bottom: 20px;
}
.tah-metrics-placeholder-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
    opacity: .7;
}
.tah-metrics-placeholder h4 {
    margin: 0 0 8px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--tah-text);
}
.tah-metrics-placeholder p {
    margin: 0;
    font-size: .85rem;
    color: var(--tah-text-muted);
    line-height: 1.5;
}

.tah-metric-icon {
    font-size: 1.4rem;
    margin-bottom: 8px;
    display: block;
    line-height: 1;
}
.tah-metric-value {
    font-size: 1.7rem;
    font-weight: 700;
    color: var(--tah-text);
    line-height: 1;
    letter-spacing: -.03em;
    margin-bottom: 4px;
}
.tah-metric-label {
    font-size: .72rem;
    color: var(--tah-text-muted);
    font-weight: 500;
    letter-spacing: .02em;
}

/* ── Prize progress ─────────────────────────────────────────────────────── */
.tah-prizes-section { margin-bottom: 20px; }
.tah-prizes-section h3 {
    font-size: .8rem;
    font-weight: 600;
    color: var(--tah-text-muted);
    letter-spacing: .08em;
    text-transform: uppercase;
    margin: 0 0 12px;
}

.tah-prize-bar-wrap {
    background: var(--tah-bg-card);
    border: 1px solid var(--tah-border);
    border-radius: var(--tah-radius);
    padding: 14px 16px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: var(--tah-shadow-sm);
    transition: border-color var(--tah-transition);
    border-left: 3px solid var(--tah-primary);
}
.tah-prize-bar-wrap:hover { border-color: var(--tah-border-hover); }
.tah-prize-achieved {
    border-left-color: var(--tah-success);
}

.tah-prize-img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: var(--tah-radius-sm);
    flex-shrink: 0;
    border: 1px solid var(--tah-border);
}

.tah-prize-bar-info { flex: 1; min-width: 0; }
.tah-prize-bar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}
.tah-prize-name {
    font-weight: 600;
    font-size: .9rem;
    color: var(--tah-text);
}
.tah-prize-pct {
    font-size: .8rem;
    font-weight: 700;
    color: var(--tah-primary);
}
.tah-prize-achieved .tah-prize-pct { color: var(--tah-success); }
.tah-prize-desc {
    font-size: .75rem;
    color: var(--tah-text-muted);
    margin: 0 0 8px;
}

.tah-progress-track {
    background: rgba(255,255,255,.06);
    border-radius: var(--tah-radius-full);
    height: 6px;
    overflow: hidden;
    margin-bottom: 6px;
}
.tah-progress-fill {
    height: 100%;
    border-radius: var(--tah-radius-full);
    background: linear-gradient(90deg, var(--tah-primary), #ff6b6b);
    transition: width .8s ease;
}
.tah-prize-achieved .tah-progress-fill {
    background: linear-gradient(90deg, var(--tah-success), #86efac);
}
.tah-prize-bar-footer {
    display: flex;
    justify-content: space-between;
    font-size: .72rem;
    color: var(--tah-text-subtle);
}

/* ── Backstage data section ─────────────────────────────────────────────── */
.tah-backstage-section { margin-bottom: 20px; }
.tah-backstage-section h3 {
    font-size: .8rem;
    font-weight: 600;
    color: var(--tah-text-muted);
    letter-spacing: .08em;
    text-transform: uppercase;
    margin: 0 0 12px;
}
.tah-backstage-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
}
.tah-backstage-item {
    background: var(--tah-bg-card);
    border: 1px solid var(--tah-border);
    border-radius: var(--tah-radius-sm);
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.tah-backstage-label {
    font-size: .7rem;
    font-weight: 600;
    color: var(--tah-text-subtle);
    text-transform: uppercase;
    letter-spacing: .06em;
}
.tah-backstage-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--tah-text);
    line-height: 1.2;
}
.tah-backstage-highlight {
    color: var(--tah-secondary);
}

/* ── Refresh / Logout row ───────────────────────────────────────────────── */
.tah-refresh-info {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
    font-size: .75rem;
    color: var(--tah-text-subtle);
}
.tah-btn-refresh,
.tah-btn-logout {
    background: transparent !important;
    border: 1px solid var(--tah-border) !important;
    border-radius: var(--tah-radius-full) !important;
    padding: 5px 12px !important;
    cursor: pointer !important;
    font-size: .75rem !important;
    color: var(--tah-text-muted) !important;
    font-weight: 500 !important;
    text-decoration: none !important;
    transition: border-color var(--tah-transition), color var(--tah-transition) !important;
    box-shadow: none !important;
    font-family: var(--tah-font) !important;
}
.tah-btn-refresh:hover,
.tah-btn-logout:hover {
    border-color: var(--tah-primary) !important;
    color: var(--tah-primary) !important;
}

/* ── Push notification section ──────────────────────────────────────────── */
.tah-push-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--tah-border);
}
.tah-push-buttons { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.tah-push-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: rgba(255,255,255,.04);
    border: 1px solid var(--tah-border);
    color: var(--tah-text-muted);
    border-radius: var(--tah-radius-full);
    padding: 7px 16px;
    font-size: .8rem;
    font-weight: 500;
    cursor: pointer;
    transition: background var(--tah-transition), color var(--tah-transition), border-color var(--tah-transition);
    font-family: var(--tah-font);
}
.tah-push-btn:hover {
    background: rgba(255,255,255,.08);
    color: var(--tah-text);
    border-color: var(--tah-border-hover);
}
.tah-push-btn.tah-push-active {
    background: var(--tah-primary-dim);
    border-color: var(--tah-primary);
    color: var(--tah-primary);
}
.tah-notif-history-btn { color: var(--tah-text-muted); }
.tah-push-msg { font-size: .75rem; min-height: 18px; text-align: center; color: var(--tah-text-muted); }

/* ── Register form ──────────────────────────────────────────────────────── */
.tah-register-wrap {
    display: flex;
    justify-content: center;
    padding: 32px 16px;
    min-height: 60vh;
    align-items: center;
}
.tah-register-card {
    background: var(--tah-bg-card);
    border: 1px solid var(--tah-border);
    border-radius: var(--tah-radius);
    padding: 36px 32px;
    max-width: 440px;
    width: 100%;
    box-shadow: var(--tah-shadow);
    text-align: center;
}
.tah-reg-logo-wrap { display: flex; justify-content: center; margin-bottom: 20px; }
.tah-reg-logo { max-height: 80px; max-width: 200px; object-fit: contain; }
.tah-register-card h2 {
    margin: 0 0 6px;
    color: var(--tah-text);
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: -.03em;
}
.tah-reg-subtitle {
    color: var(--tah-text-muted);
    font-size: .85rem;
    margin-bottom: 24px;
}

.tah-form-group { text-align: left; margin-bottom: 14px; }
.tah-form-group label {
    display: block;
    font-size: .78rem;
    font-weight: 600;
    color: var(--tah-text-muted);
    margin-bottom: 5px;
    letter-spacing: .03em;
    text-transform: uppercase;
}
.tah-form-group input {
    width: 100%;
    box-sizing: border-box;
    padding: 9px 12px;
    border: 1px solid var(--tah-border) !important;
    border-radius: var(--tah-radius-sm);
    font-size: .9rem;
    font-family: var(--tah-font);
    color: var(--tah-text) !important;
    background: var(--tah-bg-input) !important;
    transition: border-color var(--tah-transition), box-shadow var(--tah-transition);
}
.tah-form-group input::placeholder { color: var(--tah-text-subtle) !important; }
.tah-form-group input:focus {
    outline: none !important;
    border-color: var(--tah-primary) !important;
    box-shadow: 0 0 0 3px var(--tah-primary-dim) !important;
}
.tah-form-group small {
    display: block;
    font-size: .72rem;
    color: var(--tah-text-subtle);
    margin-top: 4px;
}
.tah-required { color: var(--tah-primary); }

/* Phone row in register */
.tah-phone-row {
    display: flex !important;
    gap: 8px !important;
    align-items: center !important;
    width: 100%;
}
.tah-phone-code-select {
    width: 140px !important;
    max-width: 140px !important;
    min-width: 140px !important;
    flex-shrink: 0 !important;
    padding: 9px 8px;
    border: 1px solid var(--tah-border) !important;
    border-radius: var(--tah-radius-sm);
    font-size: .85rem;
    font-family: var(--tah-font);
    color: var(--tah-text) !important;
    background: var(--tah-bg-input) !important;
    box-sizing: border-box;
}
.tah-phone-number-input {
    flex: 1 !important;
    min-width: 0 !important;
    width: auto !important;
}

.tah-btn-primary {
    width: 100%;
    padding: 11px;
    background: var(--tah-primary);
    color: #fff;
    border: none;
    border-radius: var(--tah-radius-sm);
    font-size: .95rem;
    font-weight: 600;
    font-family: var(--tah-font);
    cursor: pointer;
    transition: opacity var(--tah-transition), transform var(--tah-transition);
    margin-top: 8px;
    letter-spacing: -.01em;
}
.tah-btn-primary:hover { opacity: .9; transform: translateY(-1px); }
.tah-btn-primary:active { transform: translateY(0); }
.tah-btn-primary:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* ── Profile panel ──────────────────────────────────────────────────────── */
.tah-profile-panel {
    background: var(--tah-bg-card);
    border: 1px solid var(--tah-border);
    border-radius: var(--tah-radius);
    margin-bottom: 16px;
    overflow: hidden;
    box-shadow: var(--tah-shadow-sm);
}
.tah-profile-inner { padding: 18px 20px; }
.tah-profile-inner h3 {
    margin: 0 0 14px;
    color: var(--tah-text);
    font-size: .9rem;
    font-weight: 600;
}

.tah-profile-avatar-preview {
    display: flex;
    justify-content: center;
    margin-bottom: 14px;
}
.tah-profile-avatar-preview img {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--tah-primary);
}
.tah-profile-avatar-placeholder {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--tah-primary), #ff6b6b);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    font-weight: 700;
    color: #fff;
    border: 2px solid var(--tah-primary);
}

.tah-profile-fields { display: flex; flex-direction: column; gap: 10px; }
.tah-profile-field label {
    display: block;
    font-size: .75rem;
    font-weight: 600;
    color: var(--tah-text-muted);
    margin-bottom: 4px;
    letter-spacing: .03em;
    text-transform: uppercase;
}
.tah-profile-field input {
    width: 100%;
    box-sizing: border-box;
    padding: 8px 11px;
    background: var(--tah-bg-input);
    border: 1px solid var(--tah-border);
    border-radius: var(--tah-radius-sm);
    color: var(--tah-text) !important;
    font-size: .88rem;
    font-family: var(--tah-font);
    transition: border-color var(--tah-transition);
}
.tah-profile-field input:focus {
    outline: none;
    border-color: var(--tah-primary);
    box-shadow: 0 0 0 2px var(--tah-primary-dim);
}

.tah-btn-secondary {
    padding: 8px 13px;
    background: rgba(255,255,255,.05);
    border: 1px solid var(--tah-border);
    color: var(--tah-text-muted);
    border-radius: var(--tah-radius-sm);
    cursor: pointer;
    font-size: .85rem;
    font-family: var(--tah-font);
    font-weight: 500;
    white-space: nowrap;
    transition: border-color var(--tah-transition), color var(--tah-transition), background var(--tah-transition);
}
.tah-btn-secondary:hover {
    border-color: var(--tah-border-hover);
    color: var(--tah-text);
    background: rgba(255,255,255,.08);
}

/* ── Notification history modal ─────────────────────────────────────────── */
.tah-notif-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.75);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    backdrop-filter: blur(4px);
}
.tah-notif-modal {
    background: var(--tah-bg-card);
    border: 1px solid var(--tah-border);
    border-radius: var(--tah-radius);
    width: 100%;
    max-width: 440px;
    max-height: 78vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: var(--tah-shadow);
}
.tah-notif-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--tah-border);
    font-weight: 600;
    font-size: .9rem;
    color: var(--tah-text);
}
.tah-notif-modal-header button {
    background: none;
    border: none;
    color: var(--tah-text-muted);
    font-size: 1rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color var(--tah-transition);
}
.tah-notif-modal-header button:hover { color: var(--tah-text); }
.tah-notif-modal-body { overflow-y: auto; padding: 10px 14px; flex: 1; }
.tah-notif-loading, .tah-notif-empty {
    text-align: center;
    color: var(--tah-text-muted);
    padding: 24px;
    font-size: .85rem;
}
.tah-notif-item {
    display: block;
    background: rgba(255,255,255,.03);
    border: 1px solid var(--tah-border);
    border-radius: var(--tah-radius-sm);
    padding: 10px 12px;
    margin-bottom: 8px;
    color: inherit;
    text-decoration: none;
    transition: background var(--tah-transition), border-color var(--tah-transition);
}
.tah-notif-item:last-child { margin-bottom: 0; }
.tah-notif-item-title { font-weight: 600; color: var(--tah-text); font-size: .85rem; margin-bottom: 3px; }
.tah-notif-item-body  { color: var(--tah-text-muted); font-size: .78rem; margin-bottom: 5px; line-height: 1.4; }
.tah-notif-item-date  { color: var(--tah-text-subtle); font-size: .7rem; }
.tah-notif-item-link:hover {
    background: rgba(255,255,255,.06);
    border-color: var(--tah-border-hover);
}

/* ── AI Chat floating button ─────────────────────────────────────────────── */
#tah-ai-chat-toggle {
    position: fixed !important;
    bottom: 24px !important;
    right: 24px !important;
    z-index: 99999 !important;
    width: 52px !important;
    height: 52px !important;
    border-radius: 50% !important;
    background: var(--tah-primary) !important;
    color: #fff !important;
    border: none !important;
    font-size: 1.4rem !important;
    cursor: pointer !important;
    box-shadow: 0 4px 20px var(--tah-primary-dim), 0 0 0 1px rgba(254,44,85,.3) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: transform var(--tah-transition), box-shadow var(--tah-transition) !important;
}
#tah-ai-chat-toggle:hover {
    transform: scale(1.08) !important;
    box-shadow: 0 6px 28px rgba(254,44,85,.5), 0 0 0 1px rgba(254,44,85,.4) !important;
}

/* ── AI Chat panel ──────────────────────────────────────────────────────── */
#tah-ai-chat-panel {
    position: fixed !important;
    bottom: 88px !important;
    right: 24px !important;
    z-index: 99998 !important;
    width: 360px;
    height: 520px;
    max-width: calc(100vw - 40px);
    max-height: calc(100vh - 120px);
    background: var(--tah-bg-card);
    border: 1px solid var(--tah-border);
    border-radius: var(--tah-radius);
    box-shadow: var(--tah-shadow);
    display: flex !important;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(16px) scale(.97);
    pointer-events: none;
    transition: opacity .22s ease, transform .22s ease;
}
#tah-ai-chat-panel.tah-chat-open {
    opacity: 1 !important;
    transform: translateY(0) scale(1) !important;
    pointer-events: all;
}

/* Chat header */
.tah-chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    background: linear-gradient(135deg, var(--tah-primary) 0%, #c8193e 100%);
    color: #fff;
    flex-shrink: 0;
}
.tah-chat-header-left { display: flex; align-items: center; gap: 10px; }
.tah-chat-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}
.tah-chat-header-info { display: flex; flex-direction: column; line-height: 1.2; }
.tah-chat-header-name  { font-weight: 700; font-size: .88rem; }
.tah-chat-header-status { font-size: .68rem; opacity: .85; color: #b2f5c8; }
#tah-ai-chat-close {
    background: none;
    border: none;
    color: rgba(255,255,255,.8);
    font-size: 1rem;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    transition: background var(--tah-transition), color var(--tah-transition);
    line-height: 1;
}
#tah-ai-chat-close:hover { background: rgba(255,255,255,.15); color: #fff; }

/* Chat messages area */
.tah-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: var(--tah-bg-muted);
}
.tah-chat-messages::-webkit-scrollbar { width: 4px; }
.tah-chat-messages::-webkit-scrollbar-track { background: transparent; }
.tah-chat-messages::-webkit-scrollbar-thumb { background: var(--tah-border-hover); border-radius: 4px; }

/* Chat bubbles */
.tah-chat-msg {
    max-width: 82%;
    padding: 8px 11px 6px;
    font-size: .84rem;
    line-height: 1.45;
    word-break: break-word;
    position: relative;
}
.tah-chat-msg-ai {
    background: var(--tah-bg-card);
    color: var(--tah-text);
    border: 1px solid var(--tah-border);
    border-radius: 2px var(--tah-radius-sm) var(--tah-radius-sm) var(--tah-radius-sm);
    align-self: flex-start;
}
.tah-chat-msg-user {
    background: var(--tah-primary);
    color: #fff;
    border-radius: var(--tah-radius-sm) 2px var(--tah-radius-sm) var(--tah-radius-sm);
    align-self: flex-end;
}
.tah-chat-typing {
    align-self: flex-start;
    background: var(--tah-bg-card);
    color: var(--tah-text-muted);
    border: 1px solid var(--tah-border);
    border-radius: 2px var(--tah-radius-sm) var(--tah-radius-sm) var(--tah-radius-sm);
    padding: 8px 13px;
    font-size: .82rem;
    max-width: 82%;
}
.tah-chat-typing-dots { display: inline-flex; gap: 3px; align-items: center; }
.tah-chat-typing-dots span {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--tah-text-muted);
    animation: tah-dot-bounce .9s infinite ease-in-out;
}
.tah-chat-typing-dots span:nth-child(2) { animation-delay: .15s; }
.tah-chat-typing-dots span:nth-child(3) { animation-delay: .3s; }
@keyframes tah-dot-bounce {
    0%, 60%, 100% { transform: translateY(0); }
    30%           { transform: translateY(-4px); }
}

/* Chat input area */
.tah-chat-input-wrap {
    display: flex;
    gap: 8px;
    padding: 10px 11px;
    background: var(--tah-bg-card);
    border-top: 1px solid var(--tah-border);
    flex-shrink: 0;
    align-items: center;
}
#tah-chat-input {
    flex: 1;
    padding: 9px 14px;
    border-radius: var(--tah-radius-full);
    background: var(--tah-bg-input);
    border: 1px solid var(--tah-border);
    color: var(--tah-text) !important;
    font-size: .88rem;
    font-family: var(--tah-font);
    outline: none;
    resize: none;
    transition: border-color var(--tah-transition);
}
#tah-chat-input::placeholder { color: var(--tah-text-subtle); }
#tah-chat-input:focus { border-color: var(--tah-primary); }
#tah-chat-send {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    flex-shrink: 0;
    background: var(--tah-primary);
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--tah-transition), opacity var(--tah-transition);
}
#tah-chat-send:hover { opacity: .9; transform: scale(1.06); }
#tah-chat-send:active { transform: scale(.95); }

/* ── Mobile AI Chat — full screen ───────────────────────────────────────── */
@media (max-width: 767px) {
    #tah-ai-chat-panel {
        left: 0 !important;
        right: 0 !important;
        bottom: auto !important;
        width: 100% !important;
        max-height: none !important;
        border-radius: 0 !important;
        opacity: 1 !important;
        transform: translateY(110%) !important;
        transition: transform .3s cubic-bezier(.4,0,.2,1) !important;
        box-shadow: none !important;
    }
    #tah-ai-chat-panel.tah-chat-open { transform: translateY(0) !important; }
    .tah-chat-header { padding: 14px 16px; padding-top: max(14px, env(safe-area-inset-top)); }
    .tah-chat-messages { padding: 12px; gap: 8px; }
    .tah-chat-msg { font-size: .9rem; padding: 9px 12px 7px; }
    #tah-chat-input { font-size: 16px !important; }
    #tah-chat-send  { width: 44px; height: 44px; }
    .tah-chat-input-wrap { padding: 10px 14px; padding-bottom: max(10px, env(safe-area-inset-bottom)); }

    .tah-metrics-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .tah-register-card { padding: 28px 20px; }
}

/* ── Elementor overrides ────────────────────────────────────────────────── */
.tah-elementor-metrics .tah-metrics-grid { margin-bottom: 0; }
