.plagscanx-app-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: #fff;
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: inherit;
}

.plagscanx-app-overlay * {
    box-sizing: border-box;
}

.plagscanx-app-container {
    display: flex;
    width: 100%;
    height: 100%;
    max-height: 100vh;
    background: #fff;
    overflow: hidden;
}

/* Sidebar Left */
.plagscanx-sidebar-left {
    width: 270px;
    flex-shrink: 0;
    border-right: 1px solid #f0f0f1;
    background: #fff;
    display: flex;
    flex-direction: column;
    z-index: 10;
}

.plagscanx-brand {
    padding: 10px 20px;
    border-bottom: 1px solid #f9f9f9;
}

.plagscanx-brand h2 {
    margin: 0;
    font-size: 20px;
    color: #333;
    font-weight: 700;
}

.plagscanx-brand img {
    max-width: 150px;
    height: auto;
}

.plagscanx-nav-section {
    padding: 10px 0;
}

.nav-section-title {
    margin: 0 0 8px 24px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: #a0a0a0;
    letter-spacing: 0.5px;
}

.plagscanx-nav {
    list-style: none;
    margin: 0;
    padding: 0;
    padding-inline-start: 0 !important;
}

.plagscanx-nav li {
    padding: 6px 15px;
    display: flex;
    align-items: center;
    cursor: pointer;
    color: #555;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    border-radius: 8px;
    margin: 2px 8px;
}

.plagscanx-nav li.active {
    background: #f0f4f8;
    color: #111;
}

.plagscanx-nav li:hover:not(.active):not(.disabled) {
    background: #f9f9f9;
}

.plagscanx-nav li .dashicons {
    margin-right: 12px;
    font-size: 18px;
    color: #888;
}

.plagscanx-nav li.active .dashicons {
    color: #0066cc;
}

/* Sidebar Footer (Sticky Bottom) */
.plagscanx-sidebar-footer {
    margin-top: auto;
    border-top: 1px solid #f0f0f1;
    background: #fff;
}

/* Upgrade & Consumption */
.plagscanx-upgrade-box {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 6px;
    margin: 15px;
    text-decoration: none;
    color: #111;
    font-weight: 600;
    gap: 10px;
    transition: box-shadow 0.2s;
    box-shadow: none;
}

.plagscanx-upgrade-box:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

.upgrade-icon {
    font-size: 18px;
}

.plagscanx-consumption-card {
    background: #f7f7f7;
    border-radius: 12px;
    padding: 16px;
    margin: 15px;
}

.consumption-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.consumption-card-header .usage-title {
    margin: 0;
    font-size: 15px;
    font-weight: 500;
    color: #1a1a1a;
}

.consumption-card-header .badge {
    background: rgba(77, 97, 252, 0.1);
    color: #4d61fc;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    text-transform: capitalize;
}

.consumption-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 8px;
}

.consumption-header .label {
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

.consumption-header .value {
    font-size: 14px;
    color: #5c6c7b;
    font-weight: 400;
}

.plagscanx-progress-bar {
    height: 6px;
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
}

.plagscanx-progress-fill.premium {
    background: #4d61fc;
}

/* Dynamic Usage Colors */
.plagscanx-progress-fill.usage-low {
    background: #4caf50;
    /* Green: 0-50% */
}

.plagscanx-progress-fill.usage-medium {
    background: #FFBF00;
    /* Amber: 50-80% */
}

.plagscanx-progress-fill.usage-high {
    background: #e74c3c;
    /* Red: 80%+ */
}

/* User Profile Section */
.plagscanx-profile-section {
    position: relative;
    padding: 10px 16px;
    margin-top: auto;
}

.plagscanx-user-card {
    display: flex;
    align-items: center;
    background: #f7f7f7;
    border-radius: 12px;
    padding: 10px 12px;
    cursor: pointer;
    transition: background 0.2s;
    gap: 12px;
}

.plagscanx-user-card:hover {
    background: #efefef;
}

/* PlagScanX Notifications & Errors */

/* Toast Container */
.plagscanx-toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 100000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

/* Toast Item */
.plagscanx-toast {
    background: #fff;
    border-left: 4px solid #333;
    padding: 12px 20px;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: #333;
    min-width: 250px;
    max-width: 350px;
    animation: plagscanx-slide-in 0.3s ease-out forwards;
    pointer-events: auto;
    opacity: 0;
    transform: translateX(20px);
}

.plagscanx-toast.show {
    opacity: 1;
    transform: translateX(0);
}

.plagscanx-toast.hide {
    animation: plagscanx-slide-out 0.3s ease-in forwards;
}

/* Toast Variants */
.plagscanx-toast.success {
    border-left-color: #27ae60;
}

.plagscanx-toast.success .dashicons {
    color: #27ae60;
}

.plagscanx-toast.error {
    border-left-color: #e74c3c;
}

.plagscanx-toast.error .dashicons {
    color: #e74c3c;
}

.plagscanx-toast.info {
    border-left-color: #3498db;
}

.plagscanx-toast.info .dashicons {
    color: #3498db;
}

.plagscanx-toast.warning {
    border-left-color: #f1c40f;
}

.plagscanx-toast.warning .dashicons {
    color: #f1c40f;
}

/* Keyframes */
@keyframes plagscanx-slide-in {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes plagscanx-slide-out {
    from {
        opacity: 1;
        transform: translateX(0);
    }

    to {
        opacity: 0;
        transform: translateX(30px);
    }
}

/* Standardized Inline Error Box */
.plagscanx-error {
    background: #fff5f5;
    border: 1px solid #ffcccc;
    border-left: 4px solid #e74c3c;
    color: #c0392b;
    padding: 10px 15px;
    border-radius: 4px;
    font-size: 13px;
    margin-top: 10px;
    display: none;
    line-height: 1.4;
}


/* Empty States */
.rw-state-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    background: #fdfdfd;
    border: 2px dashed #eee;
    border-radius: 8px;
    min-height: 200px;
    color: #888;
}

.rw-state-box p {
    margin: 10px 0 0;
    font-size: 16px;
    font-weight: 600;
    color: #555;
}

.rw-state-box p.sub {
    font-size: 13px;
    font-weight: 400;
    color: #999;
    margin-top: 5px;
}

.rw-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #4d61fc;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.plagscanx-user-card .user-avatar img {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
}

