/* PlagScanX Design System v1: Luma, zinc, blue, Lucide, small radius. */
:root {
    --psx-background: #ffffff;
    --psx-card: #ffffff;
    --psx-card-foreground: var(--psx-text, #18181b);
    --psx-popover: #ffffff;
    --psx-popover-foreground: var(--psx-text, #18181b);
    --psx-primary-foreground: #ffffff;
    --psx-secondary: #f4f4f5;
    --psx-secondary-foreground: #27272a;
    --psx-muted: #f4f4f5;
    --psx-muted-foreground: var(--psx-text-muted, #71717a);
    --psx-accent: #f4f4f5;
    --psx-accent-foreground: #27272a;
    --psx-input: #e4e4e7;
    --psx-border: #e4e4e7;
    --psx-border-strong: #d4d4d8;
    --psx-ring: #a1a1aa;
    --psx-disabled-bg: #e4e4e7;
    --psx-disabled-border: #d4d4d8;
    --psx-disabled-foreground: #52525b;
    --psx-sidebar: var(--psx-sidebar-bg, #fafafa);
    --psx-canvas: var(--psx-main-bg, #f4f4f5);
    --psx-radius-sm: 4.32px;
    --psx-radius-md: 5.76px;
    --psx-radius-lg: 7.2px;
    --psx-radius-xl: 10.08px;
    --psx-radius-2xl: 12.96px;
    --psx-radius-3xl: 15.84px;
    --psx-radius-control: 18.72px;
    --psx-radius-card: 18.72px;
    --psx-radius-dialog: 18.72px;
    --psx-radius-full: 9999px;
    --psx-shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --psx-shadow-soft: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1), 0 0 0 1px rgb(24 24 27 / 0.05);
    --psx-shadow-hover: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1), 0 0 0 1px rgb(24 24 27 / 0.05);
    --psx-shadow-popover: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1), 0 0 0 1px rgb(24 24 27 / 0.05);
    --psx-shadow-dialog: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1), 0 0 0 1px rgb(24 24 27 / 0.05);
    --psx-risk-safe: #16a34a;
    --psx-risk-low: #ca8a04;
    --psx-risk-medium: #ea580c;
    --psx-risk-high: #dc2626;
}

.plagscanx-app-overlay,
.plagscanx-app-overlay button,
.plagscanx-app-overlay input,
.plagscanx-app-overlay textarea,
.plagscanx-app-overlay select,
.plagscanx-lp-widget,
.plagscanx-lp-widget button,
.plagscanx-lp-widget textarea {
    font-family: inherit;
}

.plagscanx-app-overlay *,
.plagscanx-lp-widget * {
    letter-spacing: 0;
}

.plagscanx-app-overlay {
    background: var(--psx-background);
    color: var(--psx-card-foreground);
    font-size: 14px;
    line-height: 1.5;
}

.plagscanx-app-container {
    gap: 0;
    padding: 0;
    background: var(--psx-background);
}

.plagscanx-sidebar-left,
.plagscanx-sidebar-right {
    height: 100%;
    border-radius: 0;
    background: var(--psx-sidebar);
    box-shadow: none;
}

.plagscanx-sidebar-left {
    width: 270px;
    min-height: 0;
    border: 0;
    border-right: 1px solid var(--psx-border);
    overflow: hidden auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--psx-border-strong) transparent;
}

.plagscanx-main {
    height: 100%;
    border: 0;
    border-radius: 0;
    background: var(--psx-background);
    box-shadow: none;
}

.plagscanx-sidebar-right {
    width: 340px;
    border: 0;
    border-left: 1px solid var(--psx-border);
    overflow: hidden auto;
}

.plagscanx-brand {
    height: 48px;
    min-height: 48px;
    flex: 0 0 48px;
    margin: 0;
    padding: 8px 16px;
    border-bottom: 0;
}

.plagscanx-brand h2 {
    color: var(--psx-card-foreground);
    font-size: 17px;
    font-weight: 600;
}

.plagscanx-brand .custom-logo-link {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
}

.psx-app-logo-link {
    color: inherit;
    text-decoration: none;
}

.plagscanx-brand img {
    width: var(--psx-brand-logo-width, 150px);
    max-width: 100%;
    max-height: 32px;
    object-fit: contain;
    object-position: left center;
}

.plagscanx-nav-section {
    padding: 8px;
    line-height: 1.4;
}

.plagscanx-nav-divider {
    width: auto;
    height: 0;
    flex: 0 0 auto;
    margin: 12px 8px;
    border: 0;
    border-top: 1px solid color-mix(in srgb, var(--psx-border) 70%, transparent);
    background: transparent;
}

.plagscanx-nav li {
    min-height: 36px;
    margin: 1px 0;
    padding: 8px 12px;
    gap: 8px;
    border: 0;
    border-radius: var(--psx-radius-xl);
    color: #000000;
    font-size: 14px;
    font-weight: 400;
    line-height: 20px;
    transition: background-color 150ms ease, color 150ms ease;
}

.plagscanx-nav li:hover:not(.active):not(.disabled) {
    background: var(--psx-muted);
}

.plagscanx-nav li.active {
    background: var(--psx-muted);
    color: var(--psx-accent-foreground);
    font-weight: 500;
}

.plagscanx-nav li .psx-icon {
    width: 16px;
    height: 16px;
    margin: 0;
    color: #27272a;
    stroke-width: 2;
}

.plagscanx-nav li.active .psx-icon {
    color: currentColor;
}

.plagscanx-nav li .psx-crown-icon {
    width: 14px;
    height: 14px;
    margin-left: auto !important;
    color: #eab308;
    fill: rgba(234, 179, 8, 0.2);
}

.plagscanx-sidebar-footer {
    border-top: 0;
    background: var(--psx-sidebar);
}

.plagscanx-usage-widget {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: 8px;
    padding: 16px;
    border-radius: var(--psx-radius-card);
    background: var(--psx-muted);
}

.plagscanx-upgrade-box {
    order: 2;
    min-height: 32px;
    margin: 0;
    padding: 0 12px;
    border: 1px solid var(--psx-border);
    border-radius: var(--psx-radius-control);
    background: var(--psx-card);
    box-shadow: none;
    color: var(--psx-card-foreground);
    font-size: 14px;
    font-weight: 500;
    transition: background-color 120ms ease, box-shadow 120ms ease;
}

.plagscanx-upgrade-box:hover {
    border-color: var(--psx-border-strong);
    background: color-mix(in srgb, var(--psx-card) 58%, var(--psx-muted));
    box-shadow: none;
    color: var(--psx-card-foreground);
}

.upgrade-icon .psx-icon {
    width: 15px;
    height: 15px;
}

.plagscanx-upgrade-box .upgrade-icon,
.plagscanx-upgrade-box .upgrade-icon .psx-icon {
    color: currentColor;
}

.simple-usage-wrapper {
    order: 1;
    margin: 0 !important;
    padding: 0;
    border: 0;
    background: transparent;
    gap: 12px;
}

.simple-usage-header {
    margin-bottom: 0;
}

.simple-usage-header .simple-usage-title {
    color: var(--psx-card-foreground);
    font-size: 13px;
    font-weight: 500;
}

.simple-usage-header .badge,
.consumption-card-header .badge,
.tier-label {
    border: 1px solid color-mix(in srgb, var(--psx-primary) 14%, transparent);
    border-radius: var(--psx-radius-3xl);
    background: color-mix(in srgb, var(--psx-primary) 9%, var(--psx-card));
    color: var(--psx-primary);
    font-size: 12px;
    font-weight: 500;
}

.simple-pro-usage-details-card {
    padding: 0;
    border: 0;
    background: transparent;
    gap: 4px;
}

.simple-pro-usage-details-card .tool-info,
.simple-pro-usage-details-card .stats-row,
.simple-pro-usage-details-card .used-val,
.simple-pro-usage-details-card .limit-val {
    font-size: 12px;
    line-height: 16px;
}

.simple-pro-usage-details-card .stats-row {
    justify-content: flex-start;
}

.usage-bar-mini,
.plagscanx-progress-bar,
.usage-bar-outer,
.library-progress-track,
.quota-progress-track,
.bar-track,
.plagscanx-scan-progress-bar {
    background: var(--psx-muted);
}

.plagscanx-usage-widget .usage-bar-mini {
    background: var(--psx-border);
}

.usage-bar-mini,
.usage-bar-outer,
.library-progress-track,
.plagscanx-progress-bar {
    height: 6px;
    border-radius: var(--psx-radius-full);
}

.plagscanx-profile-section {
    padding: 8px;
    border-top: 1px solid var(--psx-border);
}

.plagscanx-user-card {
    margin: 0;
    min-height: 52px;
    padding: 8px 10px;
    border: 0;
    border-radius: var(--psx-radius-xl);
    background: var(--psx-muted);
}

.plagscanx-user-card:hover {
    background: color-mix(in srgb, var(--psx-muted) 86%, var(--psx-card-foreground));
}

.plagscanx-user-card .user-avatar img,
.profile-avatar-img-small {
    border: 1px solid var(--psx-border);
    box-shadow: var(--psx-shadow-xs);
}

.plagscanx-app-header {
    height: 48px;
    min-height: 48px;
    flex: 0 0 48px;
    padding: 0 24px;
    border-bottom: 1px solid var(--psx-border);
    border-radius: 0;
    background: var(--psx-background);
}

.header-left {
    gap: 8px;
}

.header-left h2 {
    color: var(--psx-card-foreground);
    font-size: 16px;
    font-weight: 600;
}

.header-info-icon,
.plagscanx-modal-close,
.plagscanx-drawer .drawer-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--psx-muted-foreground);
    cursor: pointer;
    transition: background-color 120ms ease, color 120ms ease;
}

.header-info-icon:hover,
.plagscanx-modal-close:hover,
.plagscanx-drawer .drawer-close:hover {
    background: var(--psx-muted);
    color: var(--psx-card-foreground);
}

.header-info-icon .psx-icon,
.plagscanx-modal-close .psx-icon,
.plagscanx-drawer .drawer-close .psx-icon {
    width: 16px;
    height: 16px;
}

.header-right {
    gap: 12px;
}

.psx-edit-mode[hidden] { display: none !important; }
.psx-edit-mode-control {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 32px;
    margin: 0;
    cursor: pointer;
    white-space: nowrap;
    font-size: 12px;
    font-weight: 400;
    color: var(--psx-card-foreground);
}
.psx-edit-mode-control:has(input:disabled) { cursor: not-allowed; }
.psx-deep-search[hidden] { display: none !important; }
.psx-deep-search { flex: 0 1 auto; min-width: 0; }
.psx-deep-search .psx-icon { width: 14px; height: 14px; flex: 0 0 14px; }
.psx-deep-search-label { white-space: normal; overflow-wrap: anywhere; line-height: 16px; }
@media (max-width: 640px) {
    .psx-deep-search-label { max-width: 70px; }
    .is-standalone-scan .plagscanx-app-header:has(.psx-deep-search:not([hidden])) {
        height: auto; min-height: 88px; flex-basis: auto; flex-wrap: wrap; padding-block: 8px;
    }
    .is-standalone-scan .plagscanx-app-header:has(.psx-deep-search:not([hidden])) .header-left { flex-basis: 100%; }
    .is-standalone-scan .plagscanx-app-header:has(.psx-deep-search:not([hidden])) .header-right { margin-inline-start: auto; }
}
@media (min-width: 901px) and (max-width: 1350px) {
    .psx-edit-mode-label { display: none; }
}
@media (max-width: 900px) {
    :is(#view-text, #view-ai_detect, #view-new_scan) .toolbar-right .plagscanx-cta-tooltip-wrap[data-tooltip]::after {
        left: auto;
        right: 0;
        max-width: min(260px, calc(100vw - 32px));
    }
    :is(#view-text, #view-ai_detect, #view-new_scan) .toolbar-right .plagscanx-cta-tooltip-wrap[data-tooltip]::before {
        left: auto;
        right: 18px;
    }
}
@media (max-width: 440px) {
    :is(#view-text, #view-ai_detect, #view-new_scan) .toolbar-left:has(.psx-edit-mode:not([hidden])) > .toolbar-item:not(.counter-item) {
        flex: 0 0 auto;
    }
    :is(#view-text, #view-ai_detect, #view-new_scan) .toolbar-left:has(.psx-edit-mode:not([hidden])) .plagscanx-btn-upload {
        width: 38px;
        min-width: 38px;
        height: 38px;
        padding: 0 !important;
        justify-content: center;
    }
    :is(#view-text, #view-ai_detect, #view-new_scan) .toolbar-left:has(.psx-edit-mode:not([hidden])) .toolbar-compact-label {
        display: none;
    }
}

