/* 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 {
    --psx-mobile-tab-space: calc(78px + env(safe-area-inset-bottom, 0px));
    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;
    border: 0;
    border-right: 1px solid var(--psx-border);
    overflow: hidden;
}

.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,
.mobile-header-left .custom-logo-link {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
}

.plagscanx-brand img,
.mobile-header-left 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: var(--psx-muted-foreground);
    stroke-width: 2;
}

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

.plagscanx-nav li .psx-crown-icon {
    width: 13px;
    height: 13px;
    margin-left: auto !important;
}

.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,
.mobile-profile-trigger,
.mobile-profile-trigger 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,
.mobile-more-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,
.mobile-more-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,
.mobile-more-close .psx-icon,
.plagscanx-drawer .drawer-close .psx-icon {
    width: 16px;
    height: 16px;
}

.header-right {
    gap: 12px;
}

.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,
.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 {
    padding: 24px;
}

#plagscanx-text::placeholder,
#plagscanx-ai-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);
}

.header-share-btn {
    border-color: transparent;
    background: transparent;
}

.header-share-btn:hover:not(:disabled) {
    border-color: transparent;
}

.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-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);
}

.plagscanx-toggle-container {
    width: 36px;
    height: 20px;
}

.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;
    width: 16px;
    height: 16px;
    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);
}

input:checked + .toggle-slider::before {
    transform: translateX(16px);
}

.plagscanx-toggle-container.large {
    width: 36px;
    height: 20px;
}

.plagscanx-toggle-container.large .toggle-slider::before {
    top: 0;
    left: 0;
    width: 16px;
    height: 16px;
}

.plagscanx-toggle-container.large input:checked + .toggle-slider::before {
    transform: translateX(16px);
}

.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,
.mobile-more-close:focus-visible,
.plagscanx-drawer .drawer-close:focus-visible,
.mobile-tab: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;
}

#plagscanx-results,
#ai-results {
    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 */
#plagscanx-results {
    --plag-result-color: var(--psx-risk-safe);
    --plag-result-tint: #dcfce7;
}

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

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

#plagscanx-results.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-score-gauge {
    position: relative;
    width: min(100%, 208px);
    height: 112px;
    margin: 0 auto;
}

.plagiarism-gauge-svg {
    display: block;
    width: 100%;
    height: auto;
    overflow: visible;
}

.plagiarism-gauge-track,
.plagiarism-gauge-fill {
    fill: none;
    stroke-width: 10;
    stroke-linecap: round;
    vector-effect: non-scaling-stroke;
}

.plagiarism-gauge-track {
    stroke: color-mix(in srgb, var(--psx-border) 82%, var(--psx-card));
}

.plagiarism-gauge-fill {
    stroke: var(--plag-result-color);
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
    transition: stroke-dashoffset 320ms ease, stroke 200ms ease;
}

.plagiarism-gauge-readout {
    position: absolute;
    top: 45px;
    right: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.plagiarism-gauge-readout .big-score {
    margin: 0;
    color: var(--psx-card-foreground);
    font-size: 40px;
    font-weight: 600;
    line-height: .95;
}

.plagiarism-gauge-readout .score-label {
    margin-top: 5px;
    color: var(--psx-muted-foreground);
    font-size: 12px;
    font-weight: 400;
    line-height: 16px;
    text-transform: none;
}

.plagiarism-result-status {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin-top: 4px;
}

#plagscanx-results #risk-badge {
    display: inline-flex;
    min-height: 24px;
    align-items: center;
    padding: 3px 10px;
    border-radius: var(--psx-radius-3xl);
    font-size: 12px;
    font-weight: 600;
    line-height: 18px;
}

#plagscanx-results #risk-badge {
    background: var(--plag-result-tint);
    color: var(--plag-result-color);
}

.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: 3px 0 0;
    color: var(--psx-muted-foreground);
    font-size: 11px;
}

.plagiarism-distribution {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid var(--psx-border);
}

.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-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;
}

#plagscanx-results .sources-header {
    align-items: flex-start;
    margin: 0;
    padding: 22px 0 12px;
    border-bottom: 0;
}

#plagscanx-results .sources-header h4,
#plagscanx-results .sources-header p {
    margin: 0;
}

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

#plagscanx-results .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;
}

#plagscanx-results .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;
}

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