.plagscanx-user-card .user-meta {
    flex: 1;
    min-width: 0;
}

.plagscanx-user-card .user-name {
    font-size: 14px;
    font-weight: 700;
    color: #111;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.plagscanx-user-card .user-email {
    font-size: 12px;
    color: #888;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.plagscanx-user-card .dashicons-unfold {
    font-size: 16px;
    color: #444;
}

/* Profile Menu Popup */
.plagscanx-profile-menu {
    position: absolute;
    bottom: 100%;
    left: 16px;
    right: 16px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 1px solid #f0f0f0;
    margin-bottom: 12px;
    z-index: 1000;
    padding: 8px;
}

.profile-menu-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.profile-menu-list li a {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    gap: 12px;
    transition: background 0.2s;
}

.profile-menu-list li a:hover {
    background: #f7f7f7;
}

.profile-menu-list li a .dashicons {
    font-size: 18px;
    color: #666;
}

.profile-menu-list .menu-divider {
    height: 1px;
    background: #f0f0f0;
    margin: 4px 0;
}

.profile-menu-list a.logout-item {
    color: #444;
}

/* App Header */
.plagscanx-app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid #f0f0f0;
    background: #fff;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-left .dashicons-columns {
    color: #444;
}

.header-left h2 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #111;
}

.header-info-icon {
    font-size: 16px;
    color: #ccc;
    cursor: pointer;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-tool-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-divider {
    width: 1px;
    height: 24px;
    background: #eee;
}

.header-action-btn {
    padding: 0;
    /* Let secondary class handle it */
    white-space: nowrap;
}

.header-action-btn .dashicons {
    font-size: 18px;
}

/* Toggle Switch */
.plagscanx-toggle-container {
    position: relative;
    display: inline-block;
    width: 34px;
    height: 20px;
    margin: 0 !important;
    /* Reset theme margins */
}

.plagscanx-toggle-container input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #eee;
    transition: .4s;
    border-radius: 20px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.toggle-slider {
    background-color: #4d61fc;
}

input:checked+.toggle-slider:before {
    transform: translateX(14px);
}

.toggle-label {
    font-size: 13px;
    color: #777;
    font-weight: 500;
    margin: 0 !important;
    /* Reset theme margins */
}

.usage-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.plagscanx-usage-widget h4 {
    margin: 0;
    font-size: 13px;
    color: #444;
    font-weight: 600;
}

.tier-label {
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 12px;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.tier-label.free {
    background: #f0f0f0;
    color: #666;
}

.tier-label.basic {
    background: #e3f2fd;
    color: #1976d2;
}

.tier-label.pro {
    background: #e8f5e9;
    color: #2e7d32;
}

.tier-label.business {
    background: #fff3e0;
    color: #f57c00;
}

/* Profile & Actions */
.plagscanx-user-profile-wrapper {
    padding: 16px 24px;
}

.plagscanx-user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.plagscanx-profile-actions {
    border-top: 1px solid #f9f9f9;
    padding-top: 10px;
}

.plagscanx-logout-link {
    display: flex;
    align-items: center;
    color: #d63638;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: opacity 0.2s;
}

.plagscanx-logout-link:hover {
    opacity: 0.8;
}

.plagscanx-logout-link .dashicons {
    margin-right: 8px;
    font-size: 16px;
}

/* Consumption Elements (Merged) */
.usage-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.plagscanx-usage-text {
    display: none;
    /* Replaced by bucket labels */
}

.plagscanx-upgrade-btn {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    background: #111;
    color: #fff;
    padding: 10px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    gap: 8px;
    transition: background 0.2s;
}

.plagscanx-upgrade-btn:hover {
    background: #333;
}

.plagscanx-upgrade-btn .dashicons {
    font-size: 16px;
    color: #fff;
}

.user-avatar img {
    border-radius: 50%;
    width: 36px;
    height: 36px;
    object-fit: cover;
}

.user-info {
    overflow: hidden;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-email {
    font-size: 12px;
    color: #888;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


/* Main Content / Editor */
.plagscanx-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #f4f5f7;
    position: relative;
    overflow: hidden;
    height: 100%;
}

#plagscanx-form {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    /* Remove height: 100% to allow flex logic to work with header */
}

.plagscanx-view {
    display: none;
    flex: 1;
    flex-direction: column;
    min-height: 0;
    height: 100%;
    overflow: hidden;
    /* Default to clipped */
}

#view-settings,
#view-history {
    overflow-y: auto;
}

.plagscanx-view.active {
    display: flex;
}

.plagscanx-editor-container {
    flex: 1;
    /* Takes all available space pushing footer down */
    padding: 30px 30px 0 30px;
    overflow-y: auto;
    /* Enable scroll here for editor */
    display: flex;
    flex-direction: column;
    margin-bottom: 10px;
    /* Gap from toolbar */
}

.plagscanx-input-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    flex: 1;
    /* Takes full height of container */
    min-height: 500px;
    /* User Request: Force height to test */
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 100%;
}