.psx-report-share[hidden],
.psx-report-download[hidden] {
    display: none !important;
}

.psx-pdf-icon {
    display: block;
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    fill: currentColor;
    stroke: none;
}

@media (min-width: 901px) {
    .plagscanx-main.is-standalone-scan {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 340px;
        grid-template-rows: 48px minmax(0, 1fr);
    }

    .is-standalone-scan > .plagscanx-app-header {
        grid-column: 1 / -1;
        grid-row: 1;
    }

    .is-standalone-scan > #plagscanx-form {
        grid-column: 1;
        grid-row: 2;
        min-width: 0;
    }

    .is-standalone-scan > .plagscanx-sidebar-right {
        grid-column: 2;
        grid-row: 2;
        width: auto;
        min-height: 0;
    }
}

@media (min-width: 901px) and (max-width: 1200px) {
    .plagscanx-main.is-standalone-scan {
        grid-template-columns: minmax(0, 1fr) 290px;
    }
}

.header-divider {
    background: var(--psx-border);
}

.plagscanx-editor-container {
    padding: 20px 24px;
    margin: 0;
}

#view-text .plagscanx-editor-container,
#view-ai_detect .plagscanx-editor-container {
    padding: 0;
    margin: 0;
    overflow: hidden;
}

.plagscanx-input-card,
.rewriter-panel {
    border: 0;
    border-radius: var(--psx-radius-card);
    background: var(--psx-card);
    box-shadow: var(--psx-shadow-soft);
}

.plagscanx-input-card {
    min-height: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

#view-text,
#view-ai_detect {
    background: var(--psx-card);
}

#plagscanx-text,
#plagscanx-ai-text,
#psx-new-text,
.rewriter-textarea,
.rw-output-text {
    background: var(--psx-card);
    color: var(--psx-card-foreground);
    font-family: inherit;
    font-size: 16px;
    line-height: 1.6;
}

#plagscanx-text,
#plagscanx-ai-text,
#psx-new-text {
    padding: 24px;
}

#plagscanx-text::placeholder,
#plagscanx-ai-text::placeholder,
#psx-new-text::placeholder,
.rewriter-textarea::placeholder,
.plagscanx-lp-widget textarea::placeholder {
    color: color-mix(in srgb, var(--psx-muted-foreground) 75%, transparent);
}

.plagscanx-editor-toolbar,
.rewriter-toolbar {
    border-top: 1px solid var(--psx-border);
    background: var(--psx-card);
}

.plagscanx-editor-toolbar {
    min-height: 60px;
    padding: 12px 16px;
}

.plagscanx-editor-toolbar .toolbar-left,
.plagscanx-editor-toolbar .toolbar-right {
    gap: 10px;
}

.plagscanx-editor-toolbar .toolbar-left > .toolbar-item:nth-child(2) {
    margin-left: 2px;
    padding-left: 12px;
    border-left: 1px solid var(--psx-border);
}

.plagscanx-error {
    width: 100%;
    margin: 0;
    padding: 10px 16px;
    border: 0;
    border-top: 1px solid var(--psx-border);
    border-radius: 0;
    background: color-mix(in srgb, var(--psx-risk-high) 8%, var(--psx-card));
    color: var(--psx-risk-high);
    font-size: 14px;
    line-height: 1.5;
}

.counter-item,
.rw-char-info,
.rw-word-count,
.rw-daily-usage {
    color: var(--psx-muted-foreground);
    font-size: 12px;
    font-weight: 500;
}

.plagscanx-btn-primary,
.plagscanx-lp-cta,
.pricing-cta-btn,
.addon-cta-btn,
.plagscanx-btn-signin {
    min-height: 36px;
    padding: 0 12px;
    border: 1px solid transparent;
    border-radius: var(--psx-radius-control) !important;
    box-shadow: none;
    font-size: 14px;
    font-weight: 500;
    line-height: 20px;
    transition: background-color 120ms ease, border-color 120ms ease, box-shadow 120ms ease, transform 80ms ease;
}

.plagscanx-btn-primary {
    background: var(--psx-primary) !important;
    color: var(--psx-primary-foreground);
}

.plagscanx-btn-primary:hover:not(:disabled) {
    background: color-mix(in srgb, var(--psx-primary) 80%, transparent) !important;
    box-shadow: none;
    color: var(--psx-primary-foreground);
    filter: none;
    transform: none;
}

.plagscanx-lp-cta,
.pricing-cta-btn,
.addon-cta-btn,
.plagscanx-btn-signin {
    background: var(--psx-cta) !important;
    color: #ffffff;
}

.plagscanx-lp-cta:hover:not(:disabled),
.pricing-cta-btn:hover,
.addon-cta-btn:hover,
.plagscanx-btn-signin:hover {
    background: var(--psx-cta-hover) !important;
    box-shadow: none;
    color: #ffffff;
    transform: none;
}

.plagscanx-btn-primary:active:not(:disabled),
.plagscanx-btn-secondary:active:not(:disabled),
.plagscanx-btn-upload:active:not(:disabled),
.plagscanx-lp-cta:active:not(:disabled) {
    transform: translateY(1px);
}

.plagscanx-btn-secondary,
.plagscanx-btn-upload,
.plagscanx-lp-upload-btn,
.plagscanx-lp-btn-secondary,
.rw-copy-btn,
.plagscanx-select-btn {
    min-height: 36px;
    padding: 0 12px !important;
    border: 1px solid var(--psx-border);
    border-radius: var(--psx-radius-control);
    background: var(--psx-card);
    box-shadow: none;
    color: var(--psx-card-foreground);
    font-size: 14px;
    font-weight: 500;
    line-height: 20px;
    transition: background-color 120ms ease, border-color 120ms ease, box-shadow 120ms ease, transform 80ms ease;
}

.plagscanx-btn-secondary:hover:not(:disabled),
.plagscanx-btn-upload:hover:not(:disabled),
.plagscanx-lp-upload-btn:hover:not(:disabled),
.plagscanx-lp-btn-secondary:hover:not(:disabled),
.rw-copy-btn:hover:not(:disabled),
.plagscanx-select-btn:hover:not(:disabled) {
    border-color: var(--psx-border-strong);
    background: var(--psx-muted);
    color: var(--psx-card-foreground);
}

.plagscanx-btn-secondary:is(.psx-report-share, .psx-report-download) {
    border-color: transparent;
    background: var(--psx-muted);
}

.plagscanx-btn-secondary:is(.psx-report-share, .psx-report-download):hover:not(:disabled) {
    border-color: transparent;
    background: color-mix(in srgb, var(--psx-muted) 94%, var(--psx-card-foreground));
}

.header-action-btn,
.header-share-btn,
.plagscanx-editor-toolbar .plagscanx-btn-primary,
.plagscanx-editor-toolbar .plagscanx-btn-secondary,
.plagscanx-editor-toolbar .plagscanx-btn-upload,
.rewriter-toolbar .plagscanx-btn-primary,
.rewriter-toolbar .plagscanx-btn-secondary,
.rewriter-toolbar .plagscanx-select-btn {
    min-height: 32px;
}

.plagscanx-editor-toolbar .plagscanx-btn-secondary,
.plagscanx-editor-toolbar .plagscanx-btn-upload,
.rewriter-toolbar .plagscanx-btn-secondary,
.rewriter-toolbar .plagscanx-select-btn {
    font-size: 12px;
}

.plagscanx-btn-primary .psx-icon,
.plagscanx-btn-secondary .psx-icon,
.plagscanx-btn-upload .psx-icon,
.plagscanx-select-btn .psx-icon,
.rw-copy-btn .psx-icon {
    width: 16px;
    height: 16px;
}

.plagscanx-btn-primary:disabled,
.plagscanx-lp-cta:disabled,
.pricing-cta-btn.disabled {
    border-color: var(--psx-disabled-border) !important;
    background: var(--psx-disabled-bg) !important;
    box-shadow: none;
    color: var(--psx-disabled-foreground) !important;
    filter: none;
    transform: none;
    opacity: 1;
}

.plagscanx-app-overlay .psx-scan-cta:disabled {
    appearance: none;
    border-color: var(--psx-disabled-border) !important;
    border-radius: var(--psx-radius-control) !important;
    background: var(--psx-disabled-bg) !important;
    box-shadow: none !important;
    color: var(--psx-disabled-foreground) !important;
    filter: none !important;
    opacity: 1 !important;
    transform: none !important;
}

.plagscanx-btn-secondary:disabled,
.plagscanx-btn-upload:disabled,
.plagscanx-select-btn:disabled {
    border-color: var(--psx-border) !important;
    background: var(--psx-muted) !important;
    box-shadow: none;
    color: var(--psx-muted-foreground) !important;
    opacity: 0.72;
}

.plagscanx-select-btn {
    min-width: 180px;
    background: var(--psx-card);
}

.toggle-slider {
    border: 2px solid transparent;
    border-radius: var(--psx-radius-control);
    background: var(--psx-input);
    transition: background-color 160ms ease, border-color 160ms ease;
}

.toggle-slider::before {
    top: 0;
    bottom: auto;
    left: 0;
    border-radius: var(--psx-radius-control);
    background: var(--psx-card);
    box-shadow: 0 1px 3px rgba(24, 24, 27, 0.18);
    transition: transform 160ms ease;
}

input:checked + .toggle-slider {
    border-color: var(--psx-primary);
    background: var(--psx-primary);
}

.plagscanx-toggle-container input[type="checkbox"]:focus-visible { outline: 0; }
.plagscanx-toggle-container input:focus-visible + .toggle-slider { outline: 2px solid var(--psx-primary); outline-offset: 3px; box-shadow: none; }
.plagscanx-toggle-container input:disabled + .toggle-slider { opacity: 0.55; cursor: not-allowed; }

.plagscanx-btn-primary:focus-visible,
.plagscanx-btn-secondary:focus-visible,
.plagscanx-btn-upload:focus-visible,
.plagscanx-lp-cta:focus-visible,
.plagscanx-lp-upload-btn:focus-visible,
.plagscanx-lp-btn-secondary:focus-visible,
.pricing-cta-btn:focus-visible,
.addon-cta-btn:focus-visible,
.plagscanx-btn-signin:focus-visible,
.rw-copy-btn:focus-visible,
.plagscanx-select-btn:focus-visible,
.header-info-icon:focus-visible,
.plagscanx-modal-close:focus-visible,
.plagscanx-drawer .drawer-close:focus-visible,
.plagscanx-nav li:focus-visible,
.psx-setting-input:focus-visible,
.plagscanx-lp-widget textarea:focus-visible {
    outline: 0;
    border-color: var(--psx-ring);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--psx-ring) 24%, transparent);
}

.rewriter-grid {
    gap: 16px;
    min-height: 0;
    height: 100%;
    flex-wrap: nowrap;
}

#view-rewriter,
#view-humanizer,
#view-grammar {
    background: var(--psx-canvas);
}

.rewriter-panel {
    overflow: hidden;
    min-width: 0;
    box-shadow: var(--psx-shadow-soft);
}

.rewriter-panel-header {
    min-height: 40px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--psx-border);
    background: var(--psx-card);
}

.rewriter-panel-header h3 {
    color: var(--psx-card-foreground);
    font-size: 14px;
    font-weight: 500;
    line-height: 20px;
}

.rewriter-toolbar {
    min-height: 56px;
    padding: 12px 16px;
}

.rewriter-textarea,
.rw-output-text {
    padding: 16px;
    font-size: 15px;
    line-height: 1.6;
}

.rw-output-text {
    max-height: none;
}

.header-usage-text {
    min-height: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--psx-muted-foreground);
    font-size: 13px;
}

.rw-state-box {
    background: transparent;
    color: var(--psx-muted-foreground);
}

.rw-state-box p,
.rw-state-box p.sub {
    color: var(--psx-muted-foreground);
}

.rw-state-box p {
    font-size: 15px;
    font-weight: 400;
}

.rw-state-box p.sub {
    font-size: 13px;
}