#plagscanx-results .result-item.is-active {
    border-color: color-mix(in srgb, var(--psx-primary) 55%, var(--psx-border));
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--psx-primary) 12%, transparent);
}

.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 {
    margin: 9px 0 0;
    color: var(--psx-card-foreground);
    font-size: 13px;
    font-weight: 600;
    line-height: 18px;
    overflow-wrap: anywhere;
}

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

.source-focus-button {
    display: inline-flex;
    min-height: 36px;
    align-items: center;
    gap: 5px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--psx-link);
    font: inherit;
    font-size: 12px;
    font-weight: 500;
    line-height: 16px;
    text-align: left;
    cursor: pointer;
}

.source-focus-button .psx-icon {
    width: 13px;
    height: 13px;
}

.source-focus-button:hover,
.source-focus-button:focus-visible,
.source-focus-button[aria-pressed="true"] {
    color: color-mix(in srgb, var(--psx-link) 78%, #000);
}

.source-focus-button:focus-visible,
.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;
}

#plagscanx-results .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);
}

#plagscanx-results .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,
    #plagscanx-results .result-item {
        transition: none;
    }
}

.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,
.mobile-more-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;
}

.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);
}

#plagscanx-search-depth-modal .psx-search-depth-modal {
    padding: 0;
    overflow: hidden;
}

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

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

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

.search-depth-option {
    border-color: var(--psx-border);
    background: var(--psx-card);
    color: var(--psx-card-foreground);
    box-shadow: none;
}

.search-depth-option:hover {
    border-color: var(--psx-border-strong);
    background: var(--psx-accent);
}

.search-depth-option.active {
    border-color: var(--psx-primary);
    background: color-mix(in srgb, var(--psx-primary) 6%, var(--psx-card));
}

.search-depth-option-icon,
.search-depth-badge {
    background: var(--psx-muted);
}

.search-depth-option-copy > span,
.search-depth-badge {
    color: var(--psx-muted-foreground);
}

.search-depth-option.active .search-depth-option-icon,
.search-depth-badge.is-recommended,
.search-depth-badge.is-paid {
    background: color-mix(in srgb, var(--psx-primary) 10%, var(--psx-card));
    color: var(--psx-primary);
}

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

.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(336px, 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(336px, 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,
.mobile-more-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-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-min-label {
    color: var(--psx-muted-foreground);
}

.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 0 var(--psx-mobile-tab-space);
        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-mobile-header {
        min-height: 48px;
        padding: 8px 16px;
        border-bottom: 1px solid var(--psx-border);
        background: var(--psx-card);
    }

    .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 {
        padding: 20px 16px;
    }

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

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

    .plagscanx-mobile-tabs {
        right: 0;
        bottom: 0;
        left: 0;
        height: var(--psx-mobile-tab-space);
        padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px));
        border: 0;
        border-top: 1px solid var(--psx-border);
        border-radius: 0;
        background: var(--psx-card);
        box-shadow: 0 -4px 12px rgb(0 0 0 / 0.04);
    }

    .mobile-tab {
        min-width: 0;
        padding: 5px 2px;
        border-radius: var(--psx-radius-2xl);
        color: var(--psx-muted-foreground);
    }

    .mobile-tab.active {
        background: var(--psx-accent);
        color: var(--psx-accent-foreground);
    }

    .mobile-tab.active::before {
        display: none;
    }

    .mobile-tab .psx-icon {
        width: 18px;
        height: 18px;
    }

    .mobile-tab-label {
        max-width: 100%;
        overflow: hidden;
        font-size: 9px;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .mobile-more-overlay {
        padding: 8px;
    }

    .mobile-more-panel {
        width: 100%;
        margin-bottom: max(0px, env(safe-area-inset-bottom, 0px));
        padding-bottom: 8px;
        border: 0;
        border-radius: var(--psx-radius-card);
        background: var(--psx-popover);
        box-shadow: var(--psx-shadow-dialog);
    }

    .mobile-more-list li a {
        border-radius: var(--psx-radius-2xl);
    }

    .mobile-more-list li a:hover {
        background: var(--psx-muted);
    }

    .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%;
    }

    .search-depth-option {
        grid-template-columns: 34px minmax(0, 1fr);
        gap: 10px;
        padding: 12px;
    }

    .search-depth-option-icon {
        width: 34px;
        height: 34px;
    }

    .search-depth-option-state {
        grid-column: 2;
        justify-self: start;
    }

    .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;
    }
}