#plagscanx-text,
#plagscanx-ai-text {
    width: 100%;
    height: 100%;
    border: none;
    resize: none;
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    padding: 30px;
    outline: none;
    box-sizing: border-box;
    overflow-y: auto;
    /* Input box IS scrollable */
}

/* Toolbar */
.plagscanx-editor-toolbar {
    background: transparent;
    /* Transparent to blend with grey if needed, or keeping it distinct? User said "This section will be at the bottom and fixed". If main bg is grey, maybe toolbar bg should be grey too? or white? Screenshot shows white-ish bar or just buttons on grey? The user said "input section ... 30px gap from the bottom button sections". This implies buttons might be floating or in a separate bar. Let's keep it clean. */
    /* border-top: 1px solid #eee; */
    padding: 0 30px 30px 30px;
    /* Padding bottom to lift it up */
    display: flex;
    align-items: center;
    justify-content: space-between;
    /* Split Left/Right */
    gap: 16px;
    z-index: 5;
    flex-shrink: 0;
    /* Keep fixed height */
    margin-top: auto;
    /* Ensure it stays at bottom if content short */
}

.hidden-file-input {
    display: none !important;
    visibility: hidden !important;
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
    z-index: -1 !important;
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 15px;
    /* Word counter gap 15px upload button */
}

.counter-item {
    font-size: 13px;
    color: #666;
    font-weight: 500;
}

.plagscanx-btn-upload {
    background: #fff;
    border: 1px solid #ddd;
    color: #555;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
    /* Ensure no text wrap */
    white-space: nowrap;
}

.plagscanx-btn-upload:hover {
    border-color: #bbb;
    background: #fff;
}

.plagscanx-btn-primary {
    background: #3c6e96;
    /* Matches screenshot blue-ish */
    color: #fff;
    border: none;
    padding: 10px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(60, 110, 150, 0.2);
    transition: background 0.2s;
}

.plagscanx-btn-primary:hover {
    background: #325a7a;
}

.plagscanx-btn-primary:disabled {
    background: #aab8c2;
    cursor: not-allowed;
    box-shadow: none;
    opacity: 0.7;
}

.plagscanx-btn-secondary {
    background: #fff;
    border: 1px solid #ddd;
    color: #555;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}

.plagscanx-btn-secondary:hover {
    border-color: #bbb;
    background: #f9f9f9;
}

/* Specific overrides for buttons in sidebars or full-width context */
#btn-rescan.plagscanx-btn-secondary,
#btn-ai-rescan.plagscanx-btn-secondary {
    width: 100%;
    margin-top: 20px;
    padding: 10px 24px;
    font-size: 14px;
}

.history-container {
    padding: 40px;
}