.rw-spinner {
    width: 34px;
    height: 34px;
    border: 3px solid var(--psx-muted);
    border-top-color: var(--psx-primary);
}

.results-empty-state {
    color: var(--psx-muted-foreground);
}

.results-empty-state .psx-empty-icon,
.rw-state-box .psx-empty-icon {
    color: var(--psx-border);
    stroke-width: 1.5;
}

.results-empty-state p {
    color: var(--psx-muted-foreground);
    font-size: 16px;
    font-weight: 500;
}

.plagscanx-sidebar-right {
    padding: 24px;
}

:is(#plagscanx-results, .psx-plagiarism-report),
:is(#ai-results, .psx-ai-report) {
    padding: 0;
}

#analysis-progress,
#ai-analysis-progress {
    width: 100%;
}

.score-header {
    padding: 0 0 24px;
    border-bottom: 1px solid var(--psx-border);
}

.big-score {
    color: var(--psx-card-foreground);
    font-size: 48px;
    font-weight: 600;
}

.risk-badge,
.history-score-badge {
    border-radius: var(--psx-radius-3xl);
}

.risk-badge {
    min-height: 20px;
    padding: 2px 8px;
    font-size: 12px;
    font-weight: 500;
}

.plagscanx-progress-bars {
    margin: 24px 0;
}

.bar-row {
    margin-bottom: 12px;
}

.bar-track,
.plagscanx-scan-progress-bar {
    height: 6px;
    border-radius: var(--psx-radius-full);
}

.sources-header,
.result-item {
    border-color: var(--psx-border);
}

.result-item {
    background: transparent;
}

/* Plagiarism result report */
:is(#plagscanx-results, .psx-plagiarism-report) {
    --plag-result-color: var(--psx-risk-safe);
    --plag-result-tint: #dcfce7;
}

:is(#plagscanx-results, .psx-plagiarism-report).plagiarism-result-low {
    --plag-result-color: var(--psx-risk-low);
    --plag-result-tint: #fef3c7;
}

:is(#plagscanx-results, .psx-plagiarism-report).plagiarism-result-moderate {
    --plag-result-color: var(--psx-risk-medium);
    --plag-result-tint: #ffedd5;
}

:is(#plagscanx-results, .psx-plagiarism-report).plagiarism-result-high {
    --plag-result-color: var(--psx-risk-high);
    --plag-result-tint: #fee2e2;
}

.plagiarism-result-overview {
    padding: 2px 0 22px;
    border-bottom: 1px solid var(--psx-border);
    text-align: center;
}

.plagiarism-result-description {
    max-width: 34ch;
    margin: 12px auto 0;
    color: var(--psx-card-foreground);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.plagiarism-match-summary {
    margin: 16px 0 0;
    color: var(--psx-muted-foreground);
    font-size: 13px;
}

.plagiarism-match-summary strong {
    color: var(--psx-card-foreground);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.plagiarism-comparison-coverage {
    margin: 12px 0 0;
    color: var(--psx-muted-foreground);
    font-size: 11px;
}

.plagiarism-distribution {
    margin-top: 10px;
}

.plagiarism-distribution-track {
    width: 100%;
    height: 7px;
    overflow: hidden;
    border-radius: var(--psx-radius-full);
    background: var(--psx-border);
}

.plagiarism-distribution-track > span {
    display: block;
    min-width: 0;
    height: 100%;
    border-radius: inherit;
    background: var(--plag-result-color);
    transition: width 300ms ease;
}

.plagiarism-distribution-track > span.has-value {
    min-width: 2px;
}

.plagiarism-distribution-labels {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 8px;
    color: var(--psx-muted-foreground);
    font-size: 11px;
    line-height: 16px;
}

.plagiarism-distribution-labels span:last-child {
    text-align: right;
}

.plagiarism-distribution-labels strong {
    color: var(--psx-card-foreground);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

:is(#plagscanx-results, .psx-plagiarism-report) .sources-header {
    align-items: flex-start;
    margin: 0;
    padding: 22px 0 12px;
    border-bottom: 0;
}

:is(#plagscanx-results, .psx-plagiarism-report) .sources-header h4,
:is(#plagscanx-results, .psx-plagiarism-report) .sources-header p {
    margin: 0;
}

:is(#plagscanx-results, .psx-plagiarism-report) .sources-header h4 {
    color: var(--psx-card-foreground);
    font-size: 15px;
    font-weight: 600;
    line-height: 20px;
}

:is(#plagscanx-results, .psx-plagiarism-report) .sources-header .badge {
    display: inline-flex;
    min-width: 20px;
    min-height: 20px;
    align-items: center;
    justify-content: center;
    margin-left: 4px;
    padding: 0 6px;
    border-radius: var(--psx-radius-full);
    background: var(--psx-muted);
    color: var(--psx-muted-foreground);
    font-size: 11px;
    font-weight: 600;
    vertical-align: top;
}

:is(#plagscanx-results, .psx-plagiarism-report) .sources-header p {
    margin-top: 2px;
    color: var(--psx-muted-foreground);
    font-size: 11px;
    line-height: 16px;
}

.plagiarism-show-all {
    display: inline-flex;
    min-height: 28px;
    padding: 0 10px;
    align-items: center;
    gap: 5px;
    border: 1px solid var(--psx-border);
    border-radius: var(--psx-radius-control);
    background: var(--psx-card);
    color: var(--psx-card-foreground);
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
}

.plagiarism-show-all .psx-icon {
    width: 13px;
    height: 13px;
}

.plagiarism-show-all:hover,
.plagiarism-show-all:focus-visible {
    border-color: var(--psx-border-strong);
    background: var(--psx-muted);
}

.plagscanx-sources-list {
    display: grid;
    gap: 10px;
}

:is(#plagscanx-results, .psx-plagiarism-report) .result-item {
    margin: 0;
    padding: 0;
    border: 1px solid var(--psx-border);
    border-radius: var(--psx-radius-lg);
    background: var(--psx-card);
    box-shadow: none;
    transition: border-color 150ms ease, background-color 150ms ease;
}

:is(#plagscanx-results, .psx-plagiarism-report) .result-item.is-active {
    border-color: color-mix(in srgb, var(--psx-primary) 55%, var(--psx-border));
    background: color-mix(in srgb, var(--psx-primary) 4%, var(--psx-card));
}

.source-item-topline {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr);
    align-items: center;
    gap: 7px;
}

.source-index {
    display: inline-flex;
    width: 22px;
    height: 22px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--psx-muted);
    color: var(--psx-card-foreground);
    font-size: 10px;
    font-weight: 600;
}

.source-domain {
    min-width: 0;
    overflow: hidden;
    color: var(--psx-muted-foreground);
    font-size: 11px;
    line-height: 16px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.source-title {
    min-width: 0;
    margin: 0;
    color: var(--psx-card-foreground);
    font-size: 13px;
    font-weight: 600;
    line-height: 18px;
    overflow-wrap: anywhere;
}

.source-title-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 9px;
}

.source-highlight-icon {
    flex: 0 0 16px;
    width: 16px;
    height: 16px;
    margin-inline-start: auto;
    color: var(--psx-muted-foreground);
}

.source-item-actions {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 0;
    padding: 0 13px 13px;
}

:is(#plagscanx-results, .psx-plagiarism-report) .source-select {
    display: block;
    width: 100%;
    min-width: 0;
    margin: 0;
    padding: 13px;
    border: 0;
    border-radius: inherit;
    background: transparent;
    box-shadow: none;
    color: var(--psx-card-foreground);
    font: inherit;
    text-align: start;
    text-transform: none;
    white-space: normal;
}

:is(#plagscanx-results, .psx-plagiarism-report) button.source-select {
    cursor: pointer;
}

:is(#plagscanx-results, .psx-plagiarism-report) button.source-select:hover {
    background: color-mix(in srgb, var(--psx-primary) 3%, transparent);
}

.source-select[aria-pressed="true"] .source-highlight-icon {
    color: var(--psx-primary);
}

:is(#plagscanx-results, .psx-plagiarism-report) button.source-select:focus-visible {
    outline: 2px solid var(--psx-ring);
    outline-offset: -3px;
}

.plagiarism-show-all:focus-visible,
.source-open-link:focus-visible {
    outline: 2px solid var(--psx-ring);
    outline-offset: 2px;
}

.source-metrics {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-top: 9px;
}

.source-metrics strong {
    color: var(--plag-result-color);
    font-size: 15px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.source-metrics span {
    color: var(--psx-muted-foreground);
    font-size: 11px;
}

:is(#plagscanx-results, .psx-plagiarism-report) .result-item .snippet {
    display: -webkit-box;
    margin: 9px 0 0;
    overflow: hidden;
    color: var(--psx-muted-foreground);
    font-size: 12px;
    font-style: normal;
    line-height: 18px;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
}

.source-open-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 0;
    color: var(--psx-link);
    font-size: 11px;
    font-weight: 500;
    text-decoration: none;
}

.source-open-link .psx-icon {
    width: 13px;
    height: 13px;
}

.plagiarism-highlight-match {
    padding: 2px 0;
    border-radius: 2px;
    background: color-mix(in srgb, var(--psx-risk-high) 18%, transparent);
    color: inherit;
    cursor: pointer;
}

.plagiarism-highlight-match:hover {
    box-shadow: inset 0 -2px 0 color-mix(in srgb, var(--psx-risk-high) 55%, transparent);
}

.plagiarism-highlight-match.is-estimated {
    background: color-mix(in srgb, var(--psx-risk-medium) 18%, transparent);
    box-shadow: inset 0 -1px 0 color-mix(in srgb, var(--psx-risk-medium) 55%, transparent);
}

:is(#plagscanx-results, .psx-plagiarism-report) .psx-inline-state {
    margin: 0;
    padding: 18px 12px;
    border: 1px dashed var(--psx-border);
    border-radius: var(--psx-radius-lg);
    color: var(--psx-muted-foreground);
    font-size: 12px;
    text-align: center;
}

@media (prefers-reduced-motion: reduce) {
    .plagiarism-gauge-fill,
    .plagiarism-distribution-track > span,
    :is(#plagscanx-results, .psx-plagiarism-report) .result-item {
        transition: none;
    }
}

/* Pricing comparison */
#view-pricing {
    overflow: hidden auto;
    background: var(--psx-background);
}

.plagscanx-pricing-wrapper {
    box-sizing: border-box;
    display: block;
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    padding: 56px 48px 80px;
}

.plagscanx-pricing-header {
    margin: 0 0 48px;
    text-align: left;
}

.plagscanx-pricing-header h1 {
    margin: 0;
    color: var(--psx-card-foreground);
    font-size: 48px;
    font-weight: 700;
    line-height: 1.08;
}

.plagscanx-pricing-header > p {
    max-width: 680px;
    margin: 14px 0 0;
    color: var(--psx-muted-foreground);
    font-size: 15px;
    line-height: 1.6;
}

.pricing-billing-control {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    width: max-content;
    max-width: 100%;
    margin: 0;
}

.pricing-cycle-label {
    color: var(--psx-muted-foreground);
    font-size: 14px;
    font-weight: 400;
    transition: color 160ms ease;
}

.pricing-cycle-label.is-active {
    color: var(--psx-card-foreground);
    font-weight: 500;
}

.plagscanx-pricing-catalog {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(230px, 1fr);
    gap: 24px;
    align-items: stretch;
}

.plagscanx-pricing-catalog.without-one-time {
    grid-template-columns: 1fr;
}

.pricing-plan-group {
    display: grid;
    grid-template-rows: minmax(76px, auto) 1fr;
    min-width: 0;
}

.pricing-group-heading {
    padding-bottom: 18px;
}

.pricing-group-title-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px 22px;
    margin-bottom: 6px;
}

.pricing-group-heading h2 {
    margin: 0;
    color: var(--psx-card-foreground);
    font-size: 20px;
    font-weight: 600;
    line-height: 1.3;
}

.pricing-group-heading p {
    max-width: 560px;
    margin: 0;
    color: var(--psx-muted-foreground);
    font-size: 13px;
    line-height: 1.5;
}

.pricing-default-yearly-badge {
    flex: 0 0 auto;
    white-space: nowrap;
}

.pricing-card-cluster {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    overflow: hidden;
    border: 1px solid var(--psx-border-strong);
    border-radius: var(--psx-radius-lg);
    background: var(--psx-card);
}

