.truncate-text {
    display: block;
    white-space: nowrap;
    overflow: hidden; 
    text-overflow: ellipsis; 
    max-width: 100%; 
}

.atk-data-url {
    max-width: 80%;
}

.widefat .check-column {
    vertical-align: middle!important;
    padding: 0 0 0 3px!important;
}

.wp-list-table .column-action_type  { width: 25% !important; } 
.wp-list-table .column-user_ip_address { width: 150px!important; }
.wp-list-table .column-action { width: 120px!important; }
.wp-list-table .column-action_url   { width: 132px!important; }
.wp-list-table .column-logs_ai   { width: 148px!important; }

.atk-ipv4-tooltip-wrap {
    position: relative;
    display: inline-block;
}

.atk-ipv4-tooltip {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 8px);
    transform: translateX(-50%);
    z-index: 11;
    visibility: hidden;
    opacity: 0;
    white-space: nowrap;
    pointer-events: none;
    transition: opacity 0.2s ease;
    background-color: #075985;
    color: #fff;
    border-radius: 0.25rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
    font-weight: 400;
}

.atk-ipv4-tooltip-arrow {
    position: absolute;
    left: 50%;
    bottom: -4px;
    width: 8px;
    height: 8px;
    background: inherit;
    transform: translateX(-50%) rotate(45deg);
}

.atk-ipv4-tooltip-wrap:hover .atk-ipv4-tooltip,
.atk-ipv4-tooltip-wrap:focus-within .atk-ipv4-tooltip {
    visibility: visible;
    opacity: 1;
}

.atk-country-tooltip-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.atk-country-tooltip {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 8px);
    transform: translateX(-50%);
    z-index: 11;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    background-color: #075985;
    color: #fff;
    border-radius: 0.25rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
    font-weight: 400;
    text-align: center;
    inline-size: max-content;
    max-inline-size: 16rem;
    white-space: normal;
    word-break: break-word;
}

.atk-country-tooltip-arrow {
    position: absolute;
    left: 50%;
    bottom: -4px;
    width: 8px;
    height: 8px;
    background: inherit;
    transform: translateX(-50%) rotate(45deg);
}

.atk-country-tooltip-wrap:hover .atk-country-tooltip,
.atk-country-tooltip-wrap:focus-within .atk-country-tooltip {
    visibility: visible;
    opacity: 1;
}