/* Right Sidebar Results */
.plagscanx-sidebar-right {
    width: 340px;
    flex-shrink: 0;
    border-left: 1px solid #f0f0f1;
    background: #fff;
    padding: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

#plagscanx-results,
#ai-results {
    padding: 24px;
}

.results-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #ddd;
    margin-top: 15vh;
    padding: 20px;
}

.results-empty-state p {
    margin: 10px 0 0;
    font-size: 16px;
    font-weight: 600;
    color: #ddd;
}

.results-empty-state p.sub {
    font-size: 13px;
    font-weight: 400;
    color: #999;
    margin-top: 5px;
}

/* Result Typography Fixes */
.score-header {
    text-align: center;
    margin-bottom: 30px;
}

.big-score {
    font-size: 64px;
    font-weight: 800;
    line-height: 1;
    color: #333;
    margin-bottom: 8px;
}

.score-label-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.score-label {
    font-size: 13px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.risk-badge {
    font-size: 12px;
    font-weight: 600;
    color: #555;
    background: #f0f0f0;
    padding: 2px 8px;
    border-radius: 12px;
}

.plagscanx-progress-bars {
    margin-bottom: 30px;
}

.bar-row {
    margin-bottom: 12px;
}

.bar-row .label {
    font-size: 13px;
    color: #555;
    display: inline-flex;
    align-items: center;
}

.bar-row .val {
    float: right;
    font-size: 13px;
    font-weight: 600;
    color: #333;
}

.sources-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #f0f0f1;
    padding-bottom: 12px;
    margin-bottom: 16px;
}

.sources-header h4 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #333;
}

.sources-header .badge {
    font-size: 14px;
    color: #777;
    font-weight: 400;
}

.result-item {
    background: #fff;
    border-bottom: 1px solid #f0f0f1;
    padding: 16px 0;
    margin-bottom: 0;
    box-shadow: none;
}

.result-item:last-child {
    border-bottom: none;
}

.result-item h4 {
    margin: 0 0 6px;
    font-size: 15px;
    line-height: 1.4;
    font-weight: 600;
}

.result-item h4 a {
    color: #333;
    text-decoration: none;
    transition: color 0.1s;
}

.result-item h4 a:hover {
    color: #0066cc;
}

.result-item .meta {
    font-size: 12px;
    color: #999;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.result-item .match-badge {
    color: #d63638;
    font-weight: 500;
}

.result-item .snippet {
    font-size: 13px;
    line-height: 1.5;
    color: #666;
    font-style: normal;
}



/* Smart Loading UI */
.plagscanx-step-list {
    list-style: none;
    padding: 0;
    margin: 0 0 30px;
}

.step-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    margin-bottom: 10px;
    background: #fff;
    /* or transparent */
    border-radius: 8px;
    transition: all 0.3s;
    font-size: 14px;
    color: #555;
    font-weight: 500;
}

.step-item.active {
    background: #f8fcfd;
    color: #333;
}

.step-item.pending {
    opacity: 0.5;
}

.step-icon {
    width: 24px;
    height: 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    background: #eee;
    color: #888;
    font-size: 12px;
    margin-right: 12px;
    flex-shrink: 0;
}

.step-item.active .step-icon {
    background: transparent;
    border: 2px solid #0066cc;
    /* Spinner or circle? */
    color: #0066cc;
    /* Simulate spinner with border */
    border-top-color: transparent;
    animation: step-spin 1s linear infinite;
}

.step-item.done .step-icon {
    background: #e6f9ed;
    color: #27ae60;
    animation: none;
    border: none;
}

.step-item.done .step-icon .dashicons {
    font-size: 16px;
}

@keyframes step-spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.plagscanx-scan-progress-bar {
    height: 6px;
    background: #eee;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 10px;
}

.plagscanx-scan-progress-bar .progress-fill {
    height: 100%;
    background: #0066cc;
    width: 0%;
    transition: width 0.3s linear;
}

.progress-info {
    text-align: center;
    font-size: 12px;
    color: #999;
}

/* History Cards */
.history-container h3 {
    margin-bottom: 24px;
    font-size: 20px;
    color: #333;
}

.plagscanx-history-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.history-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}

.history-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.06);
    border-color: #d0d0d0;
}

.history-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.history-score-badge {
    font-size: 12px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 6px;
    text-transform: uppercase;
}

.history-date {
    font-size: 11px;
    color: #999;
    font-weight: 500;
}

.history-snippet {
    font-size: 13px;
    line-height: 1.5;
    color: #666;
    margin-bottom: 16px;
    flex: 1;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
}

.history-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #f0f0f0;
    padding-top: 16px;
    margin-top: auto;
}

.btn-see-report {
    background: transparent;
    color: #0066cc;
    border: 1px solid #0066cc;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-see-report:hover {
    background: #0066cc;
    color: #fff;
}