.pricing-card-cluster.psx-subscription-count-1 { grid-template-columns: 1fr; }
.pricing-card-cluster.psx-subscription-count-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pricing-card-cluster.psx-subscription-count-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.plagscanx-pricing-card {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 510px;
    padding: 26px 22px;
    border: 0;
    border-radius: 0;
    background: var(--psx-card);
    box-shadow: none;
    color: var(--psx-card-foreground);
    transition: background-color 160ms ease;
}

.pricing-card-cluster .plagscanx-pricing-card + .plagscanx-pricing-card {
    border-left: 1px solid var(--psx-border-strong);
}

.plagscanx-pricing-card:hover,
.plagscanx-pricing-card.highlighted,
.plagscanx-pricing-card.highlighted:hover {
    border-color: transparent;
    background: color-mix(in srgb, var(--psx-primary) 3%, var(--psx-card));
    box-shadow: none;
    transform: none;
}

.plagscanx-pricing-card.highlighted,
.plagscanx-pricing-card.highlighted:hover {
    box-shadow: inset 0 3px 0 var(--psx-primary);
}

.pricing-one-time-group .plagscanx-pricing-card {
    height: 100%;
    border: 1px solid var(--psx-border-strong);
    border-radius: var(--psx-radius-lg);
    background: var(--psx-muted);
}

.pricing-card-header {
    min-height: 176px;
    margin: 0;
    padding: 0;
    border: 0;
}

.pricing-card-topline {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    min-height: 26px;
}

.pricing-card-header h3 {
    min-width: 0;
    margin: 0;
    color: var(--psx-card-foreground);
    font-size: 19px;
    font-weight: 600;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.pricing-badge,
.discount-badge {
    position: static;
    display: inline-flex;
    align-items: center;
    width: max-content;
    max-width: 100%;
    padding: 3px 7px;
    border: 0;
    border-radius: var(--psx-radius-sm);
    transform: none;
    font-size: 10px;
    font-weight: 600;
    line-height: 1.3;
    text-transform: none;
    white-space: normal;
    overflow-wrap: anywhere;
}

.pricing-badge {
    margin-left: auto;
    background: var(--psx-card-foreground);
    color: var(--psx-primary-foreground);
}

.discount-badge {
    background: color-mix(in srgb, var(--psx-primary) 11%, var(--psx-card));
    color: var(--psx-primary);
}

.pricing-card-desc {
    min-height: 42px;
    margin: 10px 0 0;
    color: var(--psx-muted-foreground);
    font-size: 13px;
    line-height: 1.55;
}

.pricing-price {
    display: block;
    margin-top: 28px;
}

.pricing-price > div {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 4px;
}

.price-amount {
    color: var(--psx-card-foreground);
    font-size: 32px;
    font-weight: 700;
    line-height: 1;
    overflow-wrap: anywhere;
}

.price-period {
    color: var(--psx-muted-foreground);
    font-size: 14px;
    font-weight: 500;
}

.pricing-price-note {
    margin: 7px 0 0;
    color: var(--psx-muted-foreground);
    font-size: 12px;
    line-height: 1.4;
}

.pricing-price.is-unavailable .price-amount {
    color: var(--psx-muted-foreground);
    font-size: 18px;
    font-weight: 500;
}

.pricing-card-footer {
    margin: 24px 0;
    text-align: left;
}

.pricing-cta-btn,
.addon-cta-btn {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 42px;
    padding: 9px 14px;
    border: 1px solid var(--psx-cta);
    border-radius: var(--psx-radius-md) !important;
    background: var(--psx-cta);
    box-shadow: none;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.25;
    text-align: center;
    text-decoration: none;
    white-space: normal;
    overflow-wrap: anywhere;
    transition: background-color 160ms ease, border-color 160ms ease;
}

.pricing-cta-btn:hover,
.addon-cta-btn:hover,
.plagscanx-pricing-card.highlighted .pricing-cta-btn:hover {
    border-color: var(--psx-cta-hover);
    background: var(--psx-cta-hover);
    box-shadow: none;
    color: #fff;
    transform: none;
}

.pricing-cta-btn:disabled,
.pricing-cta-btn.disabled {
    border-color: var(--psx-disabled-border) !important;
    background: var(--psx-disabled-bg) !important;
    color: var(--psx-disabled-foreground) !important;
    cursor: default;
    pointer-events: none;
}

.pricing-features {
    display: grid;
    align-content: start;
    gap: 10px;
    flex: 1;
    margin: 0;
    padding: 22px 0 0;
    border-top: 1px solid var(--psx-border);
    list-style: none;
}

.pricing-features li {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 0;
    color: var(--psx-card-foreground);
    font-size: 12.5px;
    line-height: 1.45;
}

.pricing-features li .psx-icon {
    width: 16px;
    height: 16px;
    margin-top: 1px;
    flex: 0 0 16px;
    color: var(--psx-primary) !important;
    stroke-width: 2;
}

.plagscanx-addon-banner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 28px;
    margin-top: 42px;
    padding: 28px;
    border: 1px solid color-mix(in srgb, var(--psx-primary) 22%, var(--psx-border));
    border-radius: var(--psx-radius-lg);
    background: color-mix(in srgb, var(--psx-primary) 6%, var(--psx-card));
    box-shadow: none;
}

.addon-banner-content {
    align-items: flex-start;
    min-width: 0;
}

.addon-banner-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: var(--psx-radius-md);
    background: var(--psx-primary);
    color: var(--psx-primary-foreground);
}

.addon-banner-icon .psx-icon {
    width: 19px;
    height: 19px;
}

.addon-banner-text h2 {
    margin: 0 0 5px;
    color: var(--psx-card-foreground);
    font-size: 18px;
    font-weight: 600;
}

.addon-banner-text > p {
    max-width: 780px;
    margin: 0;
    color: var(--psx-muted-foreground);
    font-size: 13px;
    line-height: 1.5;
}

.addon-banner-text ul {
    display: flex;
    flex-wrap: wrap;
    gap: 7px 18px;
    margin: 14px 0 0;
    padding: 0;
    list-style: none;
}

.addon-banner-text li {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--psx-card-foreground);
    font-size: 12.5px;
}

.addon-banner-text li .psx-icon {
    width: 15px;
    height: 15px;
    color: var(--psx-primary);
}

.addon-banner-text .addon-banner-note {
    margin-top: 12px;
    font-size: 12px;
}

.addon-cta-btn {
    width: auto;
    min-width: 160px;
}

@media (max-width: 1180px) {
    .plagscanx-pricing-wrapper {
        padding-right: 30px;
        padding-left: 30px;
    }

    .plagscanx-pricing-catalog {
        grid-template-columns: 1fr;
    }

    .pricing-plan-group {
        grid-template-rows: auto 1fr;
    }

    .pricing-one-time-group {
        margin-top: 12px;
    }

    .pricing-one-time-group .plagscanx-pricing-card {
        min-height: 0;
    }
}

@media (max-width: 820px) {
    .plagscanx-pricing-wrapper {
        padding: 36px 20px 56px;
    }

    .plagscanx-pricing-header {
        margin-bottom: 36px;
    }

    .plagscanx-pricing-header h1 {
        font-size: 36px;
    }

    .pricing-billing-control {
        margin: 0;
    }

    .pricing-card-cluster,
    .pricing-card-cluster.psx-subscription-count-3,
    .pricing-card-cluster.psx-subscription-count-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
        overflow: visible;
        border: 0;
        background: transparent;
    }

    .pricing-card-cluster .plagscanx-pricing-card,
    .pricing-card-cluster .plagscanx-pricing-card + .plagscanx-pricing-card {
        border: 1px solid var(--psx-border-strong);
        border-radius: var(--psx-radius-lg);
    }

    .plagscanx-addon-banner {
        grid-template-columns: 1fr;
    }

    .addon-cta-btn {
        width: 100%;
    }
}

@media (max-width: 560px) {
    .plagscanx-pricing-wrapper {
        padding: 28px 16px 44px;
    }

    .plagscanx-pricing-header h1 {
        font-size: 32px;
    }

    .pricing-card-cluster,
    .pricing-card-cluster.psx-subscription-count-2,
    .pricing-card-cluster.psx-subscription-count-3,
    .pricing-card-cluster.psx-subscription-count-4 {
        grid-template-columns: 1fr;
    }

    .plagscanx-pricing-card {
        min-height: 0;
        padding: 24px 20px;
    }

    .pricing-card-header {
        min-height: 0;
    }

    .pricing-card-footer {
        margin: 24px 0;
    }

    .plagscanx-addon-banner {
        padding: 22px 18px;
        text-align: left;
    }

    .addon-banner-content {
        flex-direction: row;
    }
}

/* App-wide notification bar */
.psx-app-notice {
    box-sizing: border-box;
    position: relative;
    z-index: 5;
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    min-width: 0;
    height: 36px;
    min-height: 36px;
    padding: 2px 12px;
    border-bottom: 1px solid color-mix(in srgb, var(--psx-notice-text) 13%, transparent);
    background: var(--psx-notice-bg);
    color: var(--psx-notice-text);
}

.psx-app-notice-content,
.psx-app-notice-actions {
    display: flex;
    align-items: center;
    min-width: 0;
}

.psx-app-notice-content {
    flex: 1 1 auto;
    justify-content: center;
    gap: 10px;
}

.psx-app-notice-actions {
    flex: 0 0 auto;
    gap: 8px;
}

.psx-app-notice-icon {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
}

.psx-app-notice-message {
    min-width: 0;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.psx-app-notice-code {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 28px;
    padding: 3px 8px;
    border: 0;
    border-radius: 4px;
    background: var(--psx-notice-code-bg);
    color: var(--psx-notice-code-text);
    cursor: pointer;
}

.psx-app-notice-code code {
    padding: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    font-weight: 600;
}

.psx-app-notice-code .psx-icon,
.psx-app-notice-cta .psx-icon,
.psx-app-notice-close .psx-icon {
    width: 16px;
    height: 16px;
}

.psx-app-notice-code:hover {
    filter: brightness(0.96);
}

.psx-app-notice-code:focus-visible,
.psx-app-notice-close:focus-visible,
.psx-app-notice-cta:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

.psx-app-notice .psx-app-notice-cta {
    box-sizing: border-box;
    height: 28px;
    min-height: 28px;
    padding: 0 12px;
    gap: 6px;
    font-size: 12px;
    line-height: 1;
    white-space: nowrap;
    text-decoration: none;
}

.psx-app-notice .psx-app-notice-cta:hover {
    transform: none;
    box-shadow: none;
}

.psx-app-notice-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    flex: 0 0 26px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: inherit;
    cursor: pointer;
}

.psx-app-notice-close:hover {
    background: color-mix(in srgb, var(--psx-notice-text) 9%, transparent);
}

@media (min-width: 901px) {
    .plagscanx-main.is-standalone-scan.has-app-notice {
        grid-template-rows: auto 48px minmax(0, 1fr);
    }

    .is-standalone-scan.has-app-notice > .psx-app-notice {
        grid-column: 1 / -1;
        grid-row: 1;
    }

    .is-standalone-scan.has-app-notice > .plagscanx-app-header {
        grid-row: 2;
    }

    .is-standalone-scan.has-app-notice > #plagscanx-form,
    .is-standalone-scan.has-app-notice > .plagscanx-sidebar-right {
        grid-row: 3;
    }
}

@media (max-width: 760px) {
    .psx-app-notice {
        height: auto;
        min-height: 36px;
        align-items: flex-start;
        flex-wrap: wrap;
        gap: 8px 12px;
        padding: 10px 12px;
    }

    .psx-app-notice-content {
        flex-wrap: wrap;
        justify-content: flex-start;
        gap: 8px;
    }

    .psx-app-notice-message {
        flex: 1 1 calc(100% - 28px);
    }

    .psx-app-notice-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

@media (max-width: 420px) {
    .psx-app-notice-cta {
        flex: 1 1 auto;
        justify-content: center;
    }
}

.step-item {
    min-height: 40px;
    padding: 8px 10px;
    border: 0;
    border-radius: var(--psx-radius-2xl);
    background: transparent;
}

.step-item.active {
    background: var(--psx-muted);
}

.step-icon {
    background: var(--psx-muted);
}

.plagscanx-scan-progress-bar .progress-fill,
.quota-progress-track span {
    background: var(--psx-primary);
}

.history-container,
.settings-container,
.library-container {
    width: 100%;
    margin: 0;
    padding: 40px;
}

.history-container {
    max-width: none;
}

.settings-container,
.library-container {
    max-width: 980px;
}

#view-history,
#view-library,
#view-pricing {
    background: var(--psx-canvas);
}