/* Activity table: keep event, actor and description readable at a glance. */
#atk-activity-table .wp-list-table { border: 1px solid #dce3eb; border-radius: 8px; border-spacing: 0; }
#atk-activity-table .wp-list-table thead th, #atk-activity-table .wp-list-table tfoot th { background: #f5f8fb; color: #475569; font-weight: 600; }
#atk-activity-table .wp-list-table tbody td { vertical-align: middle; padding: 16px 12px; border-bottom: 1px solid #edf1f5; line-height: 1.55; color: #334155; }
#atk-activity-table .wp-list-table tbody tr:nth-child(odd) { background: #fff; }
#atk-activity-table .wp-list-table tbody tr:nth-child(even) { background: #f8fafc; }
#atk-activity-table .wp-list-table tbody tr:hover { background: #eff6fc; }
#atk-activity-table .column-created_date { color: #64748b; font-size: 12px; }
#atk-activity-table .column-created_date strong { color: #334155; font-size: 13px; }
#atk-activity-table .atk-event-name { display: block; font-weight: 600; color: #334155; }
#atk-activity-table .atk-event-count, .atk-404-view .atk-event-count { display: inline-block; margin-top: 6px; padding: 2px 8px; border-radius: 12px; background: #e8eef6; color: #475569; font-size: 11px; white-space: nowrap; }
#atk-activity-table .atk-content-title { display: block; color: #172b40; font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
#atk-activity-table .atk-content-detail { display: block; margin-top: 4px; color: #64748b; font-size: 12px; }
#atk-activity-table .atk-unknown-user { display: flex; align-items: flex-start; gap: 8px; }
#atk-activity-table .atk-unknown-user > .dashicons { color: #94a3b8; flex-shrink: 0; margin-top: 2px; }
#atk-activity-table .atk-unknown-user strong { display: block; font-size: 12px; color: #475569; font-weight: 500; }
#atk-activity-table .atk-unknown-user small { display: block; color: #64748b; font-size: 11px; margin-top: 3px; }
#atk-activity-table .column-user_id .avatar { border-radius: 50%; width: 30px; height: 30px; }
#atk-activity-table .column-action_url,
#atk-activity-table .column-logs_ai { width: 152px !important; }
#atk-activity-table .column-logs_ai > a,
#atk-activity-table .column-activity_history > a { color: #2271b1 !important; }
#atk-activity-table .column-logs_ai > a:hover,
#atk-activity-table .column-activity_history > a:hover { color: #135e96 !important; }
#atk-activity-table .column-activity_history { width: 152px !important; }
#atk-activity-table .atk-reference-link { gap: 8px; }
#atk-activity-table .atk-reference-link .dashicons { width: 16px; height: 16px; font-size: 16px; flex-shrink: 0; }
#atk-activity-table .column-action_url > a,
.atk-404-view .atk-404-referrer-link,
.atk-404-view .atk_check_log,
#atk-activity-table .atk-analysis-upgrade,
#atk-incidents-dialog .atk-incident-ai-run,
#atk-activity-table .atk_check_log { box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; gap: 6px; width: 128px !important; height: 32px; min-height: 32px; padding: 0 10px; border: 1px solid #2271b1; border-radius: 3px !important; background: #f6f7f7 !important; color: #2271b1 !important; font-size: 13px !important; font-weight: 400 !important; line-height: 1; text-decoration: none; white-space: nowrap; cursor: pointer; }
#atk-activity-table .column-action_url > a:hover,
.atk-404-view .atk-404-referrer-link:hover,
.atk-404-view .atk_check_log:hover,
#atk-activity-table .atk-analysis-upgrade:hover,
#atk-incidents-dialog .atk-incident-ai-run:hover,
#atk-activity-table .atk_check_log:hover { background: #f0f0f1 !important; border-color: #135e96; color: #135e96 !important; }
#atk-activity-table .column-action_url > a:focus-visible,
.atk-404-view .atk-404-referrer-link:focus-visible,
.atk-404-view .atk_check_log:focus-visible,
#atk-activity-table .atk-analysis-upgrade:focus-visible,
#atk-incidents-dialog .atk-incident-ai-run:focus-visible,
#atk-activity-table .atk_check_log:focus-visible { border-color: #2271b1; box-shadow: 0 0 0 1px #2271b1; outline: 2px solid transparent; outline-offset: 0; }
#atk-activity-table .atk_check_log_txt, .atk-404-view .atk_check_log_txt { margin-left: 0; }
@media (max-width: 782px) { #atk-activity-table .wp-list-table tbody td { padding: 8px 12px 8px 35%; } }
#atk-activity-table .tablenav.top .search-box {
    margin: 0;
}
/* Match tab search fields to the filter controls; keep WordPress mobile minimums. */
.toplevel_page_activity-track-ai .search-box input[type="search"] {
    font-size: 14px;
    line-height: 30px;
}
.toplevel_page_activity-track-ai .atk-reset-filters {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.toplevel_page_activity-track-ai .atk-reset-filters .dashicons {
    width: 16px;
    height: 16px;
    font-size: 16px;
    line-height: 1;
}
#wpbody-content .nav-tab-wrapper + #atk-activity-table {
    padding-top: 12px;
}