.btn-delete-card {
    background: transparent;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 4px;
    font-size: 16px;
    transition: color 0.2s;
}

.btn-delete-card:hover {
    color: #d63638;
}

/* Settings View Styles */
.settings-container {
    padding: 40px;
    max-width: 900px;
}

.settings-header-box {
    margin-bottom: 40px;
}

.settings-subtitle {
    color: #667085;
    font-size: 14px;
    margin: 4px 0 0 0;
}

.history-container,
.settings-container {
    padding-bottom: 80px !important;
}

.settings-section {
    margin-bottom: 48px;
}

.settings-section-label {
    font-size: 12px;
    font-weight: 700;
    color: #98a2b3;
    letter-spacing: 1px;
    margin-bottom: 24px;
    text-transform: uppercase;
}

.settings-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 0;
    border-bottom: 1px solid #f2f4f7;
}

.settings-row:last-child {
    border-bottom: none;
}

.row-info {
    flex: 1;
}

.row-title {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 4px;
}

.row-desc {
    font-size: 13px;
    color: #667085;
}

.row-action {
    margin-left: 40px;
}

.static-val {
    font-size: 15px;
    font-weight: 500;
    color: #344054;
}

.row-link {
    margin-top: 12px;
}

.delete-link {
    color: #d92d20;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s;
}

.delete-link:hover {
    color: #b42318;
    text-decoration: underline;
}

.info-link {
    color: #3c6e96;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s;
}

.info-link:hover {
    color: #325a7a;
    text-decoration: underline;
}

/* Toggle Overrides for large variant */
.plagscanx-toggle-container.large {
    width: 44px;
    height: 24px;
}

.plagscanx-toggle-container.large .toggle-slider:before {
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
}

.plagscanx-toggle-container.large input:checked+.toggle-slider:before {
    transform: translateX(20px);
}

@media (max-width: 900px) {
    .plagscanx-app-overlay {
        position: relative;
        height: auto;
    }

    .plagscanx-app-container {
        flex-direction: column;
        overflow: visible;
    }

    .plagscanx-sidebar-left,
    .plagscanx-sidebar-right {
        width: 100%;
        height: auto;
        border: none;
        overflow: visible;
    }

    .plagscanx-main {
        overflow: visible;
    }

    .plagscanx-input-card {
        height: 400px;
    }

    .plagscanx-sidebar-footer,
    .plagscanx-editor-toolbar {
        position: static;
    }
}

/* Login Modal */
.plagscanx-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
}

.plagscanx-modal-content {
    background: #fff;
    width: 90%;
    max-width: 440px;
    padding: 40px 30px;
    border-radius: 12px;
    position: relative;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    text-align: center;
    animation: modalSlideUp 0.3s ease-out;
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.plagscanx-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.plagscanx-modal-close:hover {
    color: #333;
}

.modal-icon-wrapper {
    width: 48px;
    height: 48px;
    background: #eef2ff;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto 20px;
}

.modal-icon-wrapper .dashicons {
    color: #4f46e5;
    font-size: 24px;
}

.modal-site-icon {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.plagscanx-modal-header h2 {
    font-size: 22px;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 10px;
}

.plagscanx-modal-header p {
    font-size: 15px;
    color: #6b7280;
    line-height: 1.5;
    margin: 0 0 30px;
}

.plagscanx-modal-body {
    margin-bottom: 25px;
}

/* Force Google Button Center */
.g_id_signin iframe {
    margin: 0 auto !important;
}

.g_id_signin>div {
    margin: 0 auto;
}

.plagscanx-modal-footer p {
    font-size: 11px;
    color: #9ca3af;
    line-height: 1.5;
    margin: 0;
}

/* Premium Login Card (Inline) */
.plagscanx-login-page-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 70vh;
    padding: 60px 20px;
    background: #f9fbfd;
    border-radius: 16px;
    margin: 20px 0;
}

.plagscanx-login-card {
    background: #fff;
    width: 100%;
    max-width: 480px;
    padding: 50px 40px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.04), 0 1px 3px rgba(0, 0, 0, 0.08);
    text-align: center;
}

.plagscanx-login-card .plagscanx-modal-header {
    margin-bottom: 35px;
}

.plagscanx-login-card .modal-icon-wrapper {
    width: 80px;
    height: 80px;
    background: #f0f7ff;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto 24px;
}

.plagscanx-login-card .modal-icon-wrapper .dashicons {
    font-size: 36px;
    color: #0066cc;
}

.plagscanx-login-card h2 {
    font-size: 28px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 12px 0;
}

.plagscanx-login-card p {
    font-size: 16px;
    color: #666;
    line-height: 1.6;
    margin: 0;
}