#view-settings {
    background: var(--psx-background);
}

.plagscanx-history-grid,
.usage-details-grid,
.library-quota-stats-grid {
    gap: 20px;
}

.plagscanx-history-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.history-card,
.usage-detail-card,
.simple-usage-details-card,
.quota-stat-card,
.library-upload-card,
.library-list-card {
    border: 0;
    border-radius: var(--psx-radius-card);
    background: var(--psx-card);
    box-shadow: var(--psx-shadow-soft);
}

.history-card {
    min-height: 178px;
    padding: 16px 0;
    gap: 14px;
}

.history-card:hover {
    box-shadow: var(--psx-shadow-hover);
    transform: none;
}

.history-card-header {
    margin: 0;
    padding: 0 16px;
    gap: 10px;
}

.history-badges {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 0;
}

.history-score-badge,
.history-type-badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    min-height: 20px;
    padding: 2px 8px;
    border: 1px solid transparent;
    border-radius: var(--psx-radius-3xl);
    font-size: 12px;
    font-weight: 500;
    line-height: 1;
    text-transform: none;
    white-space: nowrap;
}

.history-type-badge {
    border-color: var(--psx-border);
    background: transparent;
    color: var(--psx-card-foreground);
}

.history-date {
    flex-shrink: 0;
    font-size: 11px;
    line-height: 16px;
}

.history-snippet {
    margin: 0;
    padding: 0 16px;
    font-size: 13px;
    line-height: 1.5;
}

.history-footer {
    margin-top: auto;
    padding: 14px 16px 0;
}

.history-word-count {
    margin-right: 4px;
    color: var(--psx-muted-foreground);
    font-size: 11px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.history-footer,
.settings-row,
.pricing-card-header,
.psx-modal-footer-bordered {
    border-color: var(--psx-border);
}

.btn-see-report {
    min-height: 24px;
    padding: 0 10px;
    border: 1px solid var(--psx-border);
    border-radius: var(--psx-radius-control);
    background: var(--psx-card);
    color: var(--psx-card-foreground);
    font-size: 12px;
    font-weight: 500;
}

.btn-see-report:hover {
    border-color: var(--psx-border-strong);
    background: var(--psx-muted);
    color: var(--psx-card-foreground);
}

.settings-header-box {
    margin-bottom: 40px;
}

.settings-header-box h1 {
    margin: 0;
    color: var(--psx-card-foreground);
    font-size: 24px;
    font-weight: 600;
    line-height: 32px;
}

.settings-section {
    margin-bottom: 48px;
}

.settings-section-label {
    margin-bottom: 8px;
    color: var(--psx-muted-foreground);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.settings-row {
    min-height: 80px;
    padding: 24px 0;
}

.row-title,
.static-val {
    color: var(--psx-card-foreground);
    font-size: 15px;
}

.row-title {
    font-weight: 600;
}

.row-desc,
.settings-subtitle {
    color: var(--psx-muted-foreground);
    font-size: 13px;
}

.settings-profile-summary,
.settings-plan-action {
    display: flex;
    align-items: center;
    gap: 12px;
}

.settings-profile-avatar,
.settings-profile-avatar img {
    display: block;
    width: 32px;
    height: 32px;
    border-radius: var(--psx-radius-full);
}

.settings-profile-avatar img {
    object-fit: cover;
    box-shadow: 0 0 0 1px var(--psx-border);
}

.settings-plan-action .tier-label {
    min-height: 20px;
    padding: 2px 8px;
    border-radius: var(--psx-radius-3xl);
    font-size: 12px;
    font-weight: 500;
    line-height: 16px;
    text-transform: none;
}

.settings-plan-button {
    min-height: 32px;
    padding: 0 12px;
}

.usage-detail-card-empty .usage-empty-state {
    align-items: flex-start;
    gap: 10px;
}

.usage-empty-copy {
    margin: 0;
    color: var(--psx-muted-foreground);
    font-size: 13px;
    line-height: 20px;
}

.settings-extra-words-button {
    order: initial;
    display: inline-flex;
    gap: 8px;
    width: auto;
    min-height: 32px;
    margin: 0;
    padding: 0 12px;
    border-color: var(--psx-border);
    border-radius: var(--psx-radius-control);
    background: var(--psx-card);
    color: var(--psx-card-foreground);
    font-size: 13px;
    font-weight: 500;
    line-height: 20px;
    text-decoration: none;
    white-space: nowrap;
}

.settings-extra-words-button .psx-icon {
    width: 15px;
    height: 15px;
}

.settings-extra-words-button:hover {
    border-color: var(--psx-border-strong);
    background: var(--psx-muted);
    color: var(--psx-card-foreground);
}

.settings-extra-words-button:focus-visible {
    outline: 2px solid color-mix(in srgb, var(--psx-primary) 36%, transparent);
    outline-offset: 2px;
}

.settings-delete-section {
    margin-bottom: 0;
}

.plagscanx-btn-destructive {
    min-height: 32px;
    border-color: transparent;
    background: color-mix(in srgb, var(--psx-risk-high) 10%, transparent);
    color: var(--psx-risk-high);
}

.plagscanx-btn-destructive:hover:not(:disabled) {
    border-color: transparent;
    background: color-mix(in srgb, var(--psx-risk-high) 18%, transparent);
    color: var(--psx-risk-high);
}

.settings-subtitle {
    margin-top: 4px;
    font-size: 14px;
}

.usage-details-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-top: 16px;
    padding: 0 16px;
    border-radius: var(--psx-radius-card);
    background: var(--psx-card);
    box-shadow: var(--psx-shadow-soft);
}

.usage-detail-card {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    min-height: 104px;
    padding: 16px 0;
    border: 0;
    border-bottom: 1px solid var(--psx-border);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.usage-detail-card:last-child {
    border-bottom: 0;
}

.usage-detail-card:hover {
    border-color: var(--psx-border);
    box-shadow: none;
    transform: none;
}

.usage-detail-card .tool-name {
    font-size: 14px;
    font-weight: 500;
}

.usage-detail-card .reset-date {
    font-size: 12px;
}

.usage-detail-card .stats-row {
    justify-content: flex-start;
    line-height: 20px;
}

.usage-detail-card .usage-stats {
    gap: 6px;
}

.usage-detail-card .usage-bar-mini {
    width: 100%;
}

.psx-setting-input {
    min-height: 38px;
    border-color: transparent;
    border-radius: 12px;
    background: color-mix(in srgb, var(--psx-input) 72%, var(--psx-card));
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--psx-border) 68%, transparent);
}

.library-dropzone {
    border: 1px dashed var(--psx-border-strong);
    border-radius: var(--psx-radius-2xl);
    background: var(--psx-card);
}

.library-dropzone:hover {
    border-color: var(--psx-primary);
    background: color-mix(in srgb, var(--psx-primary) 4%, var(--psx-card));
}

.library-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.library-quota-stats-grid {
    order: 2;
    margin: 0;
    gap: 16px;
}

.quota-stat-card {
    gap: 8px;
    padding: 16px;
    border: 0;
    border-radius: var(--psx-radius-card);
    box-shadow: var(--psx-shadow-soft);
}

.quota-stat-card:hover {
    box-shadow: var(--psx-shadow-soft);
    transform: none;
}

.library-stat-number {
    font-size: 20px;
    font-weight: 600;
}

.library-tip-box {
    order: 1;
    margin: 0;
    padding: 12px 16px;
    border-color: var(--psx-border);
    border-radius: var(--psx-radius-2xl);
    background: var(--psx-card);
    color: var(--psx-card-foreground);
    font-size: 14px;
}

.library-tip-box .psx-icon {
    color: var(--psx-muted-foreground);
}

.library-upload-card,
.library-list-card {
    margin: 0;
    border: 0;
    border-radius: var(--psx-radius-card);
    box-shadow: var(--psx-shadow-soft);
}

.library-upload-card {
    order: 4;
    padding: 0;
    background: transparent;
    box-shadow: none;
    text-align: center;
}

.library-upload-card > .library-card-title,
.library-upload-card > .library-card-copy {
    display: none;
}

.library-dropzone {
    min-height: 132px;
    justify-content: center;
    padding: 32px 24px;
}

.library-dropzone .psx-icon {
    width: 28px;
    height: 28px;
}

.library-list-card {
    order: 3;
    padding: 24px 0 0;
    overflow: hidden;
}

.library-list-header {
    margin: 0;
    padding: 0 24px 20px;
    border-bottom: 0;
}

.library-list-heading {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.library-upload-button {
    min-height: 32px;
    cursor: pointer;
}

.library-list-title {
    font-size: 16px;
    font-weight: 500;
}

.library-list-title .psx-icon {
    display: none;
}

.plagscanx-library-table-scroll {
    border-top: 1px solid var(--psx-border);
}

.plagscanx-library-table thead {
    background: transparent;
}

.plagscanx-library-table th {
    height: 48px;
    padding: 0 12px;
    color: var(--psx-card-foreground);
    font-size: 13px;
    font-weight: 500;
    text-transform: none;
}

.plagscanx-library-table th:first-child,
.plagscanx-library-table td:first-child {
    padding-left: 24px;
}

.plagscanx-library-table th:last-child,
.plagscanx-library-table td:last-child {
    padding-right: 24px;
}

.plagscanx-library-table td {
    padding: 12px;
    font-size: 14px;
}

.plagscanx-library-table .library-title-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}

.library-file-icon {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
    color: var(--psx-muted-foreground);
}

.plagscanx-library-table td,
.plagscanx-library-table th,
.plagscanx-library-table tbody tr {
    border-color: var(--psx-border);
}

.plagscanx-library-table tbody tr:hover {
    background: color-mix(in srgb, var(--psx-muted) 50%, transparent);
}

.btn-delete-lib-item,
.btn-share-report,
.btn-delete-card {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    border: 0;
    border-radius: var(--psx-radius-control);
    background: transparent;
    color: var(--psx-muted-foreground);
}

.btn-delete-lib-item .psx-icon,
.btn-share-report .psx-icon,
.btn-delete-card .psx-icon {
    width: 14px;
    height: 14px;
}

.btn-delete-lib-item:hover,
.btn-share-report:hover,
.btn-delete-card:hover {
    background: var(--psx-muted);
}

.plagscanx-pricing-wrapper {
    width: 100%;
    max-width: 1160px;
    margin: 0 auto;
    padding: 40px 30px 72px;
}

.plagscanx-pricing-header {
    margin-bottom: 28px;
}

.plagscanx-pricing-header h1 {
    color: var(--psx-card-foreground);
    font-size: 24px;
    font-weight: 600;
}

.plagscanx-pricing-header h4 {
    color: var(--psx-muted-foreground);
    font-size: 14px;
}

.pricing-billing-toggle {
    padding: 3px;
    border: 1px solid var(--psx-border);
    border-radius: var(--psx-radius-control);
    background: var(--psx-muted);
}

.billing-toggle-btn {
    min-height: 34px;
    padding: 0 16px;
    border-radius: var(--psx-radius-control);
    color: var(--psx-muted-foreground);
    font-size: 13px;
    font-weight: 500;
}

.billing-toggle-btn.active {
    background: var(--psx-card);
    box-shadow: var(--psx-shadow-soft);
    color: var(--psx-card-foreground);
}

.plagscanx-pricing-grid {
    gap: 16px;
}

.plagscanx-pricing-card {
    padding: 24px;
    border: 0;
    border-radius: var(--psx-radius-card);
    background: var(--psx-card);
    box-shadow: var(--psx-shadow-soft);
}

.plagscanx-pricing-card:hover {
    border-color: var(--psx-border-strong);
    box-shadow: var(--psx-shadow-hover);
    transform: none;
}

.plagscanx-pricing-card.highlighted {
    border: 0;
    box-shadow: 0 0 0 2px var(--psx-primary), var(--psx-shadow-soft);
}

.plagscanx-pricing-card.highlighted:hover {
    box-shadow: 0 0 0 2px var(--psx-primary), var(--psx-shadow-hover);
}