.atk-404-view { padding-top: 12px; }
.atk-404-view .search-box { margin: 0; }
.atk-404-view .widefat td { vertical-align: top; overflow-wrap: anywhere; }
.atk-404-view .widefat tbody .check-column { vertical-align: top !important; padding: 24px 0 0 3px !important; }
.atk-404-view .widefat code { white-space: normal; overflow-wrap: anywhere; }
.atk-404-view details { margin-top: 8px; }
.atk-404-view summary { cursor: pointer; color: #2271b1; }
.atk-404-view .tablenav { height: auto; min-height: 32px; }
.atk-404-view .tablenav::after { content: ''; display: block; clear: both; }

.atk-404-overview { margin: 8px 0 20px; padding: 20px; border: 1px solid #dcdcde; border-radius: 4px; background: #fff; }
.atk-404-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.atk-404-heading h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-size: 20px; font-weight: 600; color: #1d2327; }
.atk-404-heading h2 .dashicons { color: #2271b1; }
.atk-404-heading p { margin: 0; color: #646970; font-size: 13px; }
.atk-404-recording-status { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border-radius: 20px; font-size: 12px; font-weight: 500; line-height: 1.5; white-space: nowrap; }
.atk-404-recording-status::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.atk-404-recording-recording { background: #e9f5ee; color: #166534; }
.atk-404-recording-paused { background: #fef0ee; color: #b91c1c; }
.atk-404-recording-limit { background: #fff4d6; color: #92400e; }
.atk-404-info-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.atk-404-info-card { padding: 16px; border: 1px solid #e2e4e7; border-radius: 3px; background: #f6f7f7; }
.atk-404-info-card h3 { display: flex; align-items: center; gap: 6px; margin: 0 0 10px; color: #50575e; font-size: 12px; font-weight: 600; }
.atk-404-info-card h3 .dashicons { width: 16px; height: 16px; font-size: 16px; color: #646970; }
.atk-404-info-card > strong { display: block; color: #1d2327; font-size: 14px; font-weight: 600; }
.atk-404-info-card p, .atk-404-coverage p { margin: 8px 0 0; color: #646970; font-size: 13px; line-height: 1.6; }
.atk-404-overview .atk-404-coverage { margin-top: 16px; padding-top: 14px; border-top: 1px solid #e2e4e7; }
.atk-404-coverage summary { font-size: 13px; }
@media (max-width: 782px) {
    .atk-404-info-grid { grid-template-columns: 1fr; }
    .atk-404-heading { flex-wrap: wrap; }
    .atk-404-overview { padding: 16px; }
}
.atk-404-heading-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.atk-404-view .atk-404-recording-button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.atk-404-recording-button svg { display: block; width: 14px; height: 14px; flex-shrink: 0; }
.atk-404-recording-notice { display: flex; align-items: flex-start; gap: 10px; margin: 14px 0; padding: 12px 14px; border: 1px solid #e7d8b5; border-radius: 6px; background: #fffbef; color: #6b4f16; }
.atk-404-recording-notice > .dashicons { margin-top: 1px; flex-shrink: 0; }
.atk-404-recording-notice strong { display: block; font-size: 13px; line-height: 1.5; }
.atk-404-recording-notice p { margin: 3px 0 0; font-size: 13px; line-height: 1.6; }
.atk-404-heading { margin-bottom: 0; }
.atk-404-intro { margin: 0 0 18px; color: #646970; font-size: 13px; }
.atk-404-overview-hidden #atk-404-overview-content { display: none; }
.atk-404-overview-hidden .atk-404-heading h2 { margin-bottom: 0; }
.atk-404-view #atk-404-overview-toggle { min-height: 0; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; color: #2271b1; line-height: 1.5; text-decoration: none; }
.atk-404-view #atk-404-overview-toggle:hover { color: #135e96; text-decoration: underline; }
.atk-404-view #atk-404-overview-toggle:focus-visible { outline: 2px solid #2271b1; outline-offset: 3px; }
.atk-404-overview-hidden .atk-404-overview { padding: 10px 16px; margin-bottom: 12px; }
.atk-404-overview-hidden .atk-404-heading { align-items: center; }
.atk-404-event-column { width: 280px; }
.atk-404-view .atk-event-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.atk-404-view .atk-event-details { min-width: 0; }
.atk-404-view .atk-event-name { display: block; font-weight: 600; color: #334155; }
.atk-404-view .atk-event-links { margin-top: 5px; font-size: 12px; }
.atk-404-view .atk-event-links .atk-404-referrer-link { justify-content: flex-start; width: auto !important; height: auto; min-height: 0; padding: 0; border: 0; background: transparent !important; font-size: 12px !important; line-height: 18px; }
.atk-404-view .atk-event-links .atk-404-referrer-link,
.atk-404-view .atk-event-links .atk-404-referrer-link:hover { text-decoration: none; }
.atk-404-view .atk-event-links .atk-404-referrer-link:hover .atk-404-referrer-label { text-decoration: underline; }
.atk-404-view .atk-event-analysis { flex-shrink: 0; }
.atk-404-view .atk-event-analysis .atk-event-name { margin-bottom: 5px; }
#atk-incidents-dialog .atk-incident-ai-run,
.atk-404-view .atk-event-analysis .atk_check_log { width: auto !important; min-width: 110px; }
@media (max-width: 782px) { .atk-404-view .atk-event-actions { flex-wrap: wrap; gap: 10px; } }
.atk-404-referrer { display: inline-block; position: relative; }
.atk-404-referrer-link .dashicons { width: 16px; height: 16px; font-size: 16px; }
.atk-404-referrer-tooltip { position: absolute; right: 0; bottom: calc(100% + 8px); z-index: 10; width: max-content; max-width: min(360px, 70vw); padding: 8px 12px; border-radius: 3px; background: #075985; color: #fff; font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; visibility: hidden; opacity: 0; pointer-events: none; }
.atk-404-referrer:hover .atk-404-referrer-tooltip,
.atk-404-referrer:focus-within .atk-404-referrer-tooltip { visibility: visible; opacity: 1; }

.atk-404-view .atk-ipv4-tooltip-trigger { text-decoration: underline; text-underline-offset: 2px; color: #2271b1; }
.atk-404-country-flag { height: 14px; width: auto; margin-left: 6px; }
.atk-404-view .atk_check_vpn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 8px; border: 1px solid #dcdcde; border-radius: 3px; background: #fff; cursor: pointer; }
.atk_check_vpn > span { align-items: center; white-space: nowrap; flex-shrink: 0; }


/* Compact event controls reuse the existing history, URL and AI handlers. */
#atk-activity-table .column-action_name { width: 400px; }
#atk-activity-table .atk-activity-empty { padding: 36px 16px; text-align: center; }
#atk-activity-table .atk-activity-empty > .dashicons { width: 28px; height: 28px; font-size: 28px; color: #646970; }
#atk-activity-table .atk-activity-empty h3 { margin: 12px 0 6px; font-size: 16px; }
#atk-activity-table .atk-activity-empty p { margin: 0 0 16px; color: #646970; font-size: 13px; }
#atk-activity-table .atk-event-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
#atk-activity-table .atk-event-details { min-width: 0; }
#atk-activity-table .atk-event-title { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
#atk-activity-table .atk-event-title .atk-event-count { margin-top: 0; }
#atk-activity-table .atk-event-links { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin-top: 5px; font-size: 12px; }
#atk-activity-table .atk-event-history { display: inline-flex; align-items: center; }
#atk-activity-table .atk-event-divider { color: #94a3b8; }
#atk-activity-table .atk-event-links a,
#atk-activity-table .atk-event-links .atk-history-open { display: inline-flex; align-items: center; gap: 4px; width: auto !important; height: auto !important; min-height: 0 !important; padding: 0 !important; border: 0 !important; border-radius: 0; background: transparent !important; box-shadow: none; color: #2271b1 !important; font-size: 12px !important; font-weight: 400; line-height: 1.5; text-decoration: none; white-space: nowrap; cursor: pointer; }
#atk-activity-table .atk-event-links .atk-reference-link .dashicons,
#atk-activity-table .atk-event-links .atk-history-upgrade svg,
#atk-activity-table .atk-event-links .atk-history-open svg { width: 14px; height: 14px; font-size: 14px; }
#atk-activity-table .atk-event-links .atk-reference-link .dashicons::before { display: inline-block; text-decoration: none; }
#atk-activity-table .atk-event-links a:hover,
#atk-activity-table .atk-event-links .atk-history-open:hover { color: #135e96 !important; text-decoration: underline; }
#atk-activity-table .atk-event-links a:focus-visible,
#atk-activity-table .atk-event-links .atk-history-open:focus-visible { outline: 2px solid #2271b1; outline-offset: 3px; }
#atk-activity-table .atk-event-analysis { flex-shrink: 0; }
#atk-activity-table .atk-event-links a,
#atk-activity-table .atk-event-links .atk-history-open { line-height: 18px !important; }
#atk-activity-table .atk-event-analysis .atk-analysis-upgrade,
#atk-activity-table .atk-event-analysis .atk_check_log { width: auto !important; min-width: 110px; }
#atk-activity-table .atk-event-analysis > a { color: #2271b1 !important; font-size: 12px; }
#atk-activity-table .atk-event-analysis > a:hover { color: #135e96 !important; }
@media (max-width: 782px) { #atk-activity-table .atk-event-actions { flex-wrap: wrap; gap: 10px; } }

/* Shared Go Pro panel in Activity Log and Settings. */
.wrap h1.atk-page-title { display: flex; align-items: center; gap: 8px; }
.atk-page-title > svg { display: block; flex-shrink: 0; }
.atk-admin-settings .nav-tab[data-id="activation"],
.nav-tab[href*="page=activity-track-ai&tab=activation"] { background: #059669; border-color: #047857; color: #fff; }
.atk-admin-settings .nav-tab[data-id="activation"]:hover,
.atk-admin-settings .nav-tab[data-id="activation"]:focus,
.nav-tab[href*="page=activity-track-ai&tab=activation"]:hover,
.nav-tab[href*="page=activity-track-ai&tab=activation"]:focus { background: #047857; color: #fff; }
.atk-pro-overview { padding: 36px 32px 24px; background: #f8fafb; color: #1d2327; }
.atk-pro-hero { display: flex; align-items: center; justify-content: space-between; gap: 40px; max-width: 1200px; margin-bottom: 30px; }
.atk-pro-intro { max-width: 730px; }
.atk-pro-badge { display: inline-block; padding: 5px 10px; border-radius: 20px; background: #d1fae5; color: #065f46; font-size: 12px; font-weight: 600; }
.atk-pro-intro h2 { margin: 16px 0 12px; font-size: 34px; font-weight: 700; line-height: 1.2; letter-spacing: -.5px; }
.atk-pro-intro h2 span { color: #059669; }
.atk-pro-intro p { margin: 0; color: #50575e; font-size: 16px; line-height: 1.6; }
.atk-pro-upgrade { display: flex; flex-direction: column; align-items: center; gap: 14px; flex-shrink: 0; }
.atk-pro-primary { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 13px 20px; border: 1px solid #047857; border-radius: 6px; background: #059669; color: #fff !important; font-size: 14px; font-weight: 600; text-decoration: none; box-shadow: 0 3px 8px #065f461a; }
.atk-pro-primary:hover { background: #047857; }
.atk-pro-primary .dashicons { width: 16px; height: 16px; font-size: 16px; }
.atk-pro-details { color: #2271b1; font-size: 13px; text-decoration: none; }
.atk-pro-details:hover { color: #135e96; text-decoration: underline; }
.atk-pro-primary:focus-visible, .atk-pro-details:focus-visible { outline: 2px solid #2271b1; outline-offset: 3px; }
.atk-pro-features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; max-width: 1200px; }
.atk-pro-feature { padding: 22px; border: 1px solid #dcdcde; border-radius: 8px; background: #fff; }
.atk-pro-feature-icon { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; margin-bottom: 12px; border-radius: 8px; background: #ecfdf5; color: #047857; font-size: 22px; }
.atk-pro-feature h3 { margin: 0 0 8px; font-size: 15px; font-weight: 600; line-height: 1.4; }
.atk-pro-feature p { margin: 0; color: #50575e; font-size: 13px; line-height: 1.65; }
.atk-pro-footer { display: flex; align-items: center; gap: 7px; margin: 20px 0 0; color: #646970; font-size: 13px; line-height: 1.5; }
.atk-pro-footer .dashicons { color: #059669; flex-shrink: 0; }
@media (max-width: 1100px) { .atk-pro-hero { align-items: flex-start; flex-direction: column; gap: 22px; } .atk-pro-upgrade { align-items: flex-start; } .atk-pro-features { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .atk-pro-overview { padding: 24px 16px; } .atk-pro-intro h2 { font-size: 28px; } .atk-pro-features { grid-template-columns: 1fr; } }

/* Incident badge is shared by the Activity Track tabs. */
.nav-tab[href*="tab=incidents"] { display: inline-flex; align-items: center; }
.nav-tab .atk-incidents-count { display: inline-block; vertical-align: middle; box-sizing: border-box; min-width: 18px; height: 18px; margin-left: 4px; padding: 0 5px; border-radius: 9px; background: var(--atk-count-background, #d63638); color: var(--atk-count-color, #fff); font-size: 11px; font-weight: 400; line-height: 1.6; text-align: center; }
.js .nav-tab .atk-incidents-count:not(.atk-count-ready) { visibility: hidden; }

/* Visitor badge shared by 404 Errors and Incidents: round icon, centred glyph, label + context. */
.atk-visitor { display: flex; align-items: center; gap: 8px; min-width: 0; }
.atk-visitor-icon { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 28px; width: 28px; height: 28px; border-radius: 50%; background: #f0f0f1; color: #646970; }
.atk-visitor-icon .dashicons { width: 16px; height: 16px; font-size: 16px; line-height: 1; }
.atk-visitor-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.4; }
.atk-visitor-text strong { font-weight: 500; color: #1d2327; }
.atk-visitor-text small { color: #646970; font-size: 12px; }

/* 404 Source: how the request arrived */
.atk-404-view .atk-404-source { font-weight: 500; }
.atk-404-view .atk-404-source-internal { color: #1d2327; }
.atk-404-view .atk-404-source-detail { display: block; color: #646970; font-size: 12px; line-height: 1.4; }
.atk-404-view .atk-event-links { flex-wrap: wrap; }
.atk-404-view .atk-404-incident { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; text-decoration: none; }
.atk-404-view .atk-404-incident:hover { text-decoration: underline; }
.atk-404-view .atk-404-incident .dashicons { width: 14px; height: 14px; font-size: 14px; }
.atk-404-scan-summary { display: flex; align-items: center; gap: 6px; margin: 12px 0 0; color: #50575e; font-size: 13px; }
.atk-404-scan-summary .dashicons { width: 16px; height: 16px; font-size: 16px; color: #646970; }