.plagscanx-login-card .plagscanx-modal-body {
    background: none;
    padding: 0;
    margin: 35px 0;
}

.plagscanx-login-card .g_id_signin {
    display: flex;
    justify-content: center;
}

.plagscanx-login-card .plagscanx-modal-footer {
    border-top: 1px solid #f0f0f1;
    padding-top: 25px;
    margin-top: 25px;
}

.plagscanx-login-card .plagscanx-modal-footer p {
    font-size: 13px;
    color: #999;
}

/* ============================
   AI Detector Results
   ============================ */

/* Highlight overlay - mirrors textarea appearance */
.ai-highlight-overlay {
    width: 100%;
    min-height: 300px;
    max-height: calc(100vh - 280px);
    overflow-y: auto;
    padding: 20px;
    font-size: 15px;
    line-height: 1.8;
    color: #333;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: inherit;
    cursor: text;
}

/* Individual highlight spans */
.ai-highlight {
    padding: 2px 0;
    border-radius: 3px;
    transition: background 0.2s;
    cursor: default;
}

.ai-highlight:hover {
    filter: brightness(0.92);
}

/* Legend in sidebar */
.ai-highlight-legend {
    padding: 0 20px 15px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    flex-shrink: 0;
}

.legend-label {
    font-size: 13px;
    color: #555;
}

.legend-label small {
    color: #999;
    font-size: 11px;
}

/* Summary stats */
.ai-summary-stats {
    padding: 15px 20px;
    border-top: 1px solid #f0f0f1;
}

.summary-total {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin: 0 0 10px 0;
}

.summary-line {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #555;
    margin: 0 0 6px 0;
}

.summary-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ========= Text Rewriter ========= */

.rewriter-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    min-height: calc(100vh - 120px);
}

.rewriter-panel {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.rewriter-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f0;
}

.rewriter-panel-header h3 {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.rewriter-textarea {
    flex: 1;
    width: 100%;
    border: none;
    outline: none;
    padding: 20px;
    font-size: 15px;
    line-height: 1.8;
    resize: none;
    font-family: inherit;
    color: #333;
    min-height: 300px;
}

.rewriter-textarea::placeholder {
    color: #bbb;
}

.rewriter-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    border-top: 1px solid #f0f0f0;
    background: #fafafa;
    gap: 12px;
}

.rewriter-toolbar-left {
    font-size: 13px;
    color: #888;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.header-usage-badge {
    color: #005596;
    background: #e6f0f7;
    padding: 6px 16px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    border: 1px solid #c8d9e6;
}

.rw-char-info {
    font-size: 12px;
    color: #999;
}

.rw-word-count {
    font-weight: 600;
    color: #666;
}

.rewriter-toolbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.rw-tone-select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 13px;
    background: #fff;
    color: #333;
    cursor: pointer;
    outline: none;
}

.rw-tone-select:focus {
    border-color: #667eea;
}

/* Output States */
.rw-state-box {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    color: #999;
    min-height: 300px;
}

.rw-state-box p {
    margin: 8px 0 0;
    font-size: 15px;
    color: #888;
}

.rw-state-box p.sub {
    font-size: 13px;
    color: #bbb;
}

.rw-output-text {
    flex: 1;
    padding: 20px;
    font-size: 15px;
    line-height: 1.8;
    color: #333;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-y: auto;
    max-height: calc(100vh - 200px);
    font-family: inherit;
}

/* Spinner */
.rw-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e8e8e8;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: rwSpin 0.8s linear infinite;
}

@keyframes rwSpin {
    to {
        transform: rotate(360deg);
    }
}

/* Copy Button */
.rw-copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    font-size: 12px;
    font-weight: 500;
    color: #555;
    cursor: pointer;
    transition: all 0.15s;
}

.rw-copy-btn:hover {
    background: #f5f5f5;
    border-color: #ccc;
}

.rw-copy-btn .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

/* Daily Usage Badge */
.rw-daily-usage {
    display: inline-flex;
    align-items: center;
    font-size: 13px;
    color: #666;
    font-weight: 500;
}

/* Responsive */
@media (max-width: 900px) {
    .rewriter-grid {
        grid-template-columns: 1fr;
    }
}

/* ========= LP Tool Widget ========= */
.plagscanx-lp-widget {
    font-family: inherit;
    max-width: 720px;
    margin: 0 auto;
}

.plagscanx-lp-widget *,
.plagscanx-lp-widget *::before,
.plagscanx-lp-widget *::after {
    box-sizing: border-box;
}

.lp-widget-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.lp-widget-card:hover {
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.1);
}

.lp-textarea-wrap {
    padding: 20px 20px 0;
}