.pricing-badge {
    top: 10px;
    right: 12px;
    left: auto;
    padding: 4px 9px;
    transform: none;
    border-radius: var(--psx-radius-control);
    font-size: 10px;
    font-weight: 600;
    text-transform: none;
}

.pricing-card-header h3 {
    color: var(--psx-card-foreground);
    font-size: 18px;
    font-weight: 650;
}

.price-amount {
    color: var(--psx-card-foreground);
    font-size: 34px;
    font-weight: 700;
}

.plagscanx-addon-banner {
    border: 0;
    border-radius: var(--psx-radius-card);
    background: var(--psx-card);
    box-shadow: var(--psx-shadow-soft);
}

.plagscanx-modal-overlay,
.plagscanx-drawer-overlay {
    background: rgb(0 0 0 / 0.3);
    backdrop-filter: blur(4px);
}

.plagscanx-modal-content {
    max-width: 460px;
    padding: 26px;
    border: 0;
    border-radius: var(--psx-radius-dialog);
    background: var(--psx-popover);
    box-shadow: var(--psx-shadow-dialog);
    color: var(--psx-popover-foreground);
    text-align: left;
    animation: psxLumaDialogIn 150ms ease-out;
}

@keyframes psxLumaDialogIn {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.plagscanx-modal-close {
    top: 12px;
    right: 12px;
    background: transparent;
}

#plagscanx-login-modal .plagscanx-modal-content {
    max-width: 460px;
    padding: 36px 32px 30px;
    text-align: center;
}

#plagscanx-login-modal .plagscanx-login-card-inner {
    width: 100%;
    max-width: 380px;
    margin: 0 auto;
    text-align: center;
}

#plagscanx-login-modal .plagscanx-modal-header h2 {
    text-align: center;
}

#plagscanx-login-modal .plagscanx-modal-header p {
    max-width: 36ch;
    margin: 0 auto 28px;
    text-align: center;
}

#plagscanx-login-modal .psx-login-body {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    width: 100%;
}

#plagscanx-login-modal .g_id_signin,
#plagscanx-login-modal .psx-google-signin {
    display: flex;
    width: 100%;
    justify-content: center;
}

#plagscanx-login-modal .g_id_signin > div,
#plagscanx-login-modal .g_id_signin iframe,
#plagscanx-login-modal .psx-google-signin > div,
#plagscanx-login-modal .psx-google-signin iframe {
    margin-inline: auto !important;
}

#plagscanx-login-modal .plagscanx-modal-footer {
    margin-top: 24px;
    padding: 0;
    border: 0;
    text-align: center;
}

#plagscanx-login-modal .plagscanx-modal-footer p {
    max-width: 38ch;
    margin: 0 auto;
    font-size: 12px;
    line-height: 1.55;
}

#plagscanx-login-modal .plagscanx-modal-footer a {
    color: var(--psx-link);
    font-weight: 500;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

#plagscanx-login-modal .plagscanx-modal-footer a:hover {
    color: var(--psx-link-hover, var(--psx-primary));
}

@media (max-width: 480px) {
    #plagscanx-login-modal .plagscanx-modal-content {
        padding: 30px 20px 24px;
    }
}

.psx-modal-compact,
.psx-modal-wide,
.psx-quota-modal,
.psx-share-modal {
    padding: 26px;
    border-radius: var(--psx-radius-dialog);
}

.psx-modal-compact {
    max-width: 512px;
}

.psx-modal-wide {
    max-width: 640px;
    padding: 24px;
}

#plagscanx-advanced-modal .psx-modal-compact {
    padding: 0;
    overflow: hidden;
}

#plagscanx-advanced-modal .psx-modal-header-centered {
    margin: 0;
    padding: 24px 24px 18px;
}

#plagscanx-advanced-modal .psx-modal-body {
    padding: 0 24px 22px;
}

#plagscanx-advanced-modal .psx-modal-footer {
    margin: 0;
    padding: 14px 24px;
    border-top: 1px solid var(--psx-border);
    background: var(--psx-card);
}

.psx-modal-title,
.psx-quota-modal h2,
.psx-share-modal h2 {
    color: var(--psx-popover-foreground);
    font-weight: 600;
}

.psx-modal-subtitle,
.psx-modal-helper,
.quota-modal-message {
    color: var(--psx-muted-foreground);
}

.modal-icon-wrapper,
.psx-quota-modal .quota-modal-icon,
.psx-share-modal .share-modal-icon {
    background: var(--psx-accent);
    color: var(--psx-primary);
}

.quota-usage-panel,
.quota-recommendation-panel {
    border-color: var(--psx-border);
    border-radius: var(--psx-radius-2xl);
    background: var(--psx-muted);
}

.quota-recommendation-panel {
    background: var(--psx-card-foreground);
    color: var(--psx-card);
}

.quota-reset-summary {
    border-color: var(--psx-border);
    color: var(--psx-muted-foreground);
}

.settings-card {
    padding: 16px;
    border: 1px solid var(--psx-border);
    border-radius: var(--psx-radius-3xl);
    background: var(--psx-card);
    box-shadow: none;
}

.settings-card:hover {
    border-color: var(--psx-border);
    background: var(--psx-accent);
    box-shadow: none;
}

.settings-card.active {
    border-color: var(--psx-primary) !important;
    background: color-mix(in srgb, var(--psx-primary) 6%, var(--psx-card)) !important;
    box-shadow: inset 0 0 0 1px var(--psx-primary);
}

.quota-modal-actions .plagscanx-btn-primary,
.quota-modal-actions .plagscanx-btn-secondary,
.share-modal-actions .plagscanx-btn-primary,
.share-modal-actions .plagscanx-btn-secondary {
    border-radius: var(--psx-radius-control) !important;
}

.share-link-field input {
    border-radius: var(--psx-radius-3xl);
    background: var(--psx-muted);
}

.plagscanx-profile-menu {
    padding: 6px !important;
    border: 1px solid var(--psx-border) !important;
    border-radius: var(--psx-radius-3xl) !important;
    background: var(--psx-popover) !important;
    box-shadow: var(--psx-shadow-popover) !important;
    overflow: hidden;
    backdrop-filter: none;
}

.plagscanx-app-header .psx-app-profile {
    padding: 0;
    border-top: 0;
}

.plagscanx-app-header .psx-app-profile-trigger {
    border: 1px solid transparent;
    border-radius: var(--psx-radius-full);
    background: transparent;
}

.plagscanx-app-header .psx-app-profile-trigger:hover {
    border-color: var(--psx-border);
    background: var(--psx-muted);
}

.plagscanx-app-header .psx-app-profile-trigger.open {
    border-color: color-mix(in srgb, var(--psx-primary) 42%, var(--psx-border));
    background: color-mix(in srgb, var(--psx-primary) 8%, var(--psx-popover));
}

.plagscanx-app-header .psx-app-profile-trigger:focus-visible {
    outline-color: var(--psx-ring);
}

.plagscanx-app-header .psx-app-profile .plagscanx-profile-menu {
    overflow-x: hidden !important;
    overflow-y: auto !important;
    scrollbar-width: thin;
    scrollbar-color: var(--psx-border-strong) transparent;
}

.psx-profile-menu-identity {
    border-bottom-color: var(--psx-border);
}

.psx-profile-menu-name {
    color: var(--psx-popover-foreground);
}

.psx-profile-menu-email {
    color: var(--psx-muted-foreground);
}

.plagscanx-header-profile,
#plagscanx-css-trigger-profile {
    color: var(--psx-popover-foreground);
    font-family: inherit;
    line-height: 1.5;
    letter-spacing: 0;
}

.psx-profile-shortcode-host {
    line-height: 0;
}

.psx-profile-shortcode-host > .psx-profile-shortcode-spacer {
    display: none !important;
    margin: 0 !important;
}

.plagscanx-header-profile,
.plagscanx-header-guest {
    display: inline-flex !important;
    align-items: center;
    vertical-align: middle;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1;
}

.plagscanx-header-guest > .plagscanx-btn-signin {
    margin: 0;
}

.plagscanx-header-profile .plagscanx-profile-dropdown {
    line-height: 1.5;
}

.plagscanx-header-profile {
    z-index: 1000 !important;
}

.plagscanx-header-profile .plagscanx-profile-trigger,
.plagscanx-profile-avatar-trigger {
    box-sizing: border-box !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 42px !important;
    min-width: 42px !important;
    height: 42px !important;
    min-height: 42px !important;
    margin: 0 !important;
    padding: 1px !important;
    border: 1px solid transparent !important;
    border-radius: var(--psx-radius-full) !important;
    background: transparent !important;
    box-shadow: none !important;
    color: var(--psx-popover-foreground) !important;
    line-height: 0 !important;
    text-decoration: none !important;
    cursor: pointer !important;
    transition: border-color 120ms ease, background-color 120ms ease, box-shadow 120ms ease !important;
}

.plagscanx-header-profile .plagscanx-profile-trigger:hover,
.plagscanx-profile-avatar-trigger:hover {
    border-color: var(--psx-border) !important;
    background: var(--psx-muted) !important;
}

.plagscanx-header-profile .plagscanx-profile-trigger:is(.is-open, [aria-expanded="true"]),
.plagscanx-profile-avatar-trigger:is(.is-open, [aria-expanded="true"]) {
    border-color: color-mix(in srgb, var(--psx-primary) 42%, var(--psx-border)) !important;
    background: color-mix(in srgb, var(--psx-primary) 8%, var(--psx-popover)) !important;
}

.plagscanx-header-profile .plagscanx-profile-trigger:focus-visible,
.plagscanx-profile-avatar-trigger:focus-visible {
    outline: 2px solid var(--psx-ring) !important;
    outline-offset: 2px !important;
}

.plagscanx-header-profile .profile-avatar-img-small,
.plagscanx-profile-avatar-trigger .profile-avatar-img-small {
    display: block !important;
    width: 38px !important;
    height: 38px !important;
    border: 1px solid var(--psx-border) !important;
    border-radius: var(--psx-radius-full) !important;
    box-shadow: var(--psx-shadow-xs) !important;
    object-fit: cover !important;
    transform: none !important;
}

.plagscanx-profile-dropdown {
    box-sizing: border-box !important;
    right: 0 !important;
    z-index: 1001 !important;
    width: min(300px, calc(100vw - 24px)) !important;
    max-width: calc(100vw - 24px) !important;
    max-height: min(620px, calc(100vh - 24px));
    padding: 0 !important;
    border: 1px solid var(--psx-border) !important;
    border-radius: var(--psx-radius-3xl) !important;
    background: var(--psx-popover) !important;
    box-shadow: var(--psx-shadow-popover) !important;
    color: var(--psx-popover-foreground) !important;
    overflow: hidden auto !important;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--psx-border-strong) transparent;
    backdrop-filter: none;
}

.plagscanx-profile-dropdown::before {
    display: none;
}

#plagscanx-css-trigger-profile {
    width: min(300px, calc(100vw - 24px));
    max-width: calc(100vw - 24px);
}

#plagscanx-css-trigger-profile .plagscanx-profile-dropdown {
    position: relative !important;
    inset: auto !important;
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
}

.plagscanx-profile-dropdown .profile-header {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 14px;
    border-bottom: 1px solid var(--psx-border);
}

.plagscanx-profile-dropdown .profile-avatar-img-large {
    display: block;
    width: 36px;
    height: 36px;
    border: 1px solid var(--psx-border);
    border-radius: var(--psx-radius-full);
    box-shadow: var(--psx-shadow-xs);
    object-fit: cover;
}

.plagscanx-profile-dropdown .profile-user-info {
    min-width: 0;
}

.plagscanx-profile-dropdown .profile-name,
.plagscanx-profile-dropdown .profile-email {
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.plagscanx-profile-dropdown .profile-name {
    color: var(--psx-popover-foreground);
    font-size: 14px;
    font-weight: 500;
    line-height: 20px;
}

.plagscanx-profile-dropdown .profile-email {
    margin: 0;
    color: var(--psx-muted-foreground);
    font-size: 12px;
    font-weight: 400;
    line-height: 16px;
}

.plagscanx-profile-dropdown .plagscanx-upgrade-box-small {
    box-sizing: border-box;
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 32px;
    margin: 0;
    padding: 6px 10px;
    border: 1px solid transparent;
    border-radius: var(--psx-radius-control);
    background: var(--psx-cta);
    box-shadow: none;
    color: var(--psx-primary-foreground);
    font-size: 12px;
    font-weight: 500;
    line-height: 16px;
    text-decoration: none;
    transition: background-color 120ms ease, box-shadow 120ms ease;
}

.plagscanx-profile-dropdown .plagscanx-upgrade-box-small:hover {
    border-color: transparent;
    background: var(--psx-cta-hover);
    box-shadow: none;
    color: var(--psx-primary-foreground);
    transform: none;
}

.plagscanx-profile-dropdown .plagscanx-upgrade-box-small:focus-visible {
    outline: 2px solid var(--psx-ring);
    outline-offset: 2px;
}

.plagscanx-profile-dropdown .upgrade-icon,
.plagscanx-profile-dropdown .upgrade-icon .psx-icon {
    display: inline-flex;
    width: 14px;
    height: 14px;
    color: currentColor;
}

.plagscanx-profile-dropdown .simple-usage-wrapper {
    order: initial;
    gap: 12px;
    margin: 0 !important;
    padding: 14px;
    border: 0;
    border-bottom: 1px solid var(--psx-border);
    border-radius: 0;
    background: color-mix(in srgb, var(--psx-muted) 58%, var(--psx-popover));
    line-height: 1.5;
}

.plagscanx-profile-dropdown .simple-usage-header {
    gap: 12px;
    margin: 0;
}

.plagscanx-profile-dropdown .simple-usage-header .simple-usage-title {
    color: var(--psx-popover-foreground);
    font-size: 13px;
    font-weight: 500;
    line-height: 18px;
}

.plagscanx-profile-dropdown .simple-usage-header .badge {
    max-width: 148px;
    padding: 3px 8px;
    overflow: hidden;
    font-size: 11px;
    line-height: 16px;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.plagscanx-profile-dropdown .simple-pro-usage-details-card {
    gap: 4px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.plagscanx-profile-dropdown .simple-pro-usage-details-card .tool-info,
.plagscanx-profile-dropdown .simple-pro-usage-details-card .stats-row,
.plagscanx-profile-dropdown .simple-pro-usage-details-card .used-val,
.plagscanx-profile-dropdown .simple-pro-usage-details-card .limit-val {
    font-size: 12px;
    line-height: 16px;
}

.plagscanx-profile-dropdown .simple-pro-usage-details-card .tool-info,
.plagscanx-profile-dropdown .simple-pro-usage-details-card .used-val {
    color: var(--psx-popover-foreground);
    font-weight: 500;
}

.plagscanx-profile-dropdown .simple-pro-usage-details-card .stats-row {
    gap: 4px;
    font-variant-numeric: tabular-nums;
}

.plagscanx-profile-dropdown .usage-bar-mini {
    height: 6px;
    border-radius: var(--psx-radius-full);
    background: var(--psx-border);
}

.profile-menu-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.plagscanx-profile-dropdown .profile-menu-list {
    padding: 6px;
}

.profile-menu-list li a {
    box-sizing: border-box;
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-width: 0;
    min-height: 38px;
    padding: 9px 11px;
    border-radius: var(--psx-radius-2xl);
    color: var(--psx-popover-foreground);
    font-size: 13px;
    font-weight: 500;
    line-height: 18px;
    text-decoration: none;
    transition: background-color 120ms ease, color 120ms ease;
}

.profile-menu-list li a:hover,
.profile-menu-list li a:focus-visible {
    outline: none;
    background: var(--psx-muted);
    color: var(--psx-popover-foreground);
}

.profile-menu-list li a .psx-icon {
    flex: 0 0 16px;
    width: 16px;
    height: 16px;
    color: var(--psx-muted-foreground);
}

.profile-menu-list .profile-menu-label {
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.profile-menu-list .menu-divider {
    height: 1px;
    margin: 6px 0;
    background: var(--psx-border);
}

.profile-menu-list li a:is(.logout-link, .logout-item) {
    color: var(--psx-danger);
}

.profile-menu-list li a:is(.logout-link, .logout-item) .psx-icon {
    color: currentColor;
}

.profile-menu-list li a:is(.logout-link, .logout-item):hover,
.profile-menu-list li a:is(.logout-link, .logout-item):focus-visible {
    background: color-mix(in srgb, var(--psx-danger) 9%, var(--psx-popover));
    color: var(--psx-danger);
}

@media (max-width: 360px) {
    .plagscanx-profile-dropdown .profile-header {
        grid-template-columns: 34px minmax(0, 1fr) auto;
        gap: 8px;
        padding: 12px;
    }

    .plagscanx-profile-dropdown .profile-avatar-img-large {
        width: 34px;
        height: 34px;
    }

    .plagscanx-profile-dropdown .plagscanx-upgrade-box-small {
        padding-right: 8px;
        padding-left: 8px;
    }

    .plagscanx-profile-dropdown .simple-usage-wrapper {
        padding: 12px;
    }
}

.plagscanx-toast {
    min-height: 48px;
    padding: 12px 14px;
    border: 1px solid var(--psx-border);
    border-left-width: 1px;
    border-radius: var(--psx-radius-2xl);
    background: var(--psx-popover);
    box-shadow: var(--psx-shadow-popover);
    color: var(--psx-popover-foreground);
    font-size: 13px;
}

.plagscanx-toast.success,
.plagscanx-toast.error,
.plagscanx-toast.info,
.plagscanx-toast.warning {
    border-left-width: 1px;
}

.plagscanx-drawer {
    background: var(--psx-popover);
    box-shadow: var(--psx-shadow-dialog);
}

.plagscanx-drawer .drawer-header,
.plagscanx-drawer .drawer-footer {
    border-color: var(--psx-border);
    background: var(--psx-popover);
}

.plagscanx-drawer .drawer-header h3 {
    color: var(--psx-popover-foreground);
    font-weight: 650;
}

.plagscanx-drawer .drawer-body {
    color: var(--psx-card-foreground);
}

#plagscanx-info-drawer-overlay { z-index: 1000005; backdrop-filter: none; }
#plagscanx-info-drawer { max-height: 100dvh; transition: none; }
#plagscanx-info-drawer.open { animation: psx-info-drawer-enter 200ms ease-out; }
#plagscanx-info-drawer .drawer-header { gap: 16px; flex: 0 0 auto; }
#plagscanx-info-drawer .drawer-header h3 { min-width: 0; overflow-wrap: anywhere; }
#plagscanx-info-drawer .drawer-close { flex-shrink: 0; }
#plagscanx-info-drawer .drawer-body { min-height: 0; overflow-wrap: anywhere; overscroll-behavior: contain; }
#plagscanx-info-drawer .drawer-body img { max-width: 100%; height: auto; }
#plagscanx-info-drawer .drawer-body :is(pre, table) { max-width: 100%; overflow-x: auto; }
#plagscanx-info-drawer .drawer-body a { color: var(--psx-link); text-underline-offset: 3px; }
#plagscanx-info-drawer.is-text-analysis .drawer-footer { display: none; }
@keyframes psx-info-drawer-enter { from { transform: translateX(100%); } to { transform: translateX(0); } }
@media (prefers-reduced-motion: reduce) {
    #plagscanx-info-drawer, #plagscanx-info-drawer.open { animation: none; transition: none; }
}

.plagscanx-lp-widget {
    border: 0;
    background: transparent;
    box-shadow: none;
    color: var(--psx-card-foreground);
}

.plagscanx-lp-widget .lp-widget-card {
    border: 0;
    border-radius: var(--psx-radius-card);
    background: var(--psx-card);
    box-shadow: var(--psx-shadow-soft);
}

.plagscanx-lp-widget .lp-widget-card:has(textarea:focus-visible) {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--psx-ring) 24%, transparent), var(--psx-shadow-soft);
}

.plagscanx-lp-widget .lp-textarea-wrap {
    padding: 24px;
}

.plagscanx-lp-widget textarea {
    min-height: 380px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--psx-card-foreground);
    font-size: 16px;
    font-weight: 400;
    line-height: 1.6;
}

.plagscanx-lp-widget textarea:focus-visible {
    border-color: transparent;
    box-shadow: none;
}

.plagscanx-lp-widget .lp-widget-toolbar {
    border-color: var(--psx-border);
    background: color-mix(in srgb, var(--psx-muted) 48%, var(--psx-card));
}

.plagscanx-lp-widget .lp-word-indicator {
    color: var(--psx-muted-foreground);
    font-weight: 400;
}

.plagscanx-lp-widget .lp-word-count {
    color: var(--psx-card-foreground);
    font-weight: 500;
}

.plagscanx-lp-widget .lp-toolbar-divider {
    background: var(--psx-border);
}

.plagscanx-lp-widget .plagscanx-lp-upload-btn,
.plagscanx-lp-widget .plagscanx-lp-btn-secondary {
    min-height: 36px;
    padding: 0 12px !important;
    border-color: var(--psx-border);
    background: var(--psx-card);
    color: var(--psx-card-foreground);
    font-size: 12px;
    font-weight: 500;
}

.plagscanx-lp-widget .plagscanx-lp-upload-btn:hover:not(:disabled),
.plagscanx-lp-widget .plagscanx-lp-btn-secondary:hover:not(:disabled) {
    border-color: var(--psx-border-strong);
    background: var(--psx-muted);
}

.plagscanx-lp-widget .plagscanx-lp-cta {
    min-height: 40px;
    min-width: 176px;
    padding: 0 18px;
    border-radius: var(--psx-radius-control) !important;
    background: var(--psx-cta) !important;
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
}

.plagscanx-lp-widget .plagscanx-lp-cta:hover:not(:disabled) {
    background: var(--psx-cta-hover) !important;
    color: #ffffff;
}

.plagscanx-lp-widget .plagscanx-lp-cta:disabled {
    border-color: var(--psx-disabled-border) !important;
    background: var(--psx-disabled-bg) !important;
    box-shadow: none;
    color: var(--psx-disabled-foreground) !important;
    opacity: 1;
}

.plagscanx-lp-widget .plagscanx-lp-upload-btn .psx-icon,
.plagscanx-lp-widget .plagscanx-lp-btn-secondary .psx-icon,
.plagscanx-lp-widget .plagscanx-lp-cta .psx-icon {
    width: 16px;
    height: 16px;
    margin: 0;
    stroke-width: 2;
}

.plagscanx-login-page-container {
    position: fixed;
    inset: 0;
    z-index: 99999;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    min-height: 100vh;
    margin: 0;
    padding: 24px;
    border-radius: 0;
    background: var(--psx-canvas);
}

.plagscanx-login-page-container *,
.plagscanx-login-page-container *::before,
.plagscanx-login-page-container *::after {
    box-sizing: border-box;
}

.plagscanx-login-card {
    width: min(440px, calc(100% - 48px));
    padding: 40px 30px;
    border: 0;
    border-radius: var(--psx-radius-dialog);
    background: var(--psx-card);
    box-shadow: var(--psx-shadow-dialog);
    text-align: center;
}

.plagscanx-login-card .plagscanx-modal-header {
    margin: 0;
}

.plagscanx-login-card .modal-icon-wrapper {
    width: 48px;
    height: 48px;
    margin: 0 auto 20px;
    border-radius: var(--psx-radius-full);
    background: color-mix(in srgb, var(--psx-primary) 10%, transparent);
    color: var(--psx-primary);
}

.plagscanx-login-card h2 {
    margin: 0 0 10px;
    font-size: 22px;
    font-weight: 600;
}

.plagscanx-login-card .plagscanx-modal-header p {
    margin: 0 0 30px;
    color: var(--psx-muted-foreground);
    font-size: 15px;
    line-height: 1.5;
}

.plagscanx-login-card .plagscanx-modal-body {
    padding: 0;
    margin: 0;
}

.plagscanx-login-card .g_id_signin,
.plagscanx-login-card .g_id_signin > div,
.plagscanx-login-card .g_id_signin iframe {
    width: 100% !important;
}

.plagscanx-login-card .plagscanx-modal-footer {
    margin-top: 25px;
    padding: 0;
    border-top: 0;
}

.plagscanx-login-card .plagscanx-modal-footer p {
    margin: 0;
    color: var(--psx-muted-foreground);
    font-size: 11px;
    line-height: 1.5;
}

.plagscanx-app-overlay * {
    scrollbar-color: var(--psx-border-strong) transparent;
    scrollbar-width: thin;
}

.plagscanx-app-overlay *::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.plagscanx-app-overlay *::-webkit-scrollbar-thumb {
    border: 2px solid transparent;
    border-radius: var(--psx-radius-control);
    background: var(--psx-border-strong);
    background-clip: padding-box;
}

@media (max-width: 1200px) and (min-width: 901px) {
    .plagscanx-sidebar-left {
        width: 230px;
    }

    .plagscanx-sidebar-right {
        width: 290px;
    }

    .plagscanx-editor-container {
        padding-right: 16px;
        padding-left: 16px;
    }

    #view-text .plagscanx-editor-container,
    #view-ai_detect .plagscanx-editor-container {
        padding: 0;
    }

    .plagscanx-app-header {
        padding-right: 12px;
        padding-left: 12px;
    }

    .header-right {
        gap: 6px;
    }

    .header-right .desktop-label,
    .header-action-btn .btn-text,
    .header-share-btn .btn-text {
        display: none;
    }

    .header-divider {
        display: none;
    }

    .header-action-btn,
    .header-share-btn {
        width: 34px;
        min-width: 34px;
        height: 34px;
        min-height: 34px;
        padding: 0 !important;
    }

    .plagscanx-editor-toolbar,
    .rewriter-toolbar {
        flex-wrap: nowrap;
        align-items: center;
        gap: 6px;
        padding: 8px;
    }

    .toolbar-left,
    .rewriter-toolbar-left,
    .toolbar-right,
    .rewriter-toolbar-right {
        width: auto;
        min-width: 0;
    }

    .toolbar-left,
    .rewriter-toolbar-left {
        flex: 1 1 auto;
        flex-wrap: nowrap;
        gap: 6px;
    }

    .toolbar-left .counter-item,
    .rewriter-toolbar-left .counter-item {
        flex: 1 1 auto;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .toolbar-right,
    .rewriter-toolbar-right {
        flex: 0 0 auto;
        gap: 6px;
        justify-content: flex-end;
    }

    .plagscanx-editor-toolbar .toolbar-left > .toolbar-item:nth-child(2) {
        margin-left: 0;
        padding-left: 0;
        border-left: 0;
    }

    .plagscanx-editor-toolbar .toolbar-compact-label,
    .rewriter-toolbar .toolbar-compact-label,
    .rewriter-toolbar .select-chevron {
        display: none;
    }

    .plagscanx-editor-toolbar .plagscanx-btn-upload,
    .plagscanx-editor-toolbar .plagscanx-btn-secondary,
    .rewriter-toolbar .plagscanx-btn-secondary,
    .rewriter-toolbar .plagscanx-select-btn {
        width: 32px;
        min-width: 32px;
        height: 32px;
        min-height: 32px;
        flex: 0 0 32px;
        justify-content: center;
        gap: 0;
        margin-right: 0 !important;
        padding: 0 !important;
    }
}

@media (max-width: 1120px) and (min-width: 901px) {
    .rewriter-grid {
        height: auto;
        min-height: auto;
        flex: 0 0 auto;
        flex-direction: column;
    }

    .rewriter-panel {
        flex: 0 0 auto;
        min-height: 440px;
    }
}

@media (max-width: 900px) {
    .header-usage-text {
        font-size: 11px;
    }

    .header-usage-full {
        display: none;
    }

    .header-usage-compact {
        display: inline;
    }

    .plagscanx-app-container {
        gap: 0;
        padding: 0;
        background: var(--psx-background);
    }

    .plagscanx-main,
    .plagscanx-sidebar-right {
        height: auto;
        border: 0;
        border-radius: 0;
        box-shadow: none;
        padding-bottom: 0;
    }

    .plagscanx-sidebar-right {
        width: 100%;
        min-height: 360px;
        padding: 20px 16px;
        border-top: 1px solid var(--psx-border);
        background: var(--psx-sidebar);
    }


    .plagscanx-app-header {
        height: 48px;
        min-height: 48px;
        flex: 0 0 48px;
        padding: 0 14px;
        border-radius: 0;
        background: var(--psx-card);
    }

    .header-left h2 {
        font-size: 14px;
    }

    .header-info-icon {
        display: inline-flex;
        width: 28px;
        height: 28px;
        padding: 0;
    }

    .plagscanx-editor-container {
        padding: 16px;
    }

    #view-text .plagscanx-editor-container,
    #view-ai_detect .plagscanx-editor-container {
        padding: 0;
    }

    .rewriter-panel {
        border-radius: var(--psx-radius-card);
    }

    .plagscanx-input-card {
        min-height: 380px;
        height: auto;
        border-radius: 0;
    }

    .rewriter-grid {
        gap: 12px;
        min-height: auto;
        height: auto;
        flex: 0 0 auto;
    }

    .rewriter-panel {
        flex: 0 0 auto;
        min-height: 440px;
    }

    .rewriter-toolbar {
        min-height: 0;
    }

    #plagscanx-text,
    #plagscanx-ai-text,
    #psx-new-text {
        padding: 20px 16px;
    }

    .plagscanx-editor-toolbar,
    .rewriter-toolbar {
        padding: 11px 12px 13px;
    }

    .history-container,
    .settings-container,
    .library-container {
        padding: 24px 16px 28px !important;
    }


    .plagscanx-modal-content {
        padding: 24px 18px;
        border-radius: var(--psx-radius-dialog);
    }

    #plagscanx-quota-modal .psx-quota-modal,
    #plagscanx-pro-feature-modal .psx-pro-feature-modal,
    #plagscanx-confirm-modal .psx-confirm-modal,
    #plagscanx-share-modal .psx-share-modal {
        padding: 24px 18px calc(18px + env(safe-area-inset-bottom));
        border-radius: var(--psx-radius-dialog) var(--psx-radius-dialog) 0 0;
    }

    .plagscanx-pricing-wrapper {
        padding: 26px 16px 32px;
    }

    .plagscanx-pricing-grid {
        gap: 14px;
    }
}