.plagscanx-lp-widget textarea {
    width: 100%;
    border: none;
    outline: none;
    resize: none;
    font-size: 15px;
    line-height: 1.7;
    color: #333;
    font-family: inherit;
    background: transparent;
    min-height: 180px;
}

.plagscanx-lp-widget textarea::placeholder {
    color: #aab0b8;
}

.lp-widget-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-top: 1px solid #f0f1f3;
    background: #fafbfc;
    gap: 12px;
    flex-wrap: wrap;
}

.lp-toolbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.lp-word-indicator {
    font-size: 13px;
    color: #888;
    display: flex;
    align-items: center;
    gap: 4px;
}

.lp-word-count {
    font-weight: 600;
    color: #555;
}

.lp-min-label {
    color: #bbb;
    font-size: 12px;
}

.lp-toolbar-divider {
    width: 1px;
    height: 20px;
    background: #e0e0e0;
}

.plagscanx-lp-upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    background: none;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 13px;
    color: #555;
    cursor: pointer;
    transition: all 0.2s ease;
}

.plagscanx-lp-upload-btn:hover {
    background: #f0f1f3;
    border-color: #ccc;
}

.plagscanx-lp-upload-btn .dashicons {
    font-size: 15px;
    width: 15px;
    height: 15px;
    line-height: 15px;
}

.lp-toolbar-right {
    margin-left: auto;
}

.plagscanx-lp-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
    white-space: nowrap;
}

.plagscanx-lp-cta:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(79, 70, 229, 0.4);
}

.plagscanx-lp-cta:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.plagscanx-lp-cta .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    line-height: 16px;
}

/* LP Widget Responsive */
@media (max-width: 600px) {
    .plagscanx-lp-widget {
        max-width: 100%;
    }

    .lp-widget-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .lp-toolbar-right {
        margin-left: 0;
    }

    .plagscanx-lp-cta {
        width: 100%;
        justify-content: center;
        padding: 12px;
    }
}