@media (max-width: 640px) {
    .plagscanx-app-header {
        gap: 6px;
    }

    .header-right {
        gap: 6px;
    }

    .header-action-btn,
    .header-share-btn {
        width: 34px;
        min-width: 34px;
        height: 34px;
        min-height: 34px;
        padding: 0 !important;
    }

    .plagscanx-editor-toolbar,
    .rewriter-toolbar {
        gap: 8px;
    }

    .toolbar-left .toolbar-item:not(.counter-item) {
        flex-basis: 132px;
    }

    #view-text .toolbar-left .toolbar-item:not(.counter-item) {
        min-width: 0;
        flex: 1 1 0;
    }

    #view-text .toolbar-left .plagscanx-btn-upload {
        width: 100%;
    }

    .toolbar-left .plagscanx-btn-upload,
    .toolbar-right .plagscanx-btn-primary,
    .toolbar-right .plagscanx-btn-secondary,
    .rewriter-toolbar-right .plagscanx-btn-primary,
    .rewriter-toolbar-right .plagscanx-btn-secondary,
    .plagscanx-lp-cta,
    .plagscanx-lp-btn-secondary,
    .pricing-cta-btn {
        height: auto;
        min-height: 38px;
        padding-top: 8px !important;
        padding-bottom: 8px !important;
        line-height: 1.2;
        overflow-wrap: anywhere;
        white-space: normal;
    }

    .toolbar-left .plagscanx-btn-upload span {
        min-width: 0;
        overflow-wrap: anywhere;
        white-space: normal;
    }

    .plagscanx-select-btn {
        min-width: 0;
    }

    .settings-card-grid.grid-2,
    .settings-card-grid.grid-3,
    .library-quota-stats-grid {
        grid-template-columns: 1fr;
    }

    .usage-details-grid {
        padding: 0 14px;
    }

    .usage-detail-card {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .usage-detail-card .stats-row {
        justify-content: flex-start;
    }

    .history-card-header {
        flex-direction: column;
    }

    .history-date {
        white-space: normal;
    }

    .history-word-count {
        display: none;
    }

    .plagscanx-addon-banner {
        padding: 18px;
    }

    .plagscanx-toast-container {
        right: 12px;
        left: 12px;
        width: auto;
    }

    .plagscanx-toast {
        width: 100%;
    }
}

@media (max-height: 760px) and (min-width: 901px) {
    .plagscanx-nav li {
        min-height: 32px;
        padding-top: 6px;
        padding-bottom: 6px;
    }

    .plagscanx-nav-divider {
        margin-top: 6px;
        margin-bottom: 6px;
    }

    .plagscanx-usage-widget {
        gap: 10px;
        padding: 12px;
    }

    .simple-usage-wrapper {
        gap: 8px;
    }

    .plagscanx-profile-section {
        padding-top: 6px;
        padding-bottom: 6px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .plagscanx-app-overlay *,
    .plagscanx-lp-widget * {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Keep the pricing comparison authoritative over legacy component rules above. */
#view-pricing .plagscanx-pricing-wrapper {
    display: block;
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    padding: 56px 48px 80px;
}

#view-pricing .plagscanx-pricing-header {
    margin: 0 0 48px;
    text-align: left;
}

#view-pricing .plagscanx-pricing-header h1 {
    margin: 0;
    font-size: 48px;
    font-weight: 700;
    line-height: 1.08;
}

#view-pricing .plagscanx-pricing-card {
    min-height: 510px;
    padding: 26px 22px;
    border: 0;
    border-radius: 0;
    background: var(--psx-card);
    box-shadow: none;
}

#view-pricing .pricing-card-cluster .plagscanx-pricing-card + .plagscanx-pricing-card {
    border-left: 1px solid var(--psx-border-strong);
}

#view-pricing .plagscanx-pricing-card:hover,
#view-pricing .plagscanx-pricing-card.highlighted,
#view-pricing .plagscanx-pricing-card.highlighted:hover {
    background: color-mix(in srgb, var(--psx-primary) 3%, var(--psx-card));
    box-shadow: none;
    transform: none;
}

#view-pricing .plagscanx-pricing-card.highlighted,
#view-pricing .plagscanx-pricing-card.highlighted:hover {
    box-shadow: inset 0 3px 0 var(--psx-primary);
}

#view-pricing .pricing-one-time-group .plagscanx-pricing-card {
    height: 100%;
    border: 1px solid var(--psx-border-strong);
    border-radius: var(--psx-radius-lg);
    background: var(--psx-muted);
}

#view-pricing .pricing-card-header {
    min-height: 176px;
    margin: 0;
    padding: 0;
    border: 0;
}

#view-pricing .pricing-card-header h3 {
    margin: 0;
    font-size: 19px;
    font-weight: 600;
}

#view-pricing .price-amount {
    font-size: 32px;
    font-weight: 700;
}

#view-pricing .plagscanx-addon-banner {
    border: 1px solid color-mix(in srgb, var(--psx-primary) 22%, var(--psx-border));
    border-radius: var(--psx-radius-lg);
    background: color-mix(in srgb, var(--psx-primary) 6%, var(--psx-card));
    box-shadow: none;
}

@media (max-width: 1180px) {
    #view-pricing .plagscanx-pricing-wrapper {
        padding-right: 30px;
        padding-left: 30px;
    }

    #view-pricing .pricing-one-time-group .plagscanx-pricing-card {
        min-height: 0;
    }
}

@media (max-width: 820px) {
    #view-pricing .plagscanx-pricing-wrapper {
        padding: 36px 20px 56px;
    }

    #view-pricing .plagscanx-pricing-header {
        margin-bottom: 36px;
    }

    #view-pricing .plagscanx-pricing-header h1 {
        font-size: 36px;
    }

    #view-pricing .pricing-card-cluster .plagscanx-pricing-card,
    #view-pricing .pricing-card-cluster .plagscanx-pricing-card + .plagscanx-pricing-card {
        border: 1px solid var(--psx-border-strong);
        border-radius: var(--psx-radius-lg);
    }
}

@media (max-width: 560px) {
    #view-pricing .plagscanx-pricing-wrapper {
        padding: 28px 16px 44px;
    }

    #view-pricing .plagscanx-pricing-header h1 {
        font-size: 32px;
    }

    #view-pricing .plagscanx-pricing-card {
        min-height: 0;
        padding: 24px 20px;
    }

    #view-pricing .pricing-card-header {
        min-height: 0;
    }
}