/* Rewriter / Humanizer / Grammar UI */
.rewriter-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.rewriter-panel {
    flex: 1;
    min-width: 300px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.rewriter-panel-header {
    background: #f9fafb;
    padding: 12px 16px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.rewriter-panel-header h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #444;
    padding: 5px 0;
}

.rewriter-textarea {
    flex: 1;
    border: none;
    padding: 16px;
    font-size: 15px;
    line-height: 1.6;
    color: #333;
    resize: none;
    outline: none;
    min-height: 300px;
    font-family: inherit;
    width: 100%;
    box-sizing: border-box;
    background: #fff;
}

.rw-output-text {
    flex: 1;
    padding: 16px;
    font-size: 15px;
    line-height: 1.6;
    color: #333;
    min-height: 300px;
    white-space: pre-wrap;
    background: #fff;
    overflow-y: auto;
}

/* Toolbar Alignment Fix */
.rewriter-toolbar {
    padding: 12px 16px;
    border-top: 1px solid #e0e0e0;
    background: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.rewriter-toolbar-left {
    font-size: 13px;
    color: #666;
    font-weight: 500;
}

.rewriter-toolbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.rw-tone-select {
    padding: 0 12px;
    border: 1px solid #d0d5dd;
    border-radius: 6px;
    font-size: 14px;
    color: #344054;
    background-color: #fff;
    cursor: pointer;
    outline: none;
    height: 36px;
    line-height: 34px;
    /* Vertically center text */
}

.plagscanx-btn-primary {
    background: #4d61fc;
    color: #fff;
    border: none;
    padding: 0 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 36px;
    line-height: 1;
}

.plagscanx-btn-primary:hover:not(:disabled) {
    background: #3b4edb;
}

.plagscanx-btn-primary:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    opacity: 0.7;
}

.plagscanx-btn-secondary {
    background: #fff;
    color: #344054;
    border: 1px solid #d0d5dd;
    padding: 0 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    line-height: 1;
}

.plagscanx-btn-secondary:hover:not(:disabled) {
    background: #f9fafb;
    border-color: #b0b8c6;
}

.plagscanx-lp-btn-secondary {
    background: transparent;
    border: 1px solid #ddd;
    color: #666;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-right: 10px;
}

.plagscanx-lp-btn-secondary:hover {
    background: #f5f5f5;
    border-color: #ccc;
    color: #333;
}

.rw-copy-btn {
    background: transparent;
    border: 1px solid #d0d5dd;
    color: #344054;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.rw-copy-btn:hover {
    background: #f9fafb;
    border-color: #b0b8c6;
}

.rw-spinner {
    margin: 0 auto 15px auto;
}

/* Consumption card sections */
.consumption-section {
    margin-bottom: 12px;
}

.plagscanx-progress-fill.ai {
    background: #4caf50;
    /* Green bar from mockup */
}

.tier-display {
    margin-top: 15px;
    padding-top: 12px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    text-align: center;
}

.tier-display .badge {
    background: #f0f2ff;
    color: #4d61fc;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Usage Details Grid */
.usage-details-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-top: 15px;
}

.usage-detail-card {
    background: #fff;
    border: 1px solid #f0f0f1;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.usage-detail-card:hover {
    border-color: #d0d5dd;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.usage-detail-card .tool-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.usage-detail-card .tool-name {
    font-weight: 600;
    font-size: 14px;
    color: #111;
}

.usage-detail-card .reset-date {
    font-size: 11px;
    color: #666;
    letter-spacing: 0.2px;
}

.usage-detail-card .usage-stats {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.usage-detail-card .stats-row {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.usage-detail-card .used-val {
    font-weight: 700;
    font-size: 18px;
    color: #111;
}

.usage-detail-card .limit-val {
    font-size: 12px;
    color: #a0a0a0;
}

.usage-bar-mini {
    height: 6px;
    background: #f0f0f1;
    border-radius: 3px;
    overflow: hidden;
}

.usage-bar-mini .fill {
    height: 100%;
    transition: width 0.3s ease;
}

.usage-bar-mini .fill.usage-low {
    background: #4d61fc;
}

.usage-bar-mini .fill.usage-medium {
    background: #f59e0b;
}

.usage-bar-mini .fill.usage-high {
    background: #ef4444;
}

@media (max-width: 768px) {
    .usage-details-grid {
        grid-template-columns: 1fr;
    }
}

/* Header Profile Menu */
.plagscanx-header-profile {
    position: relative;
    display: inline-block;
}

.plagscanx-profile-trigger {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.profile-avatar-img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #e0e0e0;
    transition: transform 0.2s;
}

.plagscanx-profile-trigger:hover .profile-avatar-img {
    transform: scale(1.05);
}

.plagscanx-profile-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 280px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    z-index: 100001;
    overflow: hidden;
    animation: plagscanx-fade-in-up 0.2s ease-out;
}

@keyframes plagscanx-fade-in-up {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.plagscanx-profile-dropdown .profile-header {
    padding: 20px;
    border-bottom: 1px solid #f0f0f1;
}

.plagscanx-profile-dropdown .profile-name {
    font-weight: 700;
    font-size: 16px;
    color: #111;
    margin-bottom: 4px;
}

.plagscanx-profile-dropdown .profile-email {
    font-size: 13px;
    color: #666;
}

.plagscanx-profile-dropdown .profile-usage-section {
    padding: 20px;
    background: #fcfcfd;
    border-bottom: 1px solid #f0f0f1;
}

.usage-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.usage-title {
    font-size: 14px;
    font-weight: 600;
    color: #111;
    display: flex;
    align-items: center;
    gap: 8px;
}

.usage-title .dashicons {
    font-size: 18px;
    color: #4d61fc;
}

.tier-badge {
    font-size: 11px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    background: #f0f0f1;
    padding: 2px 8px;
    border-radius: 4px;
}

.usage-numbers {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 14px;
}

.numbers-val {
    font-weight: 500;
    color: #111;
}

.percent-val {
    color: #666;
}

.usage-bar-outer {
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 20px;
}

.usage-bar-fill {
    height: 100%;
    transition: width 0.3s ease;
}

.usage-bar-fill.usage-low {
    background: #4caf50;
}

.usage-bar-fill.usage-medium {
    background: #ff9800;
}

.usage-bar-fill.usage-high {
    background: #f44336;
}

.plagscanx-btn-upgrade-header {
    display: block;
    width: 100%;
    text-align: center;
    padding: 10px;
    background: #1e293b;
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.2s;
}

.plagscanx-btn-upgrade-header:hover {
    background: #334155;
}

.profile-menu-list {
    list-style: none;
    padding: 10px 0;
    margin: 0;
}

.profile-menu-list li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    color: #444;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.1s;
}

.profile-menu-list li a:hover {
    background: #f8fafc;
    color: #111;
}

.profile-menu-list li a .dashicons {
    font-size: 18px;
    color: #64748b;
}

.profile-menu-list .menu-divider {
    height: 1px;
    background: #f0f0f1;
    margin: 5px 0;
}

.profile-menu-list .logout-link {
    color: #ef4444;
}

.profile-menu-list .logout-link .dashicons {
    color: #ef4444;
}

/* Guest sign in button */
.plagscanx-btn-signin {
    background: #4d61fc;
    color: #fff;
    border: none;
    padding: 10px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.plagscanx-btn-signin:hover {
    background: #3a4dfa;
}