/* Modern Settings Page CSS */
.settings-container *,
.settings-container *::before,
.settings-container *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--browser-ui-font, 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Open Sans', sans-serif);
    -webkit-font-smoothing: subpixel-antialiased;
    -moz-osx-font-smoothing: auto;
}

.settings-container i.fas::before,
.settings-container i.far::before,
.settings-container i.fa-solid::before,
.settings-container i.fa-regular::before,
.settings-container i[class*="fa-"]::before {
    font-family: "Font Awesome 6 Free", "Font Awesome 5 Free" !important;
    font-weight: 900;
}

.settings-container i.fab::before {
    font-family: "Font Awesome 6 Brands", "Font Awesome 5 Brands" !important;
    font-weight: 400;
}

button,
input,
.settings-container select,
textarea,
.setting-input,
.settings-select,
.btn,
label,
span,
p,
h1,
h2,
h3,
a,
li {
    font-family: inherit;
    -webkit-font-smoothing: subpixel-antialiased;
    -moz-osx-font-smoothing: auto;
    text-rendering: optimizeLegibility;
}

/* GLOBAL SELECT ARROW REMOVAL - REMOVES ALL DEFAULT ARROWS */
.settings-container select,
.settings-container select *,
.settings-container select option,
.settings-container select optgroup {
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    background-image: none !important;
    background: none !important;
}

/* Remove webkit arrows globally */
.settings-container select::-webkit-outer-spin-button,
.settings-container select::-webkit-inner-spin-button {
    -webkit-appearance: none !important;
    margin: 0 !important;
}

/* Remove IE/Edge arrows globally */
.settings-container select::-ms-expand {
    display: none !important;
}

/* Remove Firefox arrows globally */
.settings-container select::-moz-focus-inner {
    border: 0 !important;
}

/* NUCLEAR OPTION - Force remove ALL arrows from ALL elements */
.settings-container select,
.settings-container select *,
.settings-container select option,
.settings-container select optgroup,
.settings-container select::-webkit-outer-spin-button,
.settings-container select::-webkit-inner-spin-button,
.settings-container select::-ms-expand,
.settings-container select::-moz-focus-inner {
    background-image: none !important;
    background: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
}

/* Additional aggressive removal for specific browsers */
.settings-container select {
    background-image: none !important;
    background: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
}

/* NUCLEAR BOMB - Target the specific dropdown showing 4 arrows */
.settings-container select[data-theme="light"],
.settings-container select[data-theme="light"] *,
.settings-container select[data-theme="light"] option,
.settings-container select[data-theme="light"] optgroup {
    background-image: none !important;
    background: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
}

/* Force remove any remaining arrows from light theme selects */
[data-theme="light"] .settings-container select {
    background-image: none !important;
    background: none !important;
}

/* ATOMIC BOMB - Remove ALL arrows from ALL elements in ALL themes */
.settings-container select,
.settings-container select *,
.settings-container select option,
.settings-container select optgroup,
.settings-container select::-webkit-outer-spin-button,
.settings-container select::-webkit-inner-spin-button,
.settings-container select::-ms-expand,
.settings-container select::-moz-focus-inner,
[data-theme="light"] .settings-container select,
[data-theme="light"] .settings-container select *,
[data-theme="light"] .settings-container select option,
[data-theme="light"] .settings-container select optgroup {
    background-image: none !important;
    background: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
}

/* Force remove any remaining browser defaults */
.settings-container select {
    background-image: none !important;
    background: none !important;
}

html {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--browser-ui-font, 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Open Sans', sans-serif);
    background: #0a0a0f;
    color: #ffffff;
    line-height: 1.4;
    overflow: hidden;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    min-width: 100%;
    min-height: 100%;
    font-size: 12px;
    color-scheme: dark;
    -webkit-font-smoothing: subpixel-antialiased;
    -moz-osx-font-smoothing: auto;
    text-rendering: optimizeLegibility;
    font-kerning: normal;
    font-synthesis: none;
}

.font-picker-item {
    align-items: flex-start;
}

.font-picker {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: min(320px, 100%);
    flex-shrink: 0;
}

.font-picker-filter {
    width: 100%;
}

.font-picker-list {
    width: 100%;
    min-height: 160px;
    max-height: 220px;
    padding: 4px;
    overflow-y: auto;
    overflow-x: hidden;
    display: block;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #ffffff;
    outline: none;
    background-image: none !important;
}

.font-picker-list:focus {
    border-color: #5a0dd6;
    box-shadow: 0 0 0 2px rgba(90, 13, 214, 0.2);
}

.font-picker-option {
    appearance: none;
    -webkit-appearance: none;
    display: block;
    box-sizing: border-box;
    width: 100%;
    min-height: 28px;
    height: auto;
    margin: 0 0 2px;
    padding: 6px 10px;
    border: none;
    background: transparent;
    color: #f3f3f7;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
    text-align: left;
    cursor: pointer;
    border-radius: var(--stealth-cut-sm);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: none;
}

.font-picker-option:hover,
.font-picker-option:focus {
    outline: none;
    background: rgba(90, 13, 214, 0.22);
    color: #ffffff;
}

.font-picker-option[aria-selected="true"] {
    background: linear-gradient(135deg, #5a0dd6, #4900c2);
    color: #ffffff;
}

.font-preview {
    width: 100%;
    padding: 10px 12px;
    border-radius: var(--stealth-cut);
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: #101018;
    color: #e4e4e7;
    font-size: 13px;
    line-height: 1.45;
    word-break: break-word;
}

[data-theme="light"] .font-picker-list {
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.2);
    color: #1e293b;
}

[data-theme="light"] .font-picker-list:focus {
    border-color: #5a0dd6;
    box-shadow: 0 0 0 2px rgba(90, 13, 214, 0.2);
}

[data-theme="light"] .font-picker-option {
    color: #1e293b;
}

[data-theme="light"] .font-picker-option:hover,
[data-theme="light"] .font-picker-option:focus {
    background: rgba(90, 13, 214, 0.12);
    color: #1e293b;
}

[data-theme="light"] .font-picker-option[aria-selected="true"] {
    background: linear-gradient(135deg, #5a0dd6, #4900c2);
    color: #ffffff;
}

[data-theme="light"] .font-preview {
    background: #f4f1ea;
    border-color: #c9c3b8;
    color: #1c1916;
}

html,
html[data-theme="dark"],
html[data-theme="stealth"],
html[data-theme="stealth-glass"],
html[data-theme="stealth-float"],
body[data-theme="dark"],
body[data-theme="stealth"],
body[data-theme="stealth-glass"],
body[data-theme="stealth-float"] {
    color-scheme: dark;
}

html[data-theme="light"],
body[data-theme="light"],
[data-theme="light"] body {
    color-scheme: light;
}

/* Theme-matched radio controls (native radios render bright white on dark pages) */
input[type="radio"] {
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    width: 16px;
    height: 16px;
    margin: 0;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.28);
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.45);
    cursor: pointer;
    vertical-align: middle;
    position: relative;
    transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

input[type="radio"]:hover {
    border-color: rgba(255, 255, 255, 0.45);
    background: rgba(0, 0, 0, 0.7);
}

input[type="radio"]:focus-visible {
    outline: 2px solid rgba(167, 139, 250, 0.7);
    outline-offset: 2px;
}

input[type="radio"]:checked {
    border-color: #7c3aed;
    background: rgba(124, 58, 237, 0.22);
    box-shadow: inset 0 0 0 1px rgba(124, 58, 237, 0.35);
}

input[type="radio"]:checked::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #a78bfa;
    transform: translate(-50%, -50%);
}

input[type="radio"]:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

[data-theme="light"] input[type="radio"] {
    border-color: rgba(0, 0, 0, 0.28);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
}

[data-theme="light"] input[type="radio"]:hover {
    border-color: rgba(0, 0, 0, 0.42);
    background: #ffffff;
}

[data-theme="light"] input[type="radio"]:checked {
    border-color: #7c3aed;
    background: rgba(124, 58, 237, 0.12);
    box-shadow: inset 0 0 0 1px rgba(124, 58, 237, 0.2);
}

[data-theme="light"] input[type="radio"]:checked::after {
    background: #7c3aed;
}

/* Theme variants moved to separate CSS files under ui/themes/ */

.settings-container {
    display: flex;
    width: 100%;
    height: 100%;
    min-width: 100%;
    min-height: 100%;
    background: linear-gradient(135deg, #0a0a0f 0%, #1a1a2e 100%);
    overflow: hidden;
    container-type: inline-size;
    container-name: settings-shell;
    /* Keep the shell under Stealth Buddy / overlays (top-layer + z-index). */
    position: relative;
    z-index: 0;
}

[data-theme="light"] body {
    background: #d4cec4;
    color: #1a1714;
}

[data-theme="light"] .settings-container {
    background: #d4cec4 !important;
    color: #1a1714 !important;
}

/* Stealth Float Settings is a content page: opaque shell only, never acrylic key. */
[data-theme="stealth-float"] html,
[data-theme="stealth-float"] body {
    background: #0b0c10 !important;
    color: #f2f4f8 !important;
}
[data-theme="stealth-float"] body,
[data-theme="stealth-float"] .settings-container {
    background: #0b0c10 !important;
    color: #f2f4f8 !important;
}
[data-theme="stealth-float"] .settings-nav {
    background: #12141c !important;
    border-right-color: rgba(255, 255, 255, 0.1) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}
[data-theme="stealth-float"] .settings-content {
    background: #0b0c10 !important;
    color: #f2f4f8 !important;
}
[data-theme="stealth-float"] .settings-section {
    background: #161822 !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    margin-bottom: 10px !important;
}
[data-theme="stealth-float"] .memory-usage-container {
    background: #161822 !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}
[data-theme="stealth-float"] .settings-section h3,
[data-theme="stealth-float"] .page-header h2 {
    color: #c4b5fd !important;
}
[data-theme="stealth-float"] .page-header p,
[data-theme="stealth-float"] .settings-section > .section-description {
    color: #a8b0c0 !important;
}

[data-theme="stealth"] .settings-container {
    background: radial-gradient(1200px 800px at 50% -200px, #1a1228 0%, #0e0a16 60%, #07050b 100%) !important;
    color: #eae2ff !important;
}

/* Settings / bookmarks / plugins render in the CONTENT browser, which is not
   a layered DWM color-key surface. Never use the glass key color (#010103) or
   transparent panels here; that shows the acrylic host under the page. */
[data-theme="stealth-glass"] html,
[data-theme="stealth-glass"] body {
    background: #12101a !important;
    color: #f2f4f8 !important;
}

[data-theme="stealth-glass"] .settings-container {
    background: #12101a !important;
    background-image: none !important;
    color: #f2f4f8 !important;
}

[data-theme="stealth-glass"] .settings-nav {
    background: #1a1824 !important;
    border-right-color: rgba(255, 255, 255, 0.12) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

[data-theme="stealth-glass"] .settings-content {
    background: #12101a !important;
    color: #f2f4f8 !important;
}

[data-theme="stealth-glass"] .settings-section {
    background: #1e1c28 !important;
    border-color: rgba(255, 255, 255, 0.14) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

[data-theme="stealth-glass"] .memory-usage-container {
    background: #1e1c28 !important;
    border-color: rgba(255, 255, 255, 0.14) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

/* Modern Sidebar Navigation */
.settings-nav {
    width: 220px;
    flex-shrink: 0;
    background: #161620;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    padding: 12px 0;
    position: sticky;
    top: 0;
    align-self: flex-start;
    height: 100%;
    max-height: 100%;
    overflow-y: auto;
    z-index: 1;
    -webkit-user-select: none;
    user-select: none;
}

.settings-nav input,
.settings-nav textarea {
    -webkit-user-select: text;
    user-select: text;
}

.settings-mobile-bar,
.settings-nav-backdrop {
    display: none;
}

.settings-mobile-bar {
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: #161620;
    flex: 0 0 auto;
    min-height: 44px;
    box-sizing: border-box;
}

.settings-mobile-title {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex: 1 1 auto;
}

.settings-mobile-title h1 {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    line-height: 1.2;
    color: #c4b5fd;
    margin: 0;
}

.settings-mobile-menu-btn,
.settings-mobile-back-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 36px;
    min-height: 36px;
    padding: 0 8px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.04);
    color: #e4e4e7;
    cursor: pointer;
    flex-shrink: 0;
}

.settings-mobile-menu-btn:hover,
.settings-mobile-back-btn:hover {
    background: rgba(73, 0, 194, 0.28);
    border-color: rgba(73, 0, 194, 0.7);
    color: #ffffff;
}

.settings-mobile-back-btn {
    border-color: rgba(73, 0, 194, 0.45);
    background: rgba(73, 0, 194, 0.22);
    color: #ffffff;
    font-size: 11px;
}

.settings-nav-backdrop {
    position: absolute;
    top: var(--settings-mobile-bar-h, 44px);
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 20;
    border: none;
    padding: 0;
    margin: 0;
}

[data-theme="light"] .settings-mobile-bar {
    background: #e5dfd5;
    border-bottom-color: #a89f90;
}

[data-theme="light"] .settings-mobile-title h1 {
    color: #4900c2;
}

[data-theme="light"] .settings-mobile-menu-btn {
    background: rgba(73, 0, 194, 0.08);
    border-color: rgba(73, 0, 194, 0.3);
    color: #4900c2;
}

[data-theme="light"] .settings-mobile-back-btn {
    color: #4900c2;
    background: rgba(73, 0, 194, 0.08);
    border-color: rgba(73, 0, 194, 0.3);
}

[data-theme="stealth"] .settings-mobile-bar {
    background: linear-gradient(180deg, rgba(26, 18, 40, 0.98) 0%, rgba(14, 10, 22, 0.98) 100%);
    border-bottom-color: rgba(168, 85, 247, 0.2);
}

[data-theme="light"] .settings-nav {
    background: #e5dfd5 !important;
    border-right-color: #a89f90 !important;
}

[data-theme="light"] .nav-header {
    border-bottom-color: #d4d4d4;
}

[data-theme="light"] .settings-container .return-to-browser {
    color: #4900c2;
    background: rgba(73, 0, 194, 0.08);
    border-color: rgba(73, 0, 194, 0.3);
}

[data-theme="light"] .settings-container .return-to-browser:hover,
[data-theme="light"] .settings-container .return-to-browser:focus-visible {
    color: #3b0099;
    background: rgba(73, 0, 194, 0.15);
    border-color: rgba(73, 0, 194, 0.5);
}

[data-theme="stealth"] .settings-nav {
    background: linear-gradient(180deg, rgba(26, 18, 40, 0.98) 0%, rgba(14, 10, 22, 0.98) 100%) !important;
    border-right-color: rgba(168, 85, 247, 0.2) !important;
}

.nav-header {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0 12px 12px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 10px;
}

.nav-header > div:first-child {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-logo {
    width: 18px;
    height: 18px;
    border-radius: 3px;
    object-fit: contain;
}

.nav-header h1 {
    font-size: 12px;
    font-weight: 600;
    font-variant: normal;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    line-height: 1.2;
    color: #c4b5fd;
    background: none;
    -webkit-background-clip: unset;
    -webkit-text-fill-color: unset;
}

.settings-container .return-to-browser {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    margin-top: 0;
    padding: 5px 8px;
    border: 1px solid rgba(73, 0, 194, 0.45);
    border-radius: 4px;
    background: rgba(73, 0, 194, 0.18);
    color: #e9e4ff;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.2;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.settings-container .return-to-browser i {
    font-size: 10px;
}

.settings-container .return-to-browser:hover,
.settings-container .return-to-browser:focus-visible {
    background: rgba(73, 0, 194, 0.35);
    border-color: rgba(73, 0, 194, 0.75);
    outline: none;
}

/* Memory Usage Bar */
.memory-usage-container {
    background: #14141c;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    padding: 7px 8px;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.memory-info {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 5px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.75);
}

.memory-info > span {
    white-space: nowrap;
    flex: 1 1 auto;
    min-width: 0;
}

.memory-meter-block + .memory-meter-block {
    margin-top: 8px;
    padding-top: 7px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.memory-info i {
    font-size: 11px;
    color: #4facfe;
}

.memory-meter-block:nth-child(2) .memory-info i {
    color: #86efac;
}

.memory-meter-block:nth-child(3) .memory-info i {
    color: #fbbf24;
}

.memory-adjust-btn {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.memory-adjust-btn i {
    font-size: 10px;
    color: inherit;
}

.memory-adjust-btn:hover {
    background: rgba(79, 172, 254, 0.16);
    border-color: rgba(79, 172, 254, 0.45);
    color: #4facfe;
}

[data-theme="light"] .memory-adjust-btn {
    border-color: #d0d0d0;
    background: #f4f1ea;
    color: #444444;
}

[data-theme="light"] .memory-adjust-btn:hover {
    background: rgba(79, 172, 254, 0.12);
    border-color: #4facfe;
    color: #1a6fb5;
}

.memory-bar-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.memory-bar {
    flex: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.memory-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #4facfe 0%, #00f2fe 100%);
    border-radius: 3px;
    transition: width 0.3s ease;
    width: 0%;
}

#memory-percentage,
#cpu-percentage,
#video-percentage {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.65);
    min-width: 26px;
    text-align: right;
}

.memory-stats-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    margin-top: 8px;
    padding: 5px 6px 1px;
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 0;
    background: transparent;
    color: rgba(255, 255, 255, 0.55);
    font-size: 10px;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    cursor: pointer;
    transition: color 0.15s ease;
}

.memory-stats-toggle i {
    font-size: 9px;
    color: inherit;
    transition: transform 0.18s ease;
}

.memory-stats-toggle:hover {
    color: rgba(255, 255, 255, 0.85);
}

.memory-stats-toggle[aria-expanded="true"] i {
    transform: rotate(180deg);
}

.memory-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 8px;
    margin-top: 6px;
    padding-top: 0;
}

.memory-stats-grid.is-collapsed,
.memory-stats-grid[hidden] {
    display: none;
}

.memory-stat {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.memory-stat-label {
    font-size: 9px;
    letter-spacing: 0.02em;
    color: rgba(255, 255, 255, 0.45);
    text-transform: uppercase;
}

.memory-stat-value {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.82);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Light Theme Memory Usage Bar */
[data-theme="light"] .memory-usage-container {
    background: #e5dfd5;
    border: 1px solid #a89f90;
}

[data-theme="light"] .memory-info {
    color: #1a1a1a;
    font-weight: 500;
}

[data-theme="light"] .memory-meter-block + .memory-meter-block {
    border-top-color: #d4d4d4;
}

[data-theme="light"] .memory-bar {
    background: #e0e0e0;
}

[data-theme="light"] #memory-percentage,
[data-theme="light"] #cpu-percentage,
[data-theme="light"] #video-percentage {
    color: #333333;
    font-weight: 500;
}

[data-theme="light"] .memory-stats-toggle {
    border-top-color: #d4d4d4;
    color: #666666;
}

[data-theme="light"] .memory-stats-toggle:hover {
    color: #1a1a1a;
}

[data-theme="light"] .memory-stat-label {
    color: #666666;
}

[data-theme="light"] .memory-stat-value {
    color: #1a1a1a;
    font-weight: 500;
}

/* Memory usage states */
.memory-bar-fill.low {
    background: linear-gradient(90deg, #4facfe 0%, #00f2fe 100%);
}

.memory-bar-fill.medium {
    background: linear-gradient(90deg, #f093fb 0%, #f5576c 100%);
}

.memory-bar-fill.high {
    background: linear-gradient(90deg, #ff4b1f 0%, #ff9068 100%);
}

#cpu-bar-fill.low {
    background: linear-gradient(90deg, #34d399 0%, #86efac 100%);
}

#cpu-bar-fill.medium {
    background: linear-gradient(90deg, #fbbf24 0%, #f59e0b 100%);
}

#cpu-bar-fill.high {
    background: linear-gradient(90deg, #ff4b1f 0%, #ff9068 100%);
}

#video-bar-fill.low {
    background: linear-gradient(90deg, #fbbf24 0%, #f59e0b 100%);
}

#video-bar-fill.medium {
    background: linear-gradient(90deg, #fb923c 0%, #f97316 100%);
}

#video-bar-fill.high {
    background: linear-gradient(90deg, #ff4b1f 0%, #ff9068 100%);
}

.nav-sections {
    padding: 0 8px;
}

.settings-search-container {
    position: relative;
    padding: 0 8px 8px;
}

.settings-search-mode-toggle {
    display: flex;
    gap: 4px;
    margin-bottom: 6px;
}

.settings-mode-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 5px 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    background: transparent;
    color: #a1a1aa;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.settings-mode-btn i {
    font-size: 10px;
    opacity: 0.85;
}

.settings-mode-btn:hover {
    background: rgba(73, 0, 194, 0.16);
    color: #e4e4e7;
}

.settings-mode-btn.active {
    background: rgba(73, 0, 194, 0.78);
    border-color: rgba(73, 0, 194, 0.7);
    color: #ffffff;
}

.settings-search-container.ai-mode .settings-search-box {
    border-color: rgba(56, 189, 248, 0.35);
}

.settings-search-container.ai-mode .settings-search-box:focus-within {
    border-color: rgba(56, 189, 248, 0.75);
    background: rgba(14, 165, 233, 0.1);
}

.settings-search-container.ai-mode .settings-search-icon {
    color: #38bdf8;
}

.settings-ai-submit {
    display: none;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border: none;
    border-radius: 4px;
    background: rgba(14, 165, 233, 0.22);
    color: #7dd3fc;
    cursor: pointer;
    flex-shrink: 0;
    padding: 0;
}

.settings-ai-submit:hover {
    background: rgba(14, 165, 233, 0.4);
    color: #e0f2fe;
}

.settings-ai-submit:disabled {
    opacity: 0.45;
    cursor: default;
}

.settings-search-container.ai-mode .settings-ai-submit {
    display: inline-flex;
}

.settings-ai-result {
    padding: 10px 8px;
    font-size: 11px;
    line-height: 1.45;
    color: #e4e4e7;
}

.settings-ai-result-title {
    font-weight: 650;
    color: #7dd3fc;
    margin-bottom: 4px;
}

.settings-ai-result-changes {
    margin-top: 8px;
    padding-top: 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.settings-ai-result-change {
    font-size: 10px;
    color: #a1a1aa;
    margin-top: 3px;
}

.settings-ai-result-error {
    color: #fca5a5;
}

.settings-ai-result-loading {
    color: #a1a1aa;
    display: flex;
    align-items: center;
    gap: 8px;
}

.settings-ai-result-loading i {
    color: #38bdf8;
}

.settings-search-box {
    display: flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 4px;
    padding: 6px 8px;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.settings-search-box:focus-within {
    border-color: rgba(73, 0, 194, 0.65);
    background: rgba(73, 0, 194, 0.1);
}

.settings-search-icon {
    font-size: 11px;
    color: #a1a1aa;
    flex-shrink: 0;
}

.settings-search-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #e4e4e7;
    font-size: 12px;
    font-weight: 500;
    min-width: 0;
}

.settings-search-input::placeholder {
    color: #a1a1aa;
    opacity: 0.8;
}

.settings-search-clear {
    background: transparent;
    border: none;
    color: #a1a1aa;
    cursor: pointer;
    font-size: 10px;
    padding: 2px;
    line-height: 1;
    flex-shrink: 0;
}

.settings-search-clear:hover {
    color: #ffffff;
}

.settings-search-results {
    position: absolute;
    left: 8px;
    right: 8px;
    top: 100%;
    z-index: 50;
    max-height: 320px;
    overflow-y: auto;
    background: #18181b;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 4px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
    display: none;
}

[data-theme="light"] .settings-search-box {
    border-color: rgba(0, 0, 0, 0.14);
}

[data-theme="light"] .settings-mode-btn {
    border-color: rgba(0, 0, 0, 0.12);
    color: #64748b;
}

[data-theme="light"] .settings-mode-btn:hover {
    background: rgba(73, 0, 194, 0.1);
    color: #334155;
}

[data-theme="light"] .settings-mode-btn.active {
    background: rgba(73, 0, 194, 0.85);
    border-color: rgba(73, 0, 194, 0.7);
    color: #ffffff;
}

[data-theme="light"] .settings-search-container.ai-mode .settings-search-box {
    border-color: rgba(2, 132, 199, 0.35);
}

[data-theme="light"] .settings-search-container.ai-mode .settings-search-box:focus-within {
    border-color: rgba(2, 132, 199, 0.65);
    background: rgba(14, 165, 233, 0.08);
}

[data-theme="light"] .settings-ai-result {
    color: #334155;
}

[data-theme="light"] .settings-ai-result-title {
    color: #0284c7;
}

[data-theme="light"] .settings-ai-result-change {
    color: #64748b;
}

[data-theme="light"] .settings-ai-result-error {
    color: #b91c1c;
}

[data-theme="light"] .settings-search-box:focus-within {
    border-color: rgba(73, 0, 194, 0.5);
    background: rgba(73, 0, 194, 0.08);
}

[data-theme="light"] .settings-search-icon,
[data-theme="light"] .settings-search-clear {
    color: #64748b;
}

[data-theme="light"] .settings-search-input {
    color: #1e293b;
}

[data-theme="light"] .settings-search-results {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.12);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.settings-search-results.visible {
    display: block;
}

.settings-search-result-item {
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding: 6px 8px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

[data-theme="light"] .settings-search-result-item {
    border-bottom-color: rgba(0, 0, 0, 0.06);
}

.settings-search-result-item:last-child {
    border-bottom: none;
}

.settings-search-result-item:hover,
.settings-search-result-item.active {
    background: rgba(73, 0, 194, 0.18);
}

[data-theme="light"] .settings-search-result-item:hover,
[data-theme="light"] .settings-search-result-item.active {
    background: rgba(73, 0, 194, 0.12);
}

.settings-search-result-title {
    font-size: 12px;
    font-weight: 500;
    color: #e4e4e7;
}

[data-theme="light"] .settings-search-result-title {
    color: #1e293b;
}

.settings-search-result-title mark {
    background: rgba(73, 0, 194, 0.45);
    color: #ffffff;
    border-radius: 2px;
    padding: 0 1px;
}

.settings-search-result-meta {
    font-size: 10px;
    color: #a1a1aa;
}

.settings-search-no-results {
    padding: 10px 8px;
    text-align: center;
    font-size: 11px;
    color: #a1a1aa;
}

.setting-item.search-highlight {
    animation: settings-search-flash 1.6s ease;
    outline: 2px solid rgba(250, 204, 21, 0.85);
    outline-offset: 2px;
    background: rgba(250, 204, 21, 0.16) !important;
}

@keyframes settings-search-flash {
    0% { background: rgba(250, 204, 21, 0.34); }
    100% { background: transparent; }
}

.nav-section {
    margin-bottom: 8px;
}

.nav-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    background: transparent;
    border: 1px solid transparent;
    color: #a1a1aa;
    font-size: 12px;
    font-weight: 500;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
    position: relative;
    margin-bottom: 2px;
    text-align: left;
    white-space: nowrap;
}

.nav-item.nav-item-sub {
    padding-left: 28px;
    font-size: 11px;
    opacity: 0.92;
}

.nav-item.nav-item-sub[hidden] {
    display: none !important;
}

.nav-power-up-plugin-settings {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.nav-power-up-plugin-settings .nav-item.nav-item-sub img.nav-item-icon {
    width: 14px;
    height: 14px;
    object-fit: contain;
    border-radius: 2px;
}

#power-up-plugin-settings-pages .powerup-plugin-settings-frame {
    width: 100%;
    min-height: 280px;
    border: 0;
    background: transparent;
    border-radius: var(--stealth-cut, 12px 2px 2px 2px);
}

.nav-item:hover {
    background: rgba(73, 0, 194, 0.18);
    color: #ffffff;
    transform: none;
}

.nav-item.active {
    background: rgba(73, 0, 194, 0.85);
    border-color: rgba(73, 0, 194, 0.65);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(73, 0, 194, 0.25);
}

.nav-item i,
.nav-item img.nav-item-icon {
    width: 14px;
    flex-shrink: 0;
    opacity: 0.55;
    transition: opacity 0.15s ease;
}

.nav-item i {
    text-align: center;
    font-size: 12px;
}

.nav-item img.nav-item-icon {
    height: 14px;
    object-fit: contain;
}

.nav-item:hover i,
.nav-item:hover img.nav-item-icon {
    opacity: 0.7;
}

.nav-item.active i,
.nav-item.active img.nav-item-icon {
    opacity: 0.75;
}

.nav-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 8px 0;
}

/* Light Theme Navigation */
[data-theme="light"] .nav-item {
    color: #64748b;
}

[data-theme="light"] .nav-item:hover {
    background: rgba(73, 0, 194, 0.12);
    color: #1e293b;
}

[data-theme="light"] .nav-item.active {
    background: rgba(73, 0, 194, 0.85);
    border-color: rgba(73, 0, 194, 0.65);
    color: #ffffff !important;
    box-shadow: 0 2px 8px rgba(73, 0, 194, 0.25);
}

/* Ensure active nav item text is always white in light theme */
[data-theme="light"] .nav-item.active span,
[data-theme="light"] .nav-item.active i {
    color: #ffffff !important;
}

[data-theme="light"] .nav-divider {
    background: rgba(0, 0, 0, 0.1);
}

/* Settings Content Area */
.settings-content {
    flex: 1 1 auto;
    margin-left: 0;
    padding: 16px 20px;
    max-width: none;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    min-width: 0;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: #0a0a0f;
    position: relative;
    z-index: 0;
    container-type: inline-size;
    container-name: settings;
}

.settings-page {
    display: none;
    max-width: none;
    width: 100%;
    margin: 0;
    padding: 0 4px 24px 4px;
    box-sizing: border-box;
}

.settings-page.active {
    display: block;
}

.settings-page[hidden] {
    display: none !important;
}

#plugins-page {
    max-width: none;
    width: 100%;
    padding: 0;
}

#plugins-page .plugin-container {
    width: 100%;
    max-width: none;
    padding: 0 40px;
    box-sizing: border-box;
}

#plugins-page .plugin-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
    margin-bottom: 16px;
    padding-bottom: 0;
    border-bottom: none;
}

#plugins-page .plugin-header .page-header {
    margin-bottom: 0;
    flex: 1;
    min-width: 0;
}

#plugins-page .header-actions {
    display: flex;
    gap: 12px;
}

#plugins-page .plugin-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 30px;
}

#plugins-page .plugin-controls {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    align-items: center;
    width: 100%;
    max-width: 100%;
}

#plugins-page .search-container {
    flex: 1;
    position: relative;
}

#plugins-page .search-container input {
    width: 100%;
    box-sizing: border-box;
}

#plugins-page .filter-container {
    width: auto;
    min-width: 200px;
}

#plugins-page .plugin-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
    gap: 16px;
    width: 100%;
    max-width: 100%;
}

.toolbar-tools-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toolbar-tool-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.toolbar-tool-row.is-locked {
    opacity: 0.46;
    filter: grayscale(0.72);
}

.toolbar-tool-row.is-locked .toggle-input:disabled + .toggle {
    cursor: not-allowed;
}

.toolbar-tool-email-options {
    flex: 1 0 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 2px;
    padding: 10px 0 2px 40px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.toolbar-tool-email-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-width: 420px;
}

.toolbar-tool-email-field:has(#toolbar-email-provider) {
    align-self: flex-start;
    max-width: none;
}

.toolbar-tool-email-field label {
    font-size: 12px;
    font-weight: 600;
    color: #e4e4e7;
}

.toolbar-tool-email-field .setting-input,
.toolbar-tool-email-field .sb-select {
    width: 100%;
}

.toolbar-tool-email-field:has(#toolbar-email-provider) .setting-input,
.toolbar-tool-email-field:has(#toolbar-email-provider) .sb-select,
.toolbar-tool-email-field:has(#toolbar-email-provider) .sb-select-trigger {
    width: auto;
    min-width: 168px;
}

.toolbar-tool-email-field[hidden] {
    display: none;
}

[data-theme="light"] .toolbar-tool-email-options {
    border-top-color: #e4e4e7;
}

[data-theme="light"] .toolbar-tool-email-field label {
    color: #1a1a1a;
}

.toolbar-tool-icon {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 50%;
    background: rgba(45, 45, 45, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: #ffffff;
    font-size: 13px;
    overflow: hidden;
}

.toolbar-tool-icon img {
    width: 15px;
    height: 15px;
    object-fit: contain;
    /* Match toolbar default: black SVG glyphs flipped to white */
    filter: brightness(0) saturate(100%) invert(100%);
}

.toolbar-tool-icon i,
.toolbar-tool-icon .toolbar-tool-glyph {
    line-height: 1;
    color: #ffffff;
}

.toolbar-tool-row[data-toolbar-tool-id="screenshot"] .toolbar-tool-icon img {
    filter: brightness(0) saturate(100%) invert(72%) sepia(62%) saturate(2800%) hue-rotate(160deg) brightness(1.05);
}
.toolbar-tool-row[data-toolbar-tool-id="security"] .toolbar-tool-icon img {
    filter: brightness(0) saturate(100%) invert(25%) sepia(98%) saturate(6421%) hue-rotate(270deg) brightness(95%) contrast(120%);
}
.toolbar-tool-row[data-toolbar-tool-id="pip"] .toolbar-tool-icon img {
    filter: brightness(0) saturate(100%) invert(78%) sepia(48%) saturate(900%) hue-rotate(359deg) brightness(102%) contrast(101%);
}
.toolbar-tool-row[data-toolbar-tool-id="downloads"] .toolbar-tool-icon img {
    filter: brightness(0) saturate(100%) invert(72%) sepia(42%) saturate(650%) hue-rotate(85deg) brightness(1.05);
}
.toolbar-tool-row[data-toolbar-tool-id="links"] .toolbar-tool-icon img {
    filter: brightness(0) saturate(100%) invert(62%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(0.95);
}
.toolbar-tool-row[data-toolbar-tool-id="settings"] .toolbar-tool-icon img {
    filter: brightness(0) saturate(100%) invert(58%) sepia(48%) saturate(1200%) hue-rotate(185deg) brightness(1.05);
}
.toolbar-tool-row[data-toolbar-tool-id="password"] .toolbar-tool-icon img {
    filter: brightness(0) saturate(100%) invert(48%) sepia(70%) saturate(1800%) hue-rotate(240deg) brightness(1.05);
}
.toolbar-tool-row[data-toolbar-tool-id="payment"] .toolbar-tool-icon img {
    filter: brightness(0) saturate(100%) invert(48%) sepia(70%) saturate(1800%) hue-rotate(240deg) brightness(1.05);
}
.toolbar-tool-row[data-toolbar-tool-id="playlist"] .toolbar-tool-icon img {
    filter: brightness(0) saturate(100%) invert(52%) sepia(68%) saturate(1800%) hue-rotate(300deg) brightness(1.02);
}
.toolbar-tool-row[data-toolbar-tool-id="audio"] .toolbar-tool-icon img {
    filter: brightness(0) saturate(100%) invert(42%) sepia(78%) saturate(2200%) hue-rotate(340deg) brightness(1.05);
}
.toolbar-tool-row[data-toolbar-tool-id="media-controls"] .toolbar-tool-icon img {
    filter: brightness(0) saturate(100%) invert(72%) sepia(42%) saturate(650%) hue-rotate(130deg) brightness(1.05);
}
.toolbar-tool-row[data-toolbar-tool-id="video-downloader"] .toolbar-tool-icon img {
    filter: brightness(0) saturate(100%) invert(68%) sepia(48%) saturate(1200%) hue-rotate(196deg) brightness(1.05);
}
.toolbar-tool-row[data-toolbar-tool-id="clipboard"] .toolbar-tool-icon img {
    filter: brightness(0) saturate(100%) invert(72%) sepia(42%) saturate(650%) hue-rotate(130deg) brightness(1.05);
}
.toolbar-tool-row[data-toolbar-tool-id="rss"] .toolbar-tool-icon img {
    filter: brightness(0) saturate(100%) invert(48%) sepia(80%) saturate(1800%) hue-rotate(200deg) brightness(1.05);
}
.toolbar-tool-row[data-toolbar-tool-id="offline-page"] .toolbar-tool-icon img {
    filter: brightness(0) saturate(100%) invert(68%) sepia(62%) saturate(1600%) hue-rotate(345deg) brightness(1.05);
}
.toolbar-tool-row[data-toolbar-tool-id="file-converter"] .toolbar-tool-icon img {
    filter: brightness(0) saturate(100%) invert(62%) sepia(78%) saturate(2200%) hue-rotate(285deg) brightness(1.05);
}
.toolbar-tool-row[data-toolbar-tool-id="hide-it"] .toolbar-tool-icon img {
    filter: brightness(0) saturate(100%) invert(86%) sepia(62%) saturate(1200%) hue-rotate(5deg) brightness(1.05);
}
.toolbar-tool-row[data-toolbar-tool-id="no-dubs-netflix"] .toolbar-tool-icon img {
    filter: none;
    width: 18px;
    height: 18px;
}
.toolbar-tool-row[data-toolbar-tool-id="block-it"] .toolbar-tool-icon img {
    filter: brightness(0) saturate(100%) invert(28%) sepia(82%) saturate(2400%) hue-rotate(330deg) brightness(0.98);
}
.toolbar-tool-row[data-toolbar-tool-id="wayback-look"] .toolbar-tool-icon img {
    filter: brightness(0) saturate(100%) invert(78%) sepia(48%) saturate(900%) hue-rotate(359deg) brightness(102%) contrast(101%);
}
.toolbar-tool-row[data-toolbar-tool-id="email"] .toolbar-tool-icon img {
    filter: brightness(0) saturate(100%) invert(72%) sepia(42%) saturate(650%) hue-rotate(160deg) brightness(1.05);
}
.toolbar-tool-row[data-toolbar-tool-id="vpn"] .toolbar-tool-icon img {
    filter: brightness(0) saturate(100%) invert(72%) sepia(42%) saturate(650%) hue-rotate(85deg) brightness(1.05);
}
.toolbar-tool-row[data-toolbar-tool-id="tor"] .toolbar-tool-icon img {
    filter: none;
}
.toolbar-tool-row[data-toolbar-tool-id="extensions"] .toolbar-tool-icon img {
    filter: brightness(0) saturate(100%) invert(72%) sepia(42%) saturate(650%) hue-rotate(200deg) brightness(1.05);
}
.toolbar-tool-row[data-toolbar-tool-id="crypto"] .toolbar-tool-icon img,
.toolbar-tool-row[data-toolbar-tool-id="glass"] .toolbar-tool-icon img,
.toolbar-tool-row[data-toolbar-tool-id="ai"] .toolbar-tool-icon img,
.toolbar-tool-row[data-toolbar-tool-id="night-light"] .toolbar-tool-icon img,
.toolbar-tool-row[data-toolbar-tool-id="stealth"] .toolbar-tool-icon img,
.toolbar-tool-row[data-toolbar-tool-id^="pu:"] .toolbar-tool-icon img {
    /* Colored / branded assets: keep original colors */
    filter: none;
}
.toolbar-tool-row[data-toolbar-tool-id="notes"] .toolbar-tool-icon img,
.toolbar-tool-row[data-toolbar-tool-id="reading-mode"] .toolbar-tool-icon img {
    filter: brightness(0) saturate(100%) invert(100%);
}
.toolbar-tool-row[data-toolbar-tool-id="powerups"] .toolbar-tool-icon i {
    color: #c084fc;
}
.toolbar-tool-row[data-toolbar-tool-id="extensions"] .toolbar-tool-icon i {
    color: #3db8ff;
}
.toolbar-tool-row[data-toolbar-tool-id="devtools"] .toolbar-tool-icon i {
    color: #94a3b8;
}
.toolbar-tool-row[data-toolbar-tool-id="volume"] .toolbar-tool-icon i {
    color: #e4e4e7;
}
.toolbar-tool-row[data-toolbar-tool-id="stealth"] .toolbar-tool-icon img {
    width: 18px;
    height: 18px;
}

.toolbar-tool-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.toolbar-tool-info label {
    font-size: 13px;
    font-weight: 600;
    color: #f4f4f5;
}

.toolbar-tool-meta {
    font-size: 11px;
    color: #a1a1aa;
}

.toolbar-tools-empty {
    font-size: 12px;
    color: #a1a1aa;
    padding: 8px 2px;
}

.page-header {
    margin-bottom: 16px;
}

.page-header h2 {
    font-size: 13px;
    font-weight: 600;
    font-variant: normal;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 4px;
    color: #e4e4e7;
    background: none;
    -webkit-background-clip: unset;
    -webkit-text-fill-color: unset;
}

.page-header p {
    font-size: 11px;
    color: #a1a1aa;
    line-height: 1.4;
}

/* Settings Sections */
.settings-section {
    background: #14141c;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 5px;
    padding: 12px 14px;
    margin-bottom: 12px;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.settings-section h3 {
    font-size: 11px;
    font-weight: 600;
    font-variant: normal;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 10px;
    color: #c4b5fd;
}

.custom-sounds-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.custom-sounds-list .custom-sound-row {
    margin: 0;
}

.sound-choice-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.sound-choice-controls .setting-input,
.sound-choice-controls .sb-select {
    min-width: 180px;
}

.sound-preview-btn,
.custom-sound-preview-btn {
    flex: 0 0 auto;
    white-space: nowrap;
}

.settings-section > .section-description {
    font-size: 11px;
    color: #a1a1aa;
    margin: -4px 0 10px 0;
    line-height: 1.4;
}

[data-theme="light"] .settings-section > .section-description {
    color: #4a4a4a;
}

/* Light Theme Page Headers and Sections */
[data-theme="light"] .page-header h2 {
    color: #1a1a1a;
    background: none;
    -webkit-background-clip: unset;
    -webkit-text-fill-color: unset;
}

[data-theme="light"] .page-header p {
    color: #4a4a4a;
}

[data-theme="light"] .settings-section {
    background: #ffffff;
    border: 1px solid #d4d4d4;
}

[data-theme="light"] .settings-section h3 {
    color: #4900c2;
}

[data-theme="light"] .settings-content {
    background: #f3f3f3;
    color: #1a1a1a;
}

[data-theme="light"] .setting-info label {
    color: #1a1a1a;
    font-weight: 600;
}

[data-theme="light"] .setting-description {
    color: #4a4a4a;
}

[data-theme="light"] .toggle-text {
    color: #1a1a1a;
}

[data-theme="light"] .toggle-text.toggle-state::after {
    color: #666666;
}

[data-theme="light"] .toggle-input:checked + .toggle + .toggle-text,
[data-theme="light"] .toggle-input:checked + .toggle + .toggle-text.toggle-state::after {
    color: #1a1a1a;
}

[data-theme="light"] .settings-container .btn-secondary,
[data-theme="light"] .btn-secondary {
    background: #ffffff;
    border: 1px solid #c8c8c8;
    color: #1a1a1a;
}

[data-theme="light"] .settings-container .btn-secondary:hover,
[data-theme="light"] .btn-secondary:hover {
    background: #f0f0f0;
    border-color: #4900c2;
    color: #1a1a1a;
}

[data-theme="light"] .setting-note {
    color: #4a4a4a;
    background: #f5f5f5;
    border-left-color: #4900c2;
}

[data-theme="light"] .nav-item {
    color: #333333;
}

[data-theme="light"] .nav-item:hover {
    background: rgba(73, 0, 194, 0.1);
    color: #1a1a1a;
}

/* Responsive Design for Settings.
   Sized against the settings shell/content containers, not the OS window, so the
   layout keeps adapting when the AI side dock compresses the settings HWND. */
@container settings-shell (max-width: 1200px) {
    .settings-content {
        padding: 18px 20px;
    }

    .settings-page {
        padding: 0 8px;
    }
}

@container settings-shell (max-width: 900px) {
    .settings-content {
        padding: 14px 16px;
    }

    .settings-page {
        padding: 0 4px;
    }

    .settings-section {
        padding: 10px 12px;
        margin-bottom: 10px;
    }
}

@container settings-shell (max-width: 600px) {
    .settings-content {
        margin-left: 0;
        padding: 12px;
        width: 100%;
    }

    .settings-page {
        padding: 0 2px;
    }

    .settings-section {
        padding: 10px;
        margin-bottom: 10px;
    }

    .page-header {
        margin-bottom: 12px;
    }

    .page-header h2 {
        font-size: 12px;
    }
}

/* Setting Items */
.setting-item {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.setting-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.setting-item[hidden] {
    display: none !important;
}

/* Nested options under a parent toggle / .settings-container select */
.setting-subitem {
    margin-left: 22px;
    padding-left: 14px;
    border-left: 2px solid rgba(139, 92, 246, 0.35);
}

.setting-subitem-nested {
    margin-left: 44px;
    padding-left: 14px;
    border-left: 2px solid rgba(139, 92, 246, 0.22);
}

.warning-banner.setting-subitem {
    margin-top: 8px;
}

.setting-nav-link {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: inherit;
    text-align: left;
    cursor: pointer;
    font: inherit;
    padding: 10px 0;
}

.setting-nav-link:hover {
    background: rgba(255, 255, 255, 0.03);
}

.setting-nav-link .setting-info label {
    cursor: pointer;
}

.setting-nav-chevron {
    color: #a1a1aa;
    font-size: 12px;
    flex-shrink: 0;
}

.site-permission-add-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 4px 0 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.site-permission-add-row .setting-input {
    flex: 1 1 120px;
    min-width: 100px;
}

.site-permission-add-row #site-permission-site {
    flex: 2 1 160px;
}

.site-permission-list-container {
    margin-top: 8px;
}

.site-permission-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.site-permission-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.site-permission-item-info {
    flex: 1;
    min-width: 0;
}

.site-permission-item-info .site-permission-site-name {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: #ffffff;
    line-height: 1.3;
    word-break: break-all;
}

.site-permission-item-info .site-permission-detail {
    display: block;
    font-size: 11px;
    color: #a1a1aa;
    line-height: 1.35;
    margin-top: 2px;
}

.site-permission-item .setting-input {
    width: auto;
    min-width: 96px;
    flex-shrink: 0;
}

.site-permission-remove-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #a1a1aa;
    border-radius: 4px;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    font-size: 11px;
}

.site-permission-remove-btn:hover {
    color: #fca5a5;
    border-color: rgba(248, 113, 113, 0.45);
    background: rgba(248, 113, 113, 0.08);
}

.site-permission-empty {
    font-size: 11px;
    color: #a1a1aa;
    line-height: 1.4;
    padding: 8px 0 2px;
}

[data-theme="light"] .setting-nav-link:hover {
    background: rgba(0, 0, 0, 0.03);
}

[data-theme="light"] .setting-nav-chevron {
    color: #71717a;
}

[data-theme="light"] .site-permission-item-info .site-permission-site-name {
    color: #1a1a1a;
}

[data-theme="light"] .site-permission-item-info .site-permission-detail,
[data-theme="light"] .site-permission-empty {
    color: #4a4a4a;
}

[data-theme="light"] .site-permission-remove-btn {
    border-color: #d4d4d4;
    color: #71717a;
}

.setting-info {
    flex: 1 1 200px;
    min-width: min(100%, 180px);
}

.setting-info label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: #ffffff;
    margin-bottom: 2px;
    line-height: 1.3;
}

.setting-description {
    font-size: 11px;
    color: #a1a1aa;
    line-height: 1.35;
}

.setting-info.import-browser-info {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.import-browser-logo {
    width: 20px !important;
    height: 20px !important;
    max-width: 20px !important;
    max-height: 20px !important;
    flex: 0 0 20px;
    display: block;
    object-fit: contain;
    object-position: center;
}

.import-browser-list {
    display: flex;
    flex-direction: column;
    margin-top: 4px;
}

.import-browser-block {
    padding: 18px 0 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.import-browser-block:first-child {
    padding-top: 14px;
}

[data-theme="light"] .import-browser-block {
    border-top-color: rgba(0, 0, 0, 0.12);
}

.import-browser-block > .setting-item:first-child {
    margin-top: 0;
}

.import-browser-block .browser-sync-panel {
    margin-bottom: 0;
}

.import-browser-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1 1 auto;
}

.import-browser-text label {
    display: block;
    margin-bottom: 0;
}

.chrome-profiles-picker {
    margin: 4px 0 16px;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--stealth-cut-panel, 22px 4px 4px 4px);
    background: rgba(255, 255, 255, 0.03);
}

.chrome-payment-profile-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 10px;
}

.chrome-payment-profile-title {
    font-size: 12px;
    font-weight: 600;
    color: #ddd6fe;
    margin-top: 4px;
}

.chrome-payment-option strong {
    font-variant-numeric: tabular-nums;
}

.payment-needs-number {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 6px;
    font-size: 10px;
    font-weight: 600;
    color: #ddd6fe;
    background: rgba(90, 13, 214, 0.28);
    border: 1px solid rgba(90, 13, 214, 0.45);
    border-radius: var(--stealth-cut-sm, 8px 2px 2px 2px);
    vertical-align: middle;
}

.import-payments-hint {
    margin: 0 0 14px;
    padding: 10px 12px;
    font-size: 12px;
    line-height: 1.45;
    color: #ddd6fe;
    background: rgba(90, 13, 214, 0.16);
    border: 1px solid rgba(90, 13, 214, 0.35);
    border-radius: var(--stealth-cut-panel, 22px 4px 4px 4px);
}

#chrome-payments-google-pay-note {
    margin-bottom: 10px;
}

#chrome-payments-google-pay-note[hidden],
#import-payments-hint[hidden] {
    display: none !important;
}

.chrome-profiles-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chrome-profile-option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 13px;
    color: #e4e4e7;
}

.chrome-profile-option input {
    margin-top: 3px;
}

.chrome-profile-option span {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.chrome-profile-option strong {
    font-weight: 500;
    color: #ffffff;
}

.chrome-profile-option small {
    font-size: 11px;
    color: #a1a1aa;
}

.browser-sync-panel {
    margin: 4px 0 16px;
    padding: 4px 0 0;
}

.browser-sync-panel .setting-item {
    align-items: flex-start;
}

#chrome-sync-status,
#firefox-sync-status,
#brave-sync-status,
#opera-sync-status {
    display: block;
    margin-top: 4px;
}

/* Input Controls */
.setting-input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    padding: 5px 8px;
    color: #ffffff;
    font-size: 12px;
    min-width: 140px;
    line-height: 1.3;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.setting-input:focus {
    outline: none;
    border-color: rgba(73, 0, 194, 0.75);
    box-shadow: 0 0 0 2px rgba(73, 0, 194, 0.2);
}

.font-picker .font-picker-list.setting-input {
    width: 100%;
    min-width: 0;
    min-height: 160px;
    max-height: 220px;
    padding: 4px;
    overflow-y: auto;
    overflow-x: hidden;
    display: block;
    background-image: none !important;
    line-height: 1.4;
}

.font-picker .font-picker-option {
    display: block;
    box-sizing: border-box;
    width: 100%;
    min-height: 28px;
    height: auto;
    margin: 0 0 2px;
    padding: 6px 10px;
    font-size: 13px;
    line-height: 1.4;
    flex: none;
}

.font-picker .font-picker-list.setting-input:focus {
    border-color: #5a0dd6;
    box-shadow: 0 0 0 2px rgba(90, 13, 214, 0.2);
}

.font-picker .font-picker-option[aria-selected="true"] {
    background: linear-gradient(135deg, #5a0dd6, #4900c2) !important;
    color: #ffffff !important;
}

.hotkey-capture-input {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    letter-spacing: 0.02em;
    cursor: pointer;
}

.hotkey-capture-input.capturing {
    border-color: rgba(255, 107, 107, 0.75);
    box-shadow: 0 0 0 2px rgba(255, 107, 107, 0.2);
    color: #ffb4b4;
}

/* Modern Toggle Switch */
.toggle-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.setting-choice-group {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
    flex-shrink: 0;
    max-width: min(100%, 420px);
}

.setting-choice {
    appearance: none;
    -webkit-appearance: none;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.06);
    color: #e8e8ef;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    white-space: nowrap;
}

.setting-choice:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.28);
}

.setting-choice.active {
    background: rgba(124, 58, 237, 0.85);
    border-color: rgba(167, 139, 250, 0.9);
    color: #ffffff;
}

[data-theme="light"] .setting-choice {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.14);
    color: #1f2937;
}

[data-theme="light"] .setting-choice.active {
    background: #7c3aed;
    border-color: #6d28d9;
    color: #ffffff;
}

.toggle-input {
    display: none !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    width: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    opacity: 0 !important;
    position: absolute !important;
    pointer-events: none !important;
}

.toggle {
    position: relative;
    display: inline-block;
    width: 34px;
    height: 18px;
    background: #2a2a35;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 9px;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
    flex-shrink: 0;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.45);
}

.toggle-text {
    font-size: 11px;
    font-weight: 500;
    color: #ffffff;
    user-select: none;
}

.toggle-text.toggle-state {
    font-size: 0;
    line-height: 0;
}

.toggle-text.toggle-state::after {
    content: 'Disabled';
    font-size: 11px;
    font-weight: 500;
    line-height: 1.2;
    color: #a1a1aa;
}

.toggle-input:checked + .toggle + .toggle-text.toggle-state::after {
    content: 'Enabled';
    color: #ffffff;
}

.toggle::before {
    content: '';
    position: absolute;
    top: 1px;
    left: 1px;
    width: 14px;
    height: 14px;
    background: #1a1a22;
    border-radius: 50%;
    transition: transform 0.15s ease, background-color 0.15s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.55), inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.toggle-input:checked + .toggle {
    background: #4900c2;
    border-color: rgba(73, 0, 194, 0.8);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(73, 0, 194, 0.25);
}

.toggle-input:checked + .toggle + .toggle-text {
    color: #ffffff;
}

.toggle-input:checked + .toggle::before {
    transform: translateX(16px);
    background: #14141c;
}

/* Dark themes: keep toggle knobs dark across all settings toggles */
html[data-theme="dark"] .toggle::before,
html[data-theme="stealth"] .toggle::before,
html[data-theme="stealth-glass"] .toggle::before,
html[data-theme="stealth-float"] .toggle::before,
body[data-theme="dark"] .toggle::before,
body[data-theme="stealth"] .toggle::before,
body[data-theme="stealth-glass"] .toggle::before,
body[data-theme="stealth-float"] .toggle::before {
    background: #1a1a22;
}

html[data-theme="dark"] .toggle-input:checked + .toggle::before,
html[data-theme="stealth"] .toggle-input:checked + .toggle::before,
html[data-theme="stealth-glass"] .toggle-input:checked + .toggle::before,
html[data-theme="stealth-float"] .toggle-input:checked + .toggle::before,
body[data-theme="dark"] .toggle-input:checked + .toggle::before,
body[data-theme="stealth"] .toggle-input:checked + .toggle::before,
body[data-theme="stealth-glass"] .toggle-input:checked + .toggle::before,
body[data-theme="stealth-float"] .toggle-input:checked + .toggle::before {
    background: #14141c;
}

.toggle-input:disabled + .toggle {
    opacity: 0.45;
    cursor: not-allowed;
}

.toggle-input:disabled + .toggle + .toggle-text {
    opacity: 0.5;
    color: #6b7280;
}

/* Buttons */
.settings-container .btn-primary,
.btn-primary {
    background: rgba(73, 0, 194, 0.85);
    border: 1px solid rgba(73, 0, 194, 0.65);
    color: #ffffff;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 550;
    line-height: 1.3;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 1px 4px rgba(73, 0, 194, 0.2);
}

.settings-container .btn-primary:hover,
.btn-primary:hover {
    background: rgba(73, 0, 194, 1);
    border-color: rgba(92, 26, 209, 0.9);
    transform: none;
    box-shadow: 0 2px 8px rgba(73, 0, 194, 0.3);
}

.settings-container .btn-primary:disabled,
.btn-primary:disabled {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.4);
    box-shadow: none;
    cursor: not-allowed;
    opacity: 1;
}

.settings-container .btn-primary:disabled:hover,
.btn-primary:disabled:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: none;
}

.settings-container .btn-secondary,
.btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #ffffff;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.3;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.settings-container .btn-secondary:hover,
.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(73, 0, 194, 0.55);
    transform: none;
}

.delete-data-panel {
    margin-top: 4px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 4px 12px 8px;
    background: rgba(255, 255, 255, 0.02);
}

.delete-data-row .delete-data-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.delete-data-size {
    min-width: 72px;
    text-align: right;
    font-size: 11px;
    font-weight: 500;
    color: #a1a1aa;
    font-variant-numeric: tabular-nums;
}

.delete-data-panel input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #7c3aed;
    cursor: pointer;
}

.delete-data-actions {
    margin-top: 4px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.delete-data-action-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.delete-data-action-buttons .btn-secondary,
.delete-data-action-buttons .btn-danger {
    white-space: nowrap;
}

.settings-container .btn-danger,
.btn-danger {
    background: rgba(185, 28, 28, 0.9);
    border: 1px solid rgba(220, 38, 38, 0.65);
    color: #ffffff;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.3;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.settings-container .btn-danger:hover,
.btn-danger:hover {
    transform: none;
    background: rgba(220, 38, 38, 0.95);
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.25);
}

/* Input Groups */
.input-group {
    display: flex;
    gap: 6px;
    align-items: center;
}

.input-group .setting-input {
    flex: 1;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.action-buttons .btn-secondary {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Warning Banner */
.warning-banner {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #000;
    padding: 8px 10px;
    border-radius: 4px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.warning-banner[hidden] {
    display: none !important;
    font-size: 11px;
    font-weight: 500;
}

.warning-banner i {
    font-size: 13px;
}

/* Setting Notes */
.setting-note {
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #a1a1aa;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    border-left: 3px solid #7c3aed;
}

/* API Status */
.api-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.status-indicator {
    font-size: 16px;
    font-weight: bold;
}

.status-indicator.success {
    color: #10b981;
}

.status-indicator.error {
    color: #ef4444;
}

.status-indicator.warning {
    color: #f59e0b;
}

.status-indicator.unknown {
    color: #6b7280;
}



/* COMPREHENSIVE DROPDOWN ARROW STYLING - UNIFIED APPROACH */
.settings-container select.setting-input,
.settings-container select.settings-select,
.settings-container select,
.settings-container select {
    position: relative;
    padding: 5px 26px 5px 8px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 12px;
    line-height: 1.3;
    min-height: 28px;
    cursor: pointer;
    outline: none;
    
    /* COMPREHENSIVE browser default arrow removal */
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    
    /* Remove ALL background images first */
    background-image: none !important;
    
    /* Add single custom arrow */
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: right 8px center !important;
    background-size: 12px !important;
}

/* COMPREHENSIVE browser-specific arrow removal */
.settings-container select::-webkit-outer-spin-button,
.settings-container select::-webkit-inner-spin-button,
.settings-container select.setting-input::-webkit-outer-spin-button,
.settings-container select.setting-input::-webkit-inner-spin-button,
.settings-container select.settings-select::-webkit-outer-spin-button,
.settings-container select.settings-select::-webkit-inner-spin-button,
.settings-container select::-webkit-outer-spin-button,
.settings-container select::-webkit-inner-spin-button {
    -webkit-appearance: none !important;
    margin: 0 !important;
    display: none !important;
}

.settings-container select::-ms-expand,
.settings-container select.setting-input::-ms-expand,
.settings-container select.settings-select::-ms-expand,
.settings-container select::-ms-expand {
    display: none !important;
}

.settings-container select::-moz-focus-inner,
.settings-container select.setting-input::-moz-focus-inner,
.settings-container select.settings-select::-moz-focus-inner,
.settings-container select::-moz-focus-inner {
    border: 0 !important;
    outline: none !important;
}

/* Remove any pseudo-elements that might create arrows */
.settings-container select::after,
.settings-container select::before,
.settings-container select.setting-input::after,
.settings-container select.setting-input::before,
.settings-container select.settings-select::after,
.settings-container select.settings-select::before,
.settings-container select::after,
.settings-container select::before {
    display: none !important;
    content: none !important;
}

/* Light theme custom arrows - dark color to match theme */
[data-theme="light"] .settings-container select.setting-input,
[data-theme="light"] .settings-container select.settings-select,
[data-theme="light"] .settings-container select,
[data-theme="light"] .settings-container select {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231e293b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e") !important;
}

/* Specific width for settings-select */
.settings-select {
    width: 200px;
}

/* Ensure DNS provider dropdown specifically gets styled */
#dns-provider.settings-select {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 4px !important;
    color: #ffffff !important;
    font-size: 12px !important;
    padding: 5px 26px 5px 8px !important;
    min-height: 28px !important;
    cursor: pointer !important;
    outline: none !important;
    
    /* COMPREHENSIVE arrow removal */
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    
    /* Single custom arrow */
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: right 8px center !important;
    background-size: 12px !important;
}

/* Light theme DNS provider dropdown */
[data-theme="light"] #dns-provider.settings-select {
    background: rgba(0, 0, 0, 0.05) !important;
    border: 1px solid rgba(0, 0, 0, 0.15) !important;
    color: #1e293b !important;
    
    /* Light theme arrow */
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231e293b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e") !important;
}

/* COMPREHENSIVE DNS provider dropdown arrow removal */
#dns-provider.settings-select::-webkit-outer-spin-button,
#dns-provider.settings-select::-webkit-inner-spin-button {
    -webkit-appearance: none !important;
    margin: 0 !important;
    display: none !important;
}

#dns-provider.settings-select::-ms-expand {
    display: none !important;
}

#dns-provider.settings-select::-moz-focus-inner {
    border: 0 !important;
    outline: none !important;
}

/* DNS provider dropdown hover and focus states */
#dns-provider.settings-select:hover {
    border-color: #5a0dd6 !important;
    background: rgba(255, 255, 255, 0.08) !important;
}

#dns-provider.settings-select:focus {
    border-color: #5a0dd6 !important;
    box-shadow: 0 0 0 2px rgba(90, 13, 214, 0.2) !important;
    background: rgba(255, 255, 255, 0.08) !important;
}

/* DNS provider dropdown options styling - FORCE dark theme */
#dns-provider option,
#dns-provider.settings-select option,
.settings-container select#dns-provider option {
    background: #2a2a3a !important;
    background-color: #2a2a3a !important;
    color: #ffffff !important;
    padding: 6px 10px !important;
    border: none !important;
    outline: none !important;
}

#dns-provider option:hover,
#dns-provider.settings-select option:hover,
.settings-container select#dns-provider option:hover {
    background: #3a3a4a !important;
    background-color: #3a3a4a !important;
    color: #ffffff !important;
}

#dns-provider option:checked,
#dns-provider option:selected,
#dns-provider.settings-select option:checked,
#dns-provider.settings-select option:selected,
.settings-container select#dns-provider option:checked,
.settings-container select#dns-provider option:selected {
    background: #5a0dd6 !important;
    background-color: #5a0dd6 !important;
    color: #ffffff !important;
}

/* Universal hover and focus states */
.settings-container select.setting-input:focus,
.settings-container select.settings-select:focus,
.settings-container select:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(90, 13, 214, 0.2);
}

.settings-container select.setting-input:hover,
.settings-container select.settings-select:hover,
.settings-container select:hover {
    border-color: var(--accent-primary);
}

/* Light Theme Select Support */
[data-theme="light"] .settings-container select.setting-input,
[data-theme="light"] .settings-container select.settings-select,
[data-theme="light"] .settings-container select {
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.2);
    color: #1e293b;
}

[data-theme="light"] .settings-container select.setting-input:focus,
[data-theme="light"] .settings-container select.settings-select:focus,
[data-theme="light"] .settings-container select:focus {
    background: rgba(0, 0, 0, 0.05);
    border-color: #7c3aed;
    box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.2);
}

[data-theme="light"] .settings-container select.setting-input:hover,
[data-theme="light"] .settings-container select.settings-select:hover,
[data-theme="light"] .settings-container select:hover {
    border-color: #7c3aed;
    background: rgba(0, 0, 0, 0.05);
}

/* Browser-specific arrow removal already handled in unified section above */

/* FINAL COMPREHENSIVE OVERRIDE - Ensure ALL dropdowns use unified styling */
.settings-container select,
.settings-container select *,
.settings-container select option,
.settings-container select optgroup,
.settings-container select.setting-input,
.settings-container select.settings-select,
.settings-container select,
#dns-provider,
#dns-provider.settings-select {
    /* Force remove ALL browser defaults */
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    
    /* Remove ALL background images */
    background-image: none !important;
    
    /* Remove any pseudo-elements */
    &::after,
    &::before {
        display: none !important;
        content: none !important;
    }
}

/* Apply unified custom arrow to ALL selects */
.settings-container select,
.settings-container select.setting-input,
.settings-container select.settings-select,
.settings-container select,
#dns-provider,
#dns-provider.settings-select {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: right 8px center !important;
    background-size: 12px !important;
}

/* Light theme unified arrows */
[data-theme="light"] .settings-container select,
[data-theme="light"] .settings-container select.setting-input,
[data-theme="light"] .settings-container select.settings-select,
[data-theme="light"] .settings-container select,
[data-theme="light"] #dns-provider,
[data-theme="light"] #dns-provider.settings-select {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231e293b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e") !important;
}



/* Universal dropdown option styling for ALL selects */
.settings-container select.setting-input option,
.settings-container select.settings-select option,
.settings-container select option {
    background: #2a2a3a !important;
    background-color: #2a2a3a !important;
    color: #ffffff !important;
    padding: 6px 10px !important;
    border: none !important;
    outline: none !important;
}

.settings-container select.setting-input option:hover,
.settings-container select.settings-select option:hover,
.settings-container select option:hover {
    background: #3a3a4a !important;
    background-color: #3a3a4a !important;
    color: #ffffff !important;
}

.settings-container select.setting-input option:checked,
.settings-container select.setting-input option:selected,
.settings-container select.settings-select option:checked,
.settings-container select.settings-select option:selected,
.settings-container select option:checked,
.settings-container select option:selected {
    background: #5a0dd6 !important;
    background-color: #5a0dd6 !important;
    color: #ffffff !important;
}

/* Themed custom selects (native option popups ignore app theme colors) */
.sb-select {
    position: relative;
    display: inline-flex;
    align-items: stretch;
    vertical-align: middle;
    max-width: 100%;
    flex-shrink: 0;
}

.sb-select .settings-container select.sb-select-native {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
    opacity: 0 !important;
    pointer-events: none !important;
    background-image: none !important;
}

.sb-select-trigger {
    appearance: none;
    -webkit-appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    min-width: 140px;
    min-height: 28px;
    padding: 5px 8px 5px 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #ffffff;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.3;
    cursor: pointer;
    outline: none;
    text-align: left;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.sb-select-trigger::after {
    content: '';
    flex-shrink: 0;
    width: 12px;
    height: 12px;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 12px;
    opacity: 0.85;
}

.sb-select-trigger:hover {
    border-color: rgba(124, 58, 237, 0.55);
    background: rgba(255, 255, 255, 0.08);
}

.sb-select.open .sb-select-trigger,
.sb-select-trigger:focus {
    border-color: #7c3aed;
    box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.2);
}

.sb-select.disabled .sb-select-trigger {
    opacity: 0.5;
    cursor: not-allowed;
}

.sb-select-label {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sb-select-menu {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    min-width: 100%;
    z-index: 1200;
    max-height: 220px;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 4px;
    background: #1a1a24;
    border: 1px solid rgba(124, 58, 237, 0.45);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
    box-sizing: border-box;
}

.sb-select.open .sb-select-menu,
body > .sb-select-menu.sb-select-menu-open {
    display: block;
}

body > .sb-select-menu {
    position: fixed !important;
    z-index: 2147483647 !important;
    /* Absolute offsets from .sb-select-menu (top: calc(100%+4px), left/right: 0)
       are wrong once portaled to body. Do not use !important on left/top here;
       JS must be able to set layout-unit coordinates for chrome zoom. */
    top: auto;
    left: auto;
    right: auto;
    bottom: auto;
    /* Escape settings overflow clipping; JS clamps to the visual viewport. */
    overflow-x: hidden;
    overflow-y: auto;
    max-width: none;
    box-sizing: border-box;
}

/* CSS zoom + body overflow:hidden can clip fixed menus at the window edge.
   Keep clipping on the settings shell, not on html/body, while a menu is open. */
html.sb-select-open,
html.sb-select-open body {
    overflow: visible !important;
}

html.sb-select-open .settings-container {
    overflow: hidden;
}

.sb-select-option {
    appearance: none;
    -webkit-appearance: none;
    display: block;
    width: 100%;
    padding: 6px 10px;
    margin: 0;
    border: none;
    background: transparent;
    color: #f3f3f7;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.3;
    text-align: left;
    cursor: pointer;
    border-radius: 4px;
    white-space: nowrap;
    box-sizing: border-box;
}

.sb-select-option:hover,
.sb-select-option:focus {
    outline: none;
    background: rgba(124, 58, 237, 0.28);
    color: #ffffff;
}

.sb-select-option.active {
    background: #7c3aed;
    color: #ffffff;
}

.sb-select-option:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.sb-select.width-settings-select .sb-select-trigger,
.sb-select.width-settings-select {
    width: 200px;
}

[data-theme="stealth"] .sb-select-trigger {
    background: rgba(124, 58, 237, 0.08);
    border-color: rgba(168, 85, 247, 0.25);
    color: #f5f3ff;
}

[data-theme="stealth"] .sb-select-trigger:hover {
    background: rgba(124, 58, 237, 0.15);
    border-color: rgba(168, 85, 247, 0.5);
}

[data-theme="stealth"] .sb-select.open .sb-select-trigger,
[data-theme="stealth"] .sb-select-trigger:focus {
    border-color: #a855f7;
    box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.3);
}

[data-theme="stealth"] .sb-select-menu {
    background: #241a38;
    border-color: rgba(168, 85, 247, 0.45);
}

[data-theme="stealth"] .sb-select-option {
    color: #f5f3ff;
}

[data-theme="stealth"] .sb-select-option:hover,
[data-theme="stealth"] .sb-select-option:focus {
    background: rgba(124, 58, 237, 0.35);
}

[data-theme="stealth"] .sb-select-option.active {
    background: #7c3aed;
    color: #ffffff;
}

[data-theme="stealth-glass"] .sb-select-trigger {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.2);
    color: #f2f4f8;
}

[data-theme="stealth-glass"] .sb-select-trigger:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.4);
}

[data-theme="stealth-glass"] .sb-select.open .sb-select-trigger,
[data-theme="stealth-glass"] .sb-select-trigger:focus {
    border-color: rgba(255, 255, 255, 0.6);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.2);
}

[data-theme="stealth-glass"] .sb-select-menu {
    background: #14141c;
    border-color: rgba(255, 255, 255, 0.22);
}

[data-theme="stealth-glass"] .sb-select-option {
    color: #f2f4f8;
}

[data-theme="stealth-glass"] .sb-select-option:hover,
[data-theme="stealth-glass"] .sb-select-option:focus {
    background: rgba(255, 255, 255, 0.12);
}

[data-theme="stealth-glass"] .sb-select-option.active {
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
}

[data-theme="light"] .sb-select-trigger {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.15);
    color: #1e293b;
}

[data-theme="light"] .sb-select-trigger::after {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231e293b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
}

[data-theme="light"] .sb-select-trigger:hover {
    background: rgba(0, 0, 0, 0.08);
    border-color: rgba(124, 58, 237, 0.5);
}

[data-theme="light"] .sb-select.open .sb-select-trigger,
[data-theme="light"] .sb-select-trigger:focus {
    border-color: #7c3aed;
    box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.2);
}

[data-theme="light"] .sb-select-menu {
    background: #ffffff;
    border-color: rgba(124, 58, 237, 0.35);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.16);
}

[data-theme="light"] .sb-select-option {
    color: #1e293b;
}

[data-theme="light"] .sb-select-option:hover,
[data-theme="light"] .sb-select-option:focus {
    background: rgba(124, 58, 237, 0.12);
    color: #1e293b;
}

[data-theme="light"] .sb-select-option.active {
    background: #7c3aed;
    color: #ffffff;
}

/* Theme Selector */
.theme-selector {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 16px;
    flex: 1 1 auto;
    min-width: 0;
}

.theme-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    padding: 8px 10px;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
    color: #a1a1aa;
    font-size: 11px;
    font-weight: 500;
}

.theme-option:hover {
    border-color: rgba(73, 0, 194, 0.55);
    transform: none;
}

.theme-option.active {
    border-color: rgba(73, 0, 194, 0.85);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(73, 0, 194, 0.25);
}

.theme-option:disabled,
.theme-option.theme-option-disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
    filter: grayscale(0.65);
}

.theme-option:disabled:hover,
.theme-option.theme-option-disabled:hover {
    border-color: rgba(255, 255, 255, 0.1);
}

.settings-section-disabled {
    opacity: 0.42;
    pointer-events: none;
    filter: grayscale(0.55);
}

.settings-section-disabled .theme-beta-tag {
    filter: none;
    opacity: 1;
}

/* Controls the organization owns. Greyed out with a padlock so the reason is
   obvious before someone tries to change one and is refused. */
[data-business-locked] {
    opacity: 0.5;
    cursor: not-allowed;
}

.setting-item:has([data-business-locked]) .setting-label::after,
.setting-row:has([data-business-locked]) .setting-label::after {
    content: " \1F512 Managed";
    margin-left: 8px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--accent-text, #c4b5fd);
    opacity: 0.9;
    white-space: nowrap;
}

.toggle-input[data-business-locked] + .toggle {
    opacity: 0.45;
    cursor: not-allowed;
}

.theme-preview {
    width: 48px;
    height: 30px;
    border-radius: 4px;
    position: relative;
}

.theme-preview.powerup-theme-preview {
    background: linear-gradient(135deg, #5a0dd6 0%, #12203a 55%, #0a0a0f 100%);
}

.black-preview {
    background: linear-gradient(135deg, #2a2a2a 0%, #111111 48%, #000000 100%);
}

.dark-preview {
    background: linear-gradient(135deg, #1f2937, #374151);
}

.light-preview {
    background: linear-gradient(135deg, #d4cec4, #bdb5a8);
}

.stealth-preview {
    background: linear-gradient(135deg, #7c3aed, #a855f7);
}

.stealth-glass-preview {
    background:
        linear-gradient(135deg, rgba(40, 40, 48, 0.95), rgba(8, 8, 12, 1)),
        linear-gradient(135deg, #0a0a0c 0%, #000000 100%);
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.stealth-float-preview {
    background:
        radial-gradient(circle at 30% 40%, rgba(196, 181, 253, 0.45), transparent 45%),
        linear-gradient(135deg, #12141c 0%, #0b0c10 55%, #1a1030 100%);
    border: 1px solid rgba(255, 255, 255, 0.22);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.theme-option-label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.theme-beta-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 0.04em;
    line-height: 1.3;
    color: #fde68a;
    background: rgba(245, 158, 11, 0.22);
    border: 1px solid rgba(245, 158, 11, 0.45);
}

[data-theme="light"] .theme-beta-tag {
    color: #92400e;
    background: rgba(245, 158, 11, 0.18);
    border-color: rgba(180, 83, 9, 0.35);
}

.theme-beta-tag.is-beta {
    color: #a5f3fc;
    background: rgba(6, 182, 212, 0.22);
    border-color: rgba(6, 182, 212, 0.5);
}

[data-theme="light"] .theme-beta-tag.is-beta {
    color: #155e75;
    background: rgba(6, 182, 212, 0.16);
    border-color: rgba(14, 116, 144, 0.4);
}

.theme-custom-slot {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: stretch;
}

.theme-option-add .theme-add-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.06);
    border: 1px dashed rgba(255, 255, 255, 0.28);
    color: #e4e4e7;
    font-size: 22px;
    font-weight: 600;
    line-height: 1;
}

.theme-option-add:hover {
    border-color: rgba(90, 13, 214, 0.85);
    color: #ffffff;
}

.theme-option-custom-wrap {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    position: relative;
}

.theme-option-custom {
    position: relative;
    z-index: 1;
    cursor: pointer;
    width: 100%;
    margin: 0;
}

.theme-card-actions {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin: 0;
    position: relative;
    z-index: 5;
    pointer-events: auto;
}

.theme-card-actions button {
    width: auto;
    min-width: 36px;
    height: 22px;
    padding: 0 8px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
    color: #c4b5fd;
    cursor: pointer;
    font-size: 10px;
    line-height: 20px;
    border-radius: var(--stealth-cut-sm);
    pointer-events: auto;
    position: relative;
    z-index: 6;
}

.theme-card-actions button:hover {
    border-color: rgba(90, 13, 214, 0.7);
    color: #ffffff;
}

.theme-card-actions .theme-card-delete:hover {
    border-color: rgba(239, 68, 68, 0.7);
    color: #fca5a5;
}

.bookmark-modal.custom-theme-editor {
    width: min(820px, calc(100vw - 40px));
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.custom-theme-editor-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 220px);
    gap: 16px;
    margin: 4px 0 16px;
    align-items: start;
    min-width: 0;
}

.custom-theme-roles {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    max-height: none;
    overflow: visible;
    min-width: 0;
}

.custom-theme-role {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    text-align: left;
    padding: 8px 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.03);
    color: inherit;
    cursor: pointer;
    border-radius: var(--stealth-cut);
    box-sizing: border-box;
}

.custom-theme-role:hover {
    border-color: rgba(90, 13, 214, 0.55);
}

.custom-theme-role.active {
    border-color: rgba(90, 13, 214, 0.85);
    box-shadow: 0 0 0 2px rgba(90, 13, 214, 0.22);
    z-index: 6;
}

.custom-theme-role-swatch {
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: var(--stealth-cut-sm);
}

.custom-theme-role-copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.custom-theme-role-copy strong {
    font-size: 12px;
    font-weight: 600;
}

.custom-theme-role-copy span {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.55);
}

.custom-theme-role-grad,
.custom-theme-role-alpha {
    margin-left: 0;
    flex: 0 0 auto;
    padding: 2px 7px;
    font-size: 10px;
    font-weight: 600;
    line-height: 1.4;
    color: #c4b5fd;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--stealth-cut-sm);
    cursor: pointer;
    white-space: nowrap;
}

.custom-theme-role-grad:hover,
.custom-theme-role-alpha:hover {
    border-color: rgba(90, 13, 214, 0.7);
    color: #ffffff;
}

.custom-theme-role-grad.is-on {
    border-color: rgba(90, 13, 214, 0.85);
    background: rgba(90, 13, 214, 0.28);
    color: #ffffff;
}

.custom-theme-role-alpha-panel,
.custom-theme-role-grad-panel {
    position: absolute;
    right: 8px;
    top: calc(100% + 4px);
    z-index: 20;
    display: flex;
    align-items: center;
    padding: 8px 10px;
    background: rgba(18, 18, 26, 0.98);
    border: 1px solid rgba(90, 13, 214, 0.55);
    border-radius: var(--stealth-cut-sm);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
}

.custom-theme-role-grad-panel {
    left: 8px;
    right: 8px;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
}

.custom-theme-role-alpha-panel[hidden],
.custom-theme-role-grad-panel[hidden] {
    display: none;
}

.custom-theme-role-alpha-panel input[type="range"] {
    width: 140px;
    accent-color: #5a0dd6;
    cursor: pointer;
}

.custom-theme-role-grad-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    color: #e4e4e7;
    cursor: pointer;
}

.custom-theme-role-grad-toggle input {
    accent-color: #5a0dd6;
}

.custom-theme-grad-bar {
    position: relative;
    height: 16px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background-color: #222;
    cursor: default;
    touch-action: none;
}

.custom-theme-grad-bar.is-off {
    opacity: 0.4;
    pointer-events: none;
}

.custom-theme-grad-stop {
    position: absolute;
    top: 50%;
    width: 14px;
    height: 14px;
    margin-left: -7px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.55), 0 1px 4px rgba(0, 0, 0, 0.45);
    transform: translateY(-50%);
    cursor: ew-resize;
    z-index: 2;
}

.custom-theme-grad-stop.active {
    width: 16px;
    height: 16px;
    margin-left: -8px;
    box-shadow: 0 0 0 2px #5a0dd6, 0 0 0 3px rgba(0, 0, 0, 0.55);
    z-index: 3;
}

@container settings (max-width: 720px) {
    .custom-theme-roles {
        grid-template-columns: minmax(0, 1fr);
        max-height: 320px;
        overflow-y: auto;
    }
}

.custom-theme-wheel-wrap {
    display: flex;
    justify-content: center;
    min-width: 0;
    max-width: 100%;
}

.ct-wheel-host {
    width: 100%;
    max-width: 200px;
    min-width: 0;
    box-sizing: border-box;
}

.ct-wheel {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    user-select: none;
    touch-action: none;
}

.ct-hue-ring {
    position: absolute;
    inset: 0;
    background: conic-gradient(
        from 0deg,
        #ff0000,
        #ffff00,
        #00ff00,
        #00ffff,
        #0000ff,
        #ff00ff,
        #ff0000
    );
    border-radius: 50%;
}

.ct-hue-ring::after {
    content: '';
    position: absolute;
    inset: 18px;
    background: #17171d;
    border-radius: 50%;
}

.ct-sv {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 46%;
    height: 46%;
    transform: translate(-50%, -50%);
    z-index: 2;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: var(--stealth-cut-lg);
    overflow: hidden;
    touch-action: none;
}

.ct-sv-fill {
    width: 100%;
    height: 100%;
}

.ct-sv-knob,
.ct-hue-knob {
    position: absolute;
    width: 14px;
    height: 14px;
    margin: -7px 0 0 -7px;
    border: 2px solid #ffffff;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.45);
    border-radius: 50%;
    pointer-events: none;
    z-index: 3;
}

.ct-hue-knob {
    z-index: 4;
}

.ct-rgb-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px;
    margin-top: 12px;
    min-width: 0;
}

.ct-rgb-row label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 0;
    font-size: 11px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.55);
    min-width: 0;
}

.ct-rgb-row input,
.bookmark-modal.custom-theme-editor .ct-rgb-row input {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: inherit;
    font: inherit;
    font-size: 13px;
    padding: 7px 8px;
    outline: none;
    margin-bottom: 0;
    border-radius: var(--stealth-cut-sm);
}

.ct-hex-label {
    grid-column: 1 / -1;
}

.bookmark-modal.custom-theme-editor input[type="text"] {
    box-sizing: border-box;
    max-width: 100%;
}

@container settings (max-width: 640px) {
    .custom-theme-editor-body {
        grid-template-columns: 1fr;
    }

    .ct-wheel-host {
        max-width: 180px;
        margin: 0 auto;
    }
}

[data-theme="light"] .custom-theme-role-copy span,
[data-theme="light"] .ct-rgb-row label,
[data-theme="light"] .custom-theme-role-grad-toggle {
    color: rgba(26, 23, 20, 0.62);
}

[data-theme="light"] .ct-hue-ring::after {
    background: #e5dfd5;
}

/* About Page */
.about-content {
    text-align: center;
    padding: 20px 16px;
}

.about-logo {
    max-width: 56px;
    width: 56px;
    height: auto;
    margin-bottom: 10px;
    object-fit: contain;
    background: transparent;
    background-color: transparent;
    border: none;
    box-shadow: none;
    border-radius: 0;
}

.version-info h3,
.about-version-line {
    font-size: 12px;
    font-weight: 600;
    font-variant: normal;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    width: 100%;
}

.version-info p {
    color: #a1a1aa;
    font-size: 12px;
    margin-bottom: 6px;
}

/* Purple PRIVATE pill (mirrors Stealth Windows About badge) */
.private-indicator-animated {
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 7px;
    font-weight: 700;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    line-height: 1;
    padding: 0 5px;
    height: 12px;
    min-height: 12px;
    border: 1px solid rgba(139, 92, 246, 0.45);
    border-radius: 2px;
    background:
        linear-gradient(180deg, rgba(139, 92, 246, 0.12), rgba(91, 33, 182, 0.18)),
        linear-gradient(
            90deg,
            #8b5cf6 0%,
            #a78bfa 25%,
            #c4b5fd 50%,
            #a78bfa 75%,
            #8b5cf6 100%
        );
    background-size: auto, 200% auto;
    -webkit-background-clip: padding-box, text;
    background-clip: padding-box, text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    animation: private-gradient-flow 2.4s linear infinite;
    box-shadow:
        0 0 5px rgba(139, 92, 246, 0.28),
        inset 0 0 3px rgba(139, 92, 246, 0.1);
    vertical-align: middle;
}

.private-indicator-animated[data-visible="true"],
.private-indicator-animated:not([hidden]) {
    display: inline-flex;
}

@keyframes private-gradient-flow {
    0% { background-position: 0 0, 0% center; }
    100% { background-position: 0 0, 200% center; }
}

.about-site {
    margin-bottom: 14px !important;
}

.about-site-link {
    color: #ddd6fe;
    text-decoration: none;
    font-weight: 500;
}

.about-site-link:hover {
    color: #f5f3ff;
    text-decoration: underline;
}

.build-date {
    font-size: 11px;
    color: #71717a;
    margin-bottom: 12px !important;
}

.about-links {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Responsive Design */
@container settings-shell (max-width: 1200px) {
    .settings-nav {
        width: 210px;
    }

    .settings-content {
        margin-left: 0;
        padding: 24px;
    }
}

@container settings (max-width: 1000px) {
    #plugins-page .plugin-container {
        padding: 0 24px;
    }

    #plugins-page .plugin-header {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
    
    #plugins-page .header-actions {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    #plugins-page .plugin-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    #plugins-page .plugin-controls {
        flex-direction: column;
        gap: 12px;
    }
    
    #plugins-page .filter-container {
        width: 100%;
    }
    
    #plugins-page .filter-container .settings-container select {
        width: 100%;
    }
}

@container settings-shell (max-width: 768px) {
    .settings-content {
        margin-left: 0;
        padding: 16px 10px;
    }
}

@container settings (max-width: 768px) {
    .setting-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .theme-selector {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .about-links {
        flex-direction: column;
        align-items: center;
    }
    
    #plugins-page .plugin-list {
        grid-template-columns: 1fr;
    }
}

/* Password Manager Styles */
.password-manager-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
}

.password-search {
    position: relative;
    flex: 1;
    min-width: 0;
    max-width: 320px;
}

.password-search i {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.45);
    font-size: 11px;
    pointer-events: none;
}

.password-search input {
    width: 100%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    padding: 5px 8px 5px 26px;
    color: #ffffff;
    font-size: 12px;
    line-height: 1.3;
    outline: none;
    transition: border-color 0.15s ease;
}

.password-search input:focus {
    border-color: rgba(73, 0, 194, 0.75);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 0 2px rgba(73, 0, 194, 0.2);
}

.password-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.password-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
    font-size: 11px;
    color: #a1a1aa;
}

.password-meta strong {
    color: #e4e4e7;
    font-weight: 600;
}

.password-meta-sep {
    opacity: 0.5;
}

.password-list-container {
    margin-bottom: 12px;
    min-height: 0;
}

.password-list-container.settings-section {
    padding: 0;
    overflow: hidden;
}

.password-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.password-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 0;
    transition: background 0.12s ease;
}

.password-item:last-child {
    border-bottom: none;
}

.password-item:hover {
    background: rgba(73, 0, 194, 0.12);
    border-color: rgba(255, 255, 255, 0.06);
    transform: none;
}

.password-favicon {
    width: 22px;
    height: 22px;
    background: rgba(73, 0, 194, 0.35);
    border: 1px solid rgba(73, 0, 194, 0.45);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: #ddd6fe;
    flex-shrink: 0;
    overflow: hidden;
}

.password-favicon-img {
    width: 16px;
    height: 16px;
    object-fit: contain;
    display: block;
}

.password-favicon-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 10px;
    font-weight: 600;
    line-height: 1;
}

.password-info {
    flex: 1;
    min-width: 0;
}

.password-name {
    font-size: 12px;
    font-weight: 550;
    color: #ffffff;
    margin-bottom: 1px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.3;
}

.password-last-worked {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 6px;
    border-radius: 8px 2px 2px 2px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: #c4b5fd;
    background: rgba(90, 13, 214, 0.28);
    vertical-align: middle;
}

.password-details {
    font-size: 11px;
    color: #a1a1aa;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.3;
}

.password-actions-cell {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.password-action-btn {
    width: 24px;
    height: 24px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 4px;
    color: rgba(255, 255, 255, 0.55);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}

.password-action-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.password-action-btn.favorite:hover,
.password-action-btn.favorite.active {
    background: rgba(251, 191, 36, 0.12);
    border-color: rgba(251, 191, 36, 0.28);
    color: #fbbf24;
}

.password-action-btn.launch:hover {
    background: rgba(56, 189, 248, 0.12);
    border-color: rgba(56, 189, 248, 0.28);
    color: #7dd3fc;
}

.password-action-btn.copy:hover {
    background: rgba(34, 197, 94, 0.12);
    border-color: rgba(34, 197, 94, 0.25);
    color: #4ade80;
}

.password-action-btn.edit:hover {
    background: rgba(73, 0, 194, 0.18);
    border-color: rgba(73, 0, 194, 0.35);
    color: #c4b5fd;
}

.password-action-btn.delete:hover {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.25);
    color: #f87171;
}

.password-filter-btn.active {
    background: rgba(251, 191, 36, 0.14);
    border-color: rgba(251, 191, 36, 0.4);
    color: #fbbf24;
}

/* Light Theme Password Manager Support */
[data-theme="light"] .password-manager-toolbar {
    background: transparent;
    border: none;
}

[data-theme="light"] .password-search i {
    color: rgba(0, 0, 0, 0.45);
}

[data-theme="light"] .password-search input {
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.12);
    color: #1e293b;
}

[data-theme="light"] .password-search input:focus {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(73, 0, 194, 0.55);
}

[data-theme="light"] .password-meta {
    color: #4a4a4a;
}

[data-theme="light"] .password-meta strong {
    color: #1a1a1a;
}

[data-theme="light"] .password-item {
    background: transparent;
    border-bottom-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .password-item:hover {
    background: rgba(73, 0, 194, 0.08);
}

[data-theme="light"] .password-favicon {
    background: rgba(73, 0, 194, 0.12);
    border-color: rgba(73, 0, 194, 0.25);
    color: #5b21b6;
}

[data-theme="light"] .password-name {
    color: #1a1a1a;
}

[data-theme="light"] .password-last-worked {
    color: #5b21b6;
    background: rgba(73, 0, 194, 0.12);
}

[data-theme="light"] .password-details {
    color: #4a4a4a;
}

[data-theme="light"] .password-action-btn {
    background: transparent;
    color: rgba(0, 0, 0, 0.5);
}

[data-theme="light"] .password-action-btn:hover {
    background: rgba(0, 0, 0, 0.06);
    color: #1e293b;
}

[data-theme="light"] .password-action-btn.favorite:hover,
[data-theme="light"] .password-action-btn.favorite.active {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.35);
    color: #d97706;
}

[data-theme="light"] .password-action-btn.launch:hover {
    background: rgba(14, 165, 233, 0.12);
    border-color: rgba(14, 165, 233, 0.32);
    color: #0284c7;
}

[data-theme="light"] .password-filter-btn.active {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.4);
    color: #d97706;
}

[data-theme="light"] .password-empty-state {
    color: #4a4a4a;
}

.bookmark-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.bookmark-view-toggle {
    display: flex;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 3px;
    gap: 2px;
}

.bookmark-view-toggle button {
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.55);
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    padding: 7px 10px;
    border-radius: 8px;
    cursor: pointer;
}

.bookmark-view-toggle button.active {
    background: rgba(123, 92, 255, 0.18);
    color: #f4f2fb;
}

.bookmark-pages-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    padding: 4px 2px;
}

.bookmark-pages-toggle .toggle {
    flex-shrink: 0;
}

.bookmark-pages-toggle-label {
    white-space: nowrap;
}

.bookmark-per-page-wrap {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.55);
}

.bookmark-per-page-wrap[hidden] {
    display: none !important;
}

.bookmark-per-page-wrap .settings-container select {
    appearance: none;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    color: #f4f2fb;
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    padding: 7px 28px 7px 10px;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%238a869b' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

.bookmark-per-page-wrap .settings-container select:focus {
    outline: none;
    border-color: rgba(123, 92, 255, 0.55);
}

.bookmark-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 14px;
    padding: 4px 0 2px;
}

.bookmark-pagination[hidden] {
    display: none !important;
}

.bookmark-pagination .btn-secondary {
    min-width: 36px;
    padding: 8px 12px;
}

.bookmark-pagination .btn-secondary:disabled {
    opacity: 0.35;
    cursor: default;
}

.bookmark-page-status {
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.55);
    min-width: 110px;
    text-align: center;
}

.bookmark-sort-num {
    width: 36px;
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.35);
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.bookmark-organized-list {
    flex-direction: column;
    gap: 10px;
}

.bookmark-folder {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
    overflow: hidden;
}

.bookmark-folder-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    cursor: pointer;
    user-select: none;
}

.bookmark-folder-header:hover {
    background: rgba(255, 255, 255, 0.04);
}

.bookmark-folder-swatch,
.bookmark-folder-favicon {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #fff;
    font-size: 13px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.06);
}

.bookmark-folder-favicon img {
    width: 18px;
    height: 18px;
    object-fit: contain;
}

.bookmark-folder-meta {
    flex: 1;
    min-width: 0;
}

.bookmark-folder-name {
    font-weight: 700;
    font-size: 13.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bookmark-folder-count,
.bookmark-folder-empty {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
}

.bookmark-folder-empty {
    padding: 10px 14px;
}

.bookmark-folder-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    opacity: 1;
}

.bookmark-folder-name[data-rename-group] {
    cursor: text;
}

.bookmark-folder-chevron {
    color: rgba(255, 255, 255, 0.45);
    font-size: 11px;
    transition: transform 0.18s ease;
}

.bookmark-folder.collapsed .bookmark-folder-chevron {
    transform: rotate(-90deg);
}

.bookmark-folder.collapsed .bookmark-folder-body {
    display: none;
}

.bookmark-folder-body .password-item {
    border-radius: 0;
}

.bookmark-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
}

.bookmark-modal-backdrop.open {
    display: flex;
}

.bookmark-modal {
    width: min(420px, 100%);
    background: #17171d;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.bookmark-modal h3 {
    margin: 0 0 6px;
    font-size: 17px;
}

.bookmark-modal p {
    margin: 0 0 14px;
    color: rgba(255, 255, 255, 0.55);
    font-size: 13px;
}

.bookmark-modal label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.55);
    margin-bottom: 6px;
}

.bookmark-modal input[type="text"] {
    width: 100%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: inherit;
    font: inherit;
    font-size: 14px;
    padding: 10px 12px;
    outline: none;
    margin-bottom: 14px;
}

.bookmark-color-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.bookmark-color-swatch {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    padding: 0;
}

.bookmark-color-swatch.selected {
    border-color: #fff;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.2);
}

.bookmark-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.bookmark-move-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 280px;
    overflow: auto;
    margin-bottom: 14px;
}

.bookmark-move-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    color: inherit;
    font: inherit;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
}

.bookmark-move-option:hover {
    border-color: rgba(123, 92, 255, 0.5);
    background: rgba(123, 92, 255, 0.12);
}

.bookmark-move-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

[data-theme="light"] .bookmark-view-toggle {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .bookmark-view-toggle button {
    color: rgba(0, 0, 0, 0.5);
}

[data-theme="light"] .bookmark-pages-toggle {
    color: rgba(0, 0, 0, 0.65);
}

[data-theme="light"] .bookmark-per-page-wrap {
    color: rgba(0, 0, 0, 0.5);
}

[data-theme="light"] .bookmark-per-page-wrap .settings-container select {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.1);
    color: #111;
}

[data-theme="light"] .bookmark-page-status {
    color: rgba(0, 0, 0, 0.5);
}

[data-theme="light"] .bookmark-sort-num {
    color: rgba(0, 0, 0, 0.35);
}

[data-theme="light"] .bookmark-view-toggle button.active {
    background: rgba(73, 0, 194, 0.12);
    color: #1a1a1a;
}

[data-theme="light"] .bookmark-folder {
    border-color: rgba(0, 0, 0, 0.08);
    background: rgba(0, 0, 0, 0.02);
}

[data-theme="light"] .bookmark-folder-header:hover {
    background: rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .bookmark-folder-count,
[data-theme="light"] .bookmark-folder-empty,
[data-theme="light"] .bookmark-folder-chevron {
    color: rgba(0, 0, 0, 0.45);
}

[data-theme="light"] .bookmark-modal {
    background: #fff;
    border-color: rgba(0, 0, 0, 0.1);
    color: #1a1a1a;
}

[data-theme="light"] .bookmark-modal p,
[data-theme="light"] .bookmark-modal label {
    color: rgba(0, 0, 0, 0.55);
}

[data-theme="light"] .bookmark-modal input[type="text"] {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.12);
    color: #1a1a1a;
}

[data-theme="light"] .bookmark-move-option {
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.08);
    color: #1a1a1a;
}

[data-theme="light"] .password-modal-content {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .password-modal-header h3 {
    color: #1a1a1a;
}

[data-theme="light"] .password-modal-close {
    color: rgba(0, 0, 0, 0.45);
}

[data-theme="light"] .password-modal-close:hover {
    background: rgba(0, 0, 0, 0.06);
    color: #1a1a1a;
}

[data-theme="light"] .password-form-field label {
    color: #4a4a4a;
}

[data-theme="light"] .password-form-field input,
[data-theme="light"] .generated-password-display input,
[data-theme="light"] .master-password-field input {
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.12);
    color: #1a1a1a;
}

[data-theme="light"] .password-form-field input:focus,
[data-theme="light"] .generated-password-display input:focus,
[data-theme="light"] .master-password-field input:focus {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(73, 0, 194, 0.55);
    box-shadow: 0 0 0 2px rgba(73, 0, 194, 0.15);
}

[data-theme="light"] .password-toggle,
[data-theme="light"] .password-generate {
    color: rgba(0, 0, 0, 0.45);
}

[data-theme="light"] .password-toggle:hover,
[data-theme="light"] .password-generate:hover {
    background: rgba(0, 0, 0, 0.06);
    color: #1a1a1a;
}

[data-theme="light"] .password-form-actions,
[data-theme="light"] .password-generator-actions {
    border-top-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .generator-option label {
    color: #1a1a1a;
}

[data-theme="dark"] .password-modal-content {
    background: #12121a;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .password-modal-header h3 {
    color: #e4e4e7;
}

[data-theme="dark"] .password-form-field label {
    color: #a1a1aa;
}

[data-theme="dark"] .password-form-field input,
[data-theme="dark"] .generated-password-display input,
[data-theme="dark"] .master-password-field input {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

[data-theme="stealth"] .password-modal-content {
    background: #161022;
    border: 1px solid rgba(196, 181, 253, 0.16);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
}

[data-theme="stealth"] .password-modal-header h3 {
    color: #eae2ff;
}

[data-theme="stealth"] .password-modal-close {
    color: rgba(234, 226, 255, 0.55);
}

[data-theme="stealth"] .password-modal-close:hover {
    background: rgba(196, 181, 253, 0.12);
    color: #eae2ff;
}

[data-theme="stealth"] .password-form-field label {
    color: rgba(234, 226, 255, 0.7);
}

[data-theme="stealth"] .password-form-field input,
[data-theme="stealth"] .generated-password-display input,
[data-theme="stealth"] .master-password-field input {
    background: rgba(196, 181, 253, 0.06);
    border: 1px solid rgba(196, 181, 253, 0.16);
    color: #eae2ff;
}

[data-theme="stealth"] .password-form-field input:focus,
[data-theme="stealth"] .generated-password-display input:focus,
[data-theme="stealth"] .master-password-field input:focus {
    border-color: rgba(124, 58, 237, 0.75);
    background: rgba(196, 181, 253, 0.1);
    box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.2);
}

[data-theme="stealth"] .password-toggle,
[data-theme="stealth"] .password-generate {
    color: rgba(234, 226, 255, 0.55);
}

[data-theme="stealth"] .password-toggle:hover,
[data-theme="stealth"] .password-generate:hover {
    background: rgba(196, 181, 253, 0.12);
    color: #eae2ff;
}

[data-theme="stealth"] .password-form-actions,
[data-theme="stealth"] .password-generator-actions {
    border-top-color: rgba(196, 181, 253, 0.14);
}

[data-theme="stealth"] .generator-option label {
    color: rgba(234, 226, 255, 0.9);
}

[data-theme="stealth"] .password-favicon {
    background: rgba(124, 58, 237, 0.28);
    border-color: rgba(196, 181, 253, 0.28);
    color: #ddd6fe;
}

[data-theme="stealth-glass"] .password-modal-content {
    background: #1e1c28 !important;
    border: 1px solid rgba(255, 255, 255, 0.14) !important;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

[data-theme="stealth-glass"] .password-modal-header h3 {
    color: #f2f4f8;
}

[data-theme="stealth-glass"] .password-modal-close {
    color: rgba(242, 244, 248, 0.55);
}

[data-theme="stealth-glass"] .password-modal-close:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #f2f4f8;
}

[data-theme="stealth-glass"] .password-form-field label {
    color: rgba(242, 244, 248, 0.7);
}

[data-theme="stealth-glass"] .password-form-field input,
[data-theme="stealth-glass"] .generated-password-display input,
[data-theme="stealth-glass"] .master-password-field input {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.14) !important;
    color: #f2f4f8 !important;
}

[data-theme="stealth-glass"] .password-form-field input:focus,
[data-theme="stealth-glass"] .generated-password-display input:focus,
[data-theme="stealth-glass"] .master-password-field input:focus {
    border-color: rgba(73, 0, 194, 0.75) !important;
    background: rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 0 0 2px rgba(73, 0, 194, 0.2);
}

[data-theme="stealth-glass"] .password-toggle,
[data-theme="stealth-glass"] .password-generate {
    color: rgba(242, 244, 248, 0.55);
}

[data-theme="stealth-glass"] .password-toggle:hover,
[data-theme="stealth-glass"] .password-generate:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #f2f4f8;
}

[data-theme="stealth-glass"] .password-form-actions,
[data-theme="stealth-glass"] .password-generator-actions {
    border-top-color: rgba(255, 255, 255, 0.12);
}

[data-theme="stealth-glass"] .generator-option label {
    color: rgba(242, 244, 248, 0.9);
}

[data-theme="stealth-glass"] .password-favicon {
    background: rgba(73, 0, 194, 0.3);
    border-color: rgba(255, 255, 255, 0.14);
    color: #ddd6fe;
}

.password-empty-state {
    text-align: left;
    padding: 14px 12px;
    color: #a1a1aa;
}

.password-vault-lock {
    margin: 12px 0 18px;
}

.password-vault-lock-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 18px 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
}

.password-vault-lock-card > i {
    font-size: 18px;
    color: #a78bfa;
}

.password-vault-lock-card h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
}

.password-vault-lock-card > p {
    margin: 0;
    font-size: 12px;
    line-height: 1.45;
    color: #a1a1aa;
    max-width: 420px;
}

.password-vault-lock-card .password-input-container {
    width: min(360px, 100%);
}

.password-vault-lock-card .password-input-container[hidden] {
    display: none !important;
}

.setting-item:has(.password-unlock-options) {
    flex-direction: column;
    align-items: stretch;
}

.setting-item:has(.password-unlock-options) .setting-info {
    flex: none;
    width: 100%;
    min-width: 0;
}

.password-unlock-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    margin-top: 10px;
}

.password-unlock-option {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    column-gap: 10px;
    row-gap: 2px;
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
    cursor: pointer;
}

.password-unlock-option input[type="radio"] {
    grid-row: 1 / span 2;
    align-self: center;
    margin: 0;
    accent-color: #7c3aed;
}

.password-unlock-option-title {
    font-size: 13px;
    font-weight: 600;
    color: inherit;
}

.password-unlock-option-desc {
    font-size: 12px;
    color: #a1a1aa;
    line-height: 1.4;
}

.password-unlock-option:has(input:checked) {
    border-color: rgba(124, 58, 237, 0.55);
    background: rgba(124, 58, 237, 0.12);
}

.password-master-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

[data-theme="light"] .password-unlock-option {
    border-color: rgba(0, 0, 0, 0.1);
    background: rgba(0, 0, 0, 0.02);
}

[data-theme="light"] .password-unlock-option-desc {
    color: #71717a;
}

[data-theme="light"] .password-unlock-option:has(input:checked) {
    border-color: rgba(124, 58, 237, 0.45);
    background: rgba(124, 58, 237, 0.08);
}

.password-vault-lock-error {
    margin: 0;
    font-size: 12px;
    color: #f87171;
}

.password-vault-lock-card .btn-primary {
    margin-top: 4px;
}

[data-theme="light"] .password-vault-lock-card {
    border-color: rgba(0, 0, 0, 0.08);
    background: rgba(0, 0, 0, 0.02);
}

[data-theme="light"] .password-vault-lock-card > p {
    color: #52525b;
}

.password-empty-state i,
.password-empty-state h3,
.password-empty-state .btn-primary {
    display: none;
}

.password-empty-state p {
    font-size: 11px;
    line-height: 1.4;
    margin: 0;
    max-width: none;
}

/* Password Modal Styles */
.password-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.password-modal.show {
    display: flex;
}

.password-modal-content {
    background: #12121a;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    min-width: min(380px, calc(100vw - 24px));
    max-width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
}

.password-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px 0 14px;
    margin-bottom: 12px;
}

.password-modal-header h3 {
    font-size: 12px;
    font-weight: 600;
    font-variant: normal;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #e4e4e7;
}

.password-modal-close {
    background: none;
    border: none;
    font-size: 18px;
    color: rgba(255, 255, 255, 0.55);
    cursor: pointer;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.12s ease, color 0.12s ease;
}

.password-modal-close:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.ai-memory-modal-content {
    min-width: min(520px, calc(100vw - 24px));
    width: min(560px, calc(100vw - 24px));
}

.ai-memory-manage-body {
    padding: 0 14px 14px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ai-memory-manage-note {
    margin: 0;
    font-size: 11px;
    line-height: 1.4;
    color: #a1a1aa;
}

.ai-memory-add-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.ai-memory-add-row textarea.setting-input,
.ai-memory-edit-input {
    flex: 1;
    min-width: 0;
    width: 100%;
    resize: vertical;
    min-height: 52px;
    font-family: inherit;
}

.ai-memory-list {
    max-height: min(48vh, 420px);
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.02);
}

.ai-memory-empty {
    padding: 16px 12px;
    font-size: 11px;
    line-height: 1.4;
    color: #a1a1aa;
    text-align: center;
}

.ai-memory-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.ai-memory-item:last-child {
    border-bottom: none;
}

.ai-memory-item:hover {
    background: rgba(73, 0, 194, 0.12);
}

.ai-memory-item-main {
    flex: 1;
    min-width: 0;
}

.ai-memory-item-text {
    font-size: 12px;
    line-height: 1.4;
    color: #ffffff;
    white-space: pre-wrap;
    word-break: break-word;
}

.ai-memory-item-meta {
    margin-top: 4px;
    font-size: 10px;
    color: #a1a1aa;
}

.ai-memory-item-actions {
    display: flex;
    flex-shrink: 0;
    gap: 6px;
}

.ai-memory-manage-actions {
    padding-top: 10px;
    justify-content: space-between;
}

[data-theme="light"] .ai-memory-manage-note,
[data-theme="light"] .ai-memory-empty,
[data-theme="light"] .ai-memory-item-meta {
    color: #4a4a4a;
}

[data-theme="light"] .ai-memory-list {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .ai-memory-item {
    border-bottom-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .ai-memory-item:hover {
    background: rgba(73, 0, 194, 0.08);
}

[data-theme="light"] .ai-memory-item-text {
    color: #1a1a1a;
}

.password-form {
    padding: 0 14px 14px 14px;
}

.password-form-field {
    margin-bottom: 10px;
}

.password-form-field label {
    display: block;
    font-size: 11px;
    font-weight: 500;
    color: #a1a1aa;
    margin-bottom: 4px;
}

.password-form-field input {
    width: 100%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    padding: 6px 8px;
    color: #ffffff;
    font-size: 12px;
    outline: none;
    transition: border-color 0.15s ease;
}

.password-form-field input:focus {
    border-color: rgba(73, 0, 194, 0.75);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 0 2px rgba(73, 0, 194, 0.2);
}

.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-wrapper input {
    padding-right: 64px;
}

.password-toggle,
.password-generate {
    position: absolute;
    right: 3px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 4px;
    width: 24px;
    height: 24px;
    color: rgba(255, 255, 255, 0.55);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    transition: background 0.12s ease, color 0.12s ease;
}

.password-generate {
    right: 30px;
}

.password-toggle:hover,
.password-generate:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.password-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 32px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Password Generator Modal */
.password-generator-content {
    padding: 0 24px 24px 24px;
}

.generated-password-display {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.generated-password-display input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 12px;
    color: #ffffff;
    font-family: var(--browser-ui-font, 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Open Sans', sans-serif);
    font-size: 14px;
    outline: none;
}

.btn-copy {
    background: rgba(34, 197, 94, 0.2);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 8px;
    color: #22c55e;
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-copy:hover {
    background: rgba(34, 197, 94, 0.3);
}

.password-generator-options {
    margin-bottom: 24px;
}

.generator-option {
    margin-bottom: 16px;
}

.generator-option label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
}

.generator-option input[type="checkbox"] {
    accent-color: #7c3aed;
}

.generator-option input[type="range"] {
    width: 100%;
    margin-top: 8px;
    accent-color: #7c3aed;
}

.opacity-slider-group {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 220px;
}

.opacity-slider {
    -webkit-appearance: none !important;
    appearance: none !important;
    width: 160px;
    height: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    outline: none;
    accent-color: #7c3aed;
    cursor: pointer;
}

.opacity-slider::-webkit-slider-thumb {
    -webkit-appearance: none !important;
    appearance: none !important;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #a78bfa;
    border: 2px solid #1a1228;
    box-shadow: 0 0 0 1px rgba(167, 139, 250, 0.45);
    cursor: pointer;
}

.opacity-slider-value {
    min-width: 44px;
    text-align: right;
    font-variant-numeric: tabular-nums;
    color: rgba(255, 255, 255, 0.85);
    font-size: 13px;
}

[data-theme="light"] .opacity-slider {
    background: rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .opacity-slider::-webkit-slider-thumb {
    border-color: #ffffff;
    box-shadow: 0 0 0 1px rgba(124, 58, 237, 0.35);
}

[data-theme="light"] .opacity-slider-value {
    color: #334155;
}

/* When background opacity is reduced, punch the settings floor to the
   desktop acrylic key color. Panels stay frosted / readable on top. */
/* Never acrylic-key Stealth Float Settings; that theme keys chrome chips only. */
html.transparent-bg:not([data-theme="stealth-float"]),
html.transparent-bg:not([data-theme="stealth-float"]) body,
html.transparent-bg:not([data-theme="stealth-float"])[data-theme] body,
html.transparent-bg:not([data-theme="stealth-float"]) .settings-container,
html.transparent-bg:not([data-theme="stealth-float"]) .settings-content,
html.transparent-bg[data-theme="dark"] .settings-container,
html.transparent-bg[data-theme="dark"] .settings-content,
html.transparent-bg[data-theme="stealth"] .settings-container,
html.transparent-bg[data-theme="stealth"] .settings-content,
html.transparent-bg[data-theme="stealth"] body .settings-container,
html.transparent-bg[data-theme="stealth"] body .settings-content,
html.transparent-bg[data-theme="stealth-glass"] .settings-container,
html.transparent-bg[data-theme="stealth-glass"] .settings-content,
html.transparent-bg[data-theme="light"] .settings-container,
html.transparent-bg[data-theme="light"] .settings-content {
    background: #010103 !important;
    background-color: #010103 !important;
    background-image: none !important;
}

html.transparent-bg:not([data-theme="stealth-float"]) .settings-section,
html.transparent-bg:not([data-theme="stealth-float"]) .memory-usage-container,
html.transparent-bg:not([data-theme="stealth-float"]) .settings-nav,
html.transparent-bg[data-theme="dark"] .settings-section,
html.transparent-bg[data-theme="dark"] .memory-usage-container,
html.transparent-bg[data-theme="dark"] .settings-nav,
html.transparent-bg[data-theme="stealth"] .settings-section,
html.transparent-bg[data-theme="stealth"] .memory-usage-container,
html.transparent-bg[data-theme="stealth"] .settings-nav,
html.transparent-bg[data-theme="stealth"] body .settings-section,
html.transparent-bg[data-theme="stealth"] body .settings-nav,
html.transparent-bg[data-theme="stealth-glass"] .settings-section,
html.transparent-bg[data-theme="stealth-glass"] .memory-usage-container,
html.transparent-bg[data-theme="stealth-glass"] .settings-nav,
html.transparent-bg[data-theme="light"] .settings-section,
html.transparent-bg[data-theme="light"] .memory-usage-container,
html.transparent-bg[data-theme="light"] .settings-nav {
    background: rgba(22, 20, 32, calc(0.18 + (var(--background-opacity, 1) * 0.62))) !important;
    background-color: rgba(22, 20, 32, calc(0.18 + (var(--background-opacity, 1) * 0.62))) !important;
    background-image: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

html.transparent-bg[data-theme="light"] .settings-section,
html.transparent-bg[data-theme="light"] .memory-usage-container,
html.transparent-bg[data-theme="light"] .settings-nav {
    background: rgba(244, 241, 234, calc(0.22 + (var(--background-opacity, 1) * 0.65))) !important;
    background-color: rgba(244, 241, 234, calc(0.22 + (var(--background-opacity, 1) * 0.65))) !important;
}

/* Background opacity must never wash out settings text or icons. */
html.transparent-bg:not(.chrome-fg-faded),
html.transparent-bg:not(.chrome-fg-faded) body,
html.transparent-bg:not(.chrome-fg-faded) .settings-container,
html.transparent-bg:not(.chrome-fg-faded) .settings-content,
html.transparent-bg:not(.chrome-fg-faded) .settings-section,
html.transparent-bg:not(.chrome-fg-faded) .settings-nav,
html.transparent-bg:not(.chrome-fg-faded) .nav-item,
html.transparent-bg:not(.chrome-fg-faded) .setting-item,
html.transparent-bg:not(.chrome-fg-faded) label,
html.transparent-bg:not(.chrome-fg-faded) h2,
html.transparent-bg:not(.chrome-fg-faded) h3,
html.transparent-bg:not(.chrome-fg-faded) .setting-description,
html.transparent-bg:not(.chrome-fg-faded) .toggle-text,
html.transparent-bg:not(.chrome-fg-faded) .theme-option-label,
html.transparent-bg:not(.chrome-fg-faded) .opacity-slider-value,
html.transparent-bg:not(.chrome-fg-faded) .nav-item i,
html.transparent-bg:not(.chrome-fg-faded) .settings-nav i,
html.transparent-bg:not(.chrome-fg-faded) .btn-secondary i,
html.transparent-bg:not(.chrome-fg-faded) .theme-option i {
    color: inherit;
    -webkit-text-fill-color: unset;
    opacity: 1 !important;
}

/* Foreground opacity: text/logos/icons only inside settings. */
html.chrome-fg-faded .settings-container label,
html.chrome-fg-faded .settings-container h2,
html.chrome-fg-faded .settings-container h3,
html.chrome-fg-faded .settings-container .setting-description,
html.chrome-fg-faded .settings-container .toggle-text,
html.chrome-fg-faded .settings-container .nav-item,
html.chrome-fg-faded .settings-container .nav-item i,
html.chrome-fg-faded .settings-container .theme-option-label,
html.chrome-fg-faded .settings-container .opacity-slider-value,
html.chrome-fg-faded .settings-container .btn-secondary,
html.chrome-fg-faded .settings-container .btn-secondary i,
html.chrome-fg-faded .settings-container .memory-usage-container {
    opacity: var(--ui-foreground-opacity, 1) !important;
}

.password-generator-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Master Password Modal */
.master-password-content {
    padding: 0 24px 24px 24px;
}

.master-password-info {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 20px;
    background: rgba(90, 13, 214, 0.1);
    border: 1px solid rgba(90, 13, 214, 0.2);
    border-radius: 6px;
    margin-bottom: 24px;
}

.master-password-info i {
    color: #5a0dd6;
    font-size: 20px;
    margin-top: 2px;
    flex-shrink: 0;
}

.master-password-info p {
    margin: 0;
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    line-height: 1.5;
}

.password-input-section {
    margin-bottom: 20px;
}

.password-input-section label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 8px;
}

.password-input-container {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-container input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 12px 44px 12px 12px;
    color: #ffffff;
    font-size: 14px;
    outline: none;
    transition: all 0.2s ease;
}

.password-input-container input:focus {
    border-color: #5a0dd6;
    box-shadow: 0 0 0 2px rgba(90, 13, 214, 0.2);
}

.password-input-container input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.password-input-container .password-toggle {
    position: absolute;
    right: 8px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.password-input-container .password-toggle:hover {
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.1);
}

.master-password-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 24px;
}

.master-password-actions .btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.9);
    padding: 12px 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.master-password-actions .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.master-password-actions .btn-primary {
    background: linear-gradient(135deg, #5a0dd6 0%, #7b2fcc 100%);
    border: 1px solid #5a0dd6;
    border-radius: 8px;
    color: #ffffff;
    padding: 12px 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.master-password-actions .btn-primary:hover {
    background: linear-gradient(135deg, #6b1ae6 0%, #8c40dc 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(90, 13, 214, 0.3);
}

.master-password-actions .btn-primary:active {
    transform: translateY(0);
}

/* Export Modal */
.export-content {
    padding: 0 24px 24px 24px;
}

.export-warning {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 8px;
    margin-bottom: 24px;
}

.export-warning i {
    color: #ef4444;
    font-size: 18px;
    margin-top: 2px;
}

.export-warning p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    line-height: 1.5;
}

.export-options {
    margin-bottom: 24px;
}

.export-options label {
    display: block;
    margin-bottom: 12px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
}

.export-options input[type="radio"] {
    margin-right: 8px;
}

.export-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    border: none;
    border-radius: 5px;
    color: white;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-danger:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* Plugin Manager Container */
.plugin-manager-container {
    width: 100%;
    height: 80vh;
    max-height: 80vh;
    overflow: hidden;
    background: transparent;
    border-radius: 0;
}

.plugin-manager-container iframe {
    width: 100% !important;
    height: 100% !important;
    border: none !important;
    background: transparent !important;
    overflow: hidden !important;
}

/* Scroll Styling */
.settings-nav::-webkit-scrollbar {
    width: 6px;
}

.settings-nav::-webkit-scrollbar-track {
    background: transparent;
}

.settings-nav::-webkit-scrollbar-thumb {
    background: rgba(124, 58, 237, 0.3);
    border-radius: 3px;
}

.settings-nav::-webkit-scrollbar-thumb:hover {
    background: rgba(124, 58, 237, 0.5);
}

/* Stealth AI settings */
.setting-item:has(.ai-provider-options) {
    flex-direction: column;
    align-items: stretch;
}

.setting-item:has(.ai-provider-options) .setting-info {
    flex: none;
    width: 100%;
    min-width: 0;
}

.ai-provider-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    flex: 1 1 100%;
    width: 100%;
    min-width: 0;
}

.ai-provider-option {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    cursor: pointer;
}

.ai-provider-option input[type="radio"] {
    margin: 0;
}

@container settings-shell (max-width: 720px) {
    .settings-container {
        flex-direction: column;
    }

    .settings-mobile-bar {
        display: flex;
        position: relative;
        z-index: 40;
        width: 100%;
    }

    .settings-nav-backdrop {
        display: block;
        pointer-events: none;
        opacity: 0;
        transition: opacity 0.2s ease;
    }

    .settings-container.is-mobile-nav-open .settings-nav-backdrop {
        pointer-events: auto;
        opacity: 1;
    }

    .settings-nav {
        position: absolute;
        top: var(--settings-mobile-bar-h, 44px);
        left: 0;
        bottom: 0;
        width: min(300px, 88%);
        height: auto;
        max-height: none;
        align-self: auto;
        border-right: 1px solid rgba(255, 255, 255, 0.1);
        border-bottom: none;
        flex: none;
        overflow-x: hidden;
        overflow-y: auto;
        transform: translateX(-110%);
        visibility: hidden;
        pointer-events: none;
        z-index: 30;
        display: flex;
        flex-direction: column;
        transition: transform 0.22s ease, visibility 0s linear 0.22s;
    }

    .settings-container.is-mobile-nav-open .settings-nav {
        transform: translateX(0);
        visibility: visible;
        pointer-events: auto;
        transition: transform 0.22s ease, visibility 0s linear 0s;
    }

    .settings-nav .nav-header > div:first-child,
    .settings-nav .return-to-browser {
        display: none;
    }

    .settings-content {
        flex: 1 1 auto;
        width: 100%;
        height: auto;
        min-height: 0;
        overflow-x: hidden;
        overflow-y: auto;
    }

    .nav-header,
    .settings-search-container {
        flex: 0 0 auto;
    }

    .nav-sections {
        flex: 1 1 auto;
        min-height: 0;
        overflow: visible;
    }
}

@container settings (max-width: 560px) {
    .setting-item {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .setting-info {
        flex: none;
        width: 100%;
        min-width: 0;
    }

    .setting-item > .setting-input,
    .setting-item > .settings-container select.setting-input,
    .setting-item > .settings-select,
    .setting-item > .action-buttons,
    .setting-item > .toggle-group,
    .setting-item > .theme-selector {
        width: 100%;
        max-width: 100%;
    }

    .settings-select,
    #ai-chatgpt-model {
        width: 100%;
        min-width: 0;
        max-width: 100%;
    }

    #ai-chatgpt-account-actions {
        width: 100%;
    }

    .ai-provider-option {
        flex: 1 1 100%;
    }
}

/* Phone-width tier: keep scaling instead of clipping once the dock squeezes
   the settings pane below ~420px. */
@container settings-shell (max-width: 420px) {
    .settings-nav {
        width: min(300px, 92%);
        padding: 8px 0;
    }

    .nav-sections,
    .settings-search-container,
    .nav-header {
        padding-left: 6px;
        padding-right: 6px;
    }

    .settings-content {
        padding: 10px 8px;
    }

    .settings-page {
        padding: 0 0 20px 0;
    }

    .settings-section {
        padding: 8px;
        margin-bottom: 8px;
    }
}

@container settings-shell (max-width: 340px) {
    .memory-stats-grid {
        grid-template-columns: 1fr;
    }
}

@container settings (max-width: 420px) {
    .setting-item > .setting-input,
    .setting-item > .settings-container select.setting-input,
    .setting-item > .settings-select,
    .setting-item > .action-buttons,
    .setting-item > .toggle-group,
    .setting-item > .theme-selector,
    .setting-item .sb-select,
    .setting-item .sb-select-trigger {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .action-buttons,
    .theme-selector,
    .about-links,
    .toolbar-tool-row {
        flex-wrap: wrap;
    }

    .action-buttons > *,
    .about-links > * {
        flex: 1 1 100%;
    }

    .toolbar-tool-email-options {
        padding-left: 0;
    }

    .toolbar-tool-email-field,
    .toolbar-tool-email-field:has(#toolbar-email-provider) {
        max-width: 100%;
    }

    .toolbar-tool-email-field:has(#toolbar-email-provider) .setting-input,
    .toolbar-tool-email-field:has(#toolbar-email-provider) .sb-select,
    .toolbar-tool-email-field:has(#toolbar-email-provider) .sb-select-trigger {
        width: 100%;
        min-width: 0;
    }

    #plugins-page .plugin-container {
        padding: 0;
    }

    #plugins-page .plugin-stats {
        grid-template-columns: 1fr;
    }

    .custom-theme-roles,
    .custom-theme-editor-body,
    .welcome-pinned-row {
        grid-template-columns: 1fr;
    }
}

.ai-token-bar {
    width: 100%;
    height: 8px;
    margin-top: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.ai-token-bar-fill {
    height: 100%;
    width: 0%;
    border-radius: inherit;
    background: linear-gradient(90deg, #7c3aed, #4f46e5);
    transition: width 0.25s ease;
}

.ai-local-endpoints {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.ai-endpoint-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    width: 100%;
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.ai-endpoint-card:hover {
    border-color: rgba(124, 58, 237, 0.55);
    background: rgba(124, 58, 237, 0.12);
}

.ai-endpoint-card span {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.65);
}

#ai-license-gate-note.ai-ok {
    color: #86efac;
}

#license-settings-section.license-section-active {
    border: 1px solid rgba(34, 197, 94, 0.35);
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.08) 0%, rgba(34, 197, 94, 0.02) 100%);
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.1);
}

.license-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
    margin-top: 6px;
    transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}

.license-status-badge .license-status-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
}

.license-status-badge .license-status-icon svg {
    width: 18px;
    height: 18px;
    display: block;
}

.license-status-badge .license-status-content {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.license-status-badge .license-status-label {
    font-weight: 600;
}

.license-status-badge .license-status-sub {
    font-size: 10px;
    font-weight: 400;
    opacity: 0.85;
}

.license-status-badge.license-active {
    color: #86efac;
    background: rgba(34, 197, 94, 0.16);
    border: 1px solid rgba(34, 197, 94, 0.45);
    box-shadow: 0 0 14px rgba(34, 197, 94, 0.2);
}

.license-status-badge.license-active .license-status-sub {
    color: #4ade80;
}

.license-status-badge.license-inactive {
    color: #fca5a5;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.license-status-badge.license-inactive .license-status-sub {
    color: #f87171;
}

.license-status-badge.license-checking {
    color: #a1a1aa;
    background: rgba(161, 161, 170, 0.08);
    border: 1px solid rgba(161, 161, 170, 0.2);
}

.ai-gated.ai-disabled {
    opacity: 0.55;
    pointer-events: none;
}

.crypto-gated.crypto-disabled {
    opacity: 0.55;
    pointer-events: none;
}

.rss-gated.rss-disabled {
    opacity: 0.55;
    pointer-events: none;
}

#ai-chatgpt-account-actions {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    gap: 8px;
}

#ai-chatgpt-connect-btn {
    display: inline-flex;
    visibility: visible;
}

#ai-chatgpt-model {
    display: inline-block;
    min-width: 220px;
    max-width: 320px;
    background: rgba(255, 255, 255, 0.06) !important;
    border: 1px solid rgba(255, 255, 255, 0.18) !important;
    color: #ffffff !important;
}

#ai-chatgpt-model:disabled {
    opacity: 0.75;
    cursor: not-allowed;
}

.vpn-error-detail {
    display: block;
    margin-top: 8px;
    padding: 10px 12px;
    border-radius: 8px;
    background: rgba(239, 68, 68, 0.14);
    border: 1px solid rgba(248, 113, 113, 0.45);
    color: #fecaca;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    max-width: 520px;
    white-space: normal;
}

.vpn-error-detail:empty,
.vpn-error-detail[hidden] {
    display: none !important;
}

.notification-container {
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 2147483647;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
    max-width: min(440px, calc(100vw - 24px));
}

.notification-container .notification {
    pointer-events: auto;
}

/* Stealth toast (guidelines: frosted fill, cut corners, purple accent) */
body > .stealth-toast {
    position: fixed !important;
    z-index: 2147483647 !important;
}

.stealth-toast {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 2147483647;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    max-width: min(380px, calc(100vw - 32px));
    padding: 12px 14px;
    box-sizing: border-box;
    border-radius: var(--stealth-cut-lg, 14px 4px 4px 4px);
    overflow: hidden;
    clip-path: inset(0 round 14px 4px 4px 4px);
    -webkit-clip-path: inset(0 round 14px 4px 4px 4px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(22, 22, 30, 0.88);
    backdrop-filter: blur(22px) saturate(160%);
    -webkit-backdrop-filter: blur(22px) saturate(160%);
    box-shadow:
        0 16px 48px rgba(0, 0, 0, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.16);
    color: #f3f3f7;
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Open Sans', sans-serif;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.35;
    pointer-events: auto;
    opacity: 0;
    transform: translateX(18px);
    transition: opacity 0.22s ease, transform 0.22s ease;
}

.stealth-toast.show {
    opacity: 1;
    transform: translateX(0);
}

.stealth-toast.hiding {
    opacity: 0;
    transform: translateX(18px);
}

.stealth-toast-sheen {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.14) 0%, rgba(255, 255, 255, 0.03) 42%, rgba(90, 13, 214, 0.12) 100%);
    opacity: 0.85;
}

.stealth-toast-icon,
.stealth-toast-message {
    position: relative;
    z-index: 1;
}

.stealth-toast-icon {
    flex-shrink: 0;
    margin-top: 1px;
    font-size: 14px;
    color: #a78bfa;
}

.stealth-toast-message {
    flex: 1;
    min-width: 0;
}

.stealth-toast-success {
    border-color: rgba(90, 13, 214, 0.55);
    box-shadow:
        0 16px 48px rgba(0, 0, 0, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.16),
        0 0 0 1px rgba(90, 13, 214, 0.18);
}

.stealth-toast-success .stealth-toast-icon { color: #c4b5fd; }

.stealth-toast-error {
    border-color: rgba(239, 68, 68, 0.55);
}

.stealth-toast-error .stealth-toast-icon { color: #f87171; }

.stealth-toast-warning {
    border-color: rgba(245, 158, 11, 0.55);
}

.stealth-toast-warning .stealth-toast-icon { color: #fbbf24; }

.stealth-toast-info .stealth-toast-icon { color: #a78bfa; }

[data-theme="light"] .stealth-toast {
    background: rgba(248, 246, 242, 0.9);
    border-color: rgba(73, 0, 194, 0.28);
    color: #1c1916;
    box-shadow:
        0 16px 40px rgba(28, 25, 22, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

[data-theme="light"] .stealth-toast-sheen {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.55) 0%, rgba(90, 13, 214, 0.08) 100%);
}

[data-theme="light"] .stealth-toast-success .stealth-toast-icon,
[data-theme="light"] .stealth-toast-info .stealth-toast-icon {
    color: #5a0dd6;
}

[data-theme="stealth-glass"] .stealth-toast,
[data-theme="stealth-float"] .stealth-toast {
    background: rgba(14, 16, 22, 0.9);
}

@media (prefers-reduced-motion: reduce) {
    .stealth-toast {
        transition: opacity 0.15s ease;
        transform: none;
    }
    .stealth-toast.show,
    .stealth-toast.hiding {
        transform: none;
    }

    .settings-nav-backdrop,
    .settings-nav {
        transition: none;
    }
}

/* SearXNG engine picker */
.searxng-engines-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.searxng-engines-toolbar {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 8px 0 12px;
}

.searxng-engines-search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.searxng-engines-search-box > i {
    position: absolute;
    left: 12px;
    color: rgba(255, 255, 255, 0.45);
    font-size: 12px;
    pointer-events: none;
}

.searxng-engines-search-box .setting-input {
    width: 100%;
    padding-left: 34px;
}

.searxng-engines-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.searxng-category-chip {
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.78);
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.searxng-category-chip:hover {
    background: rgba(255, 255, 255, 0.08);
}

.searxng-category-chip.active {
    background: rgba(124, 58, 237, 0.22);
    border-color: rgba(124, 58, 237, 0.55);
    color: #ede9fe;
}

.searxng-engines-list {
    max-height: 420px;
    overflow: auto;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.18);
}

.searxng-engine-group-title {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 8px 12px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.55);
    background: rgba(12, 12, 16, 0.96);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.searxng-engine-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.searxng-engine-row:last-child {
    border-bottom: none;
}

.searxng-engine-name {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.9);
}

.searxng-engine-row .toggle-group {
    flex-shrink: 0;
}

[data-theme="light"] .searxng-engines-search-box > i {
    color: rgba(0, 0, 0, 0.4);
}

[data-theme="light"] .searxng-category-chip {
    border-color: rgba(0, 0, 0, 0.12);
    background: rgba(0, 0, 0, 0.03);
    color: rgba(0, 0, 0, 0.72);
}

[data-theme="light"] .searxng-category-chip.active {
    background: rgba(124, 58, 237, 0.12);
    border-color: rgba(124, 58, 237, 0.4);
    color: #5b21b6;
}

[data-theme="light"] .searxng-engines-list {
    border-color: rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.7);
}

[data-theme="light"] .searxng-engine-group-title {
    color: rgba(0, 0, 0, 0.5);
    background: rgba(248, 248, 250, 0.98);
    border-bottom-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .searxng-engine-row {
    border-bottom-color: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .searxng-engine-name {
    color: rgba(0, 0, 0, 0.88);
}

/* Stealth Welcome Page settings */
.welcome-settings-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 22px 18px 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--stealth-cut-panel, 22px 4px 4px 4px);
}

.welcome-preview-logo-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.welcome-preview-logo {
    width: 52px;
    height: 52px;
    object-fit: contain;
}

.welcome-preview-logo.is-custom {
    width: auto;
    max-width: 180px;
    max-height: 72px;
    border-radius: var(--stealth-cut-sm, 8px 2px 2px 2px);
}

.welcome-preview-wordmark {
    height: 18px;
    width: auto;
    object-fit: contain;
    opacity: 0.92;
}

.welcome-preview-tagline {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.55);
    letter-spacing: 0.02em;
}

.welcome-preview-search {
    width: min(360px, 100%);
    padding: 10px 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--stealth-cut, 12px 2px 2px 2px);
    background: rgba(0, 0, 0, 0.25);
    color: rgba(255, 255, 255, 0.4);
    font-size: 12px;
}

/* Live map of the Welcome Page dashboard arrangement */
.welcome-settings-preview.is-dashboard {
    padding: 12px;
}

.welcome-settings-preview.is-dashboard > .welcome-preview-logo-wrap,
.welcome-settings-preview.is-dashboard > .welcome-preview-tagline,
.welcome-settings-preview.is-dashboard > .welcome-preview-search {
    display: none !important;
}

.welcome-preview-dashboard {
    position: relative;
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    aspect-ratio: 24 / 12;
    max-height: 360px;
    border-radius: var(--stealth-cut, 12px 2px 2px 2px);
    background:
        linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px) 0 0 / 100% calc(100% / var(--welcome-dash-rows, 8)),
        linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px) 0 0 / 4.1667% 100%,
        rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.08);
    overflow: auto;
}

.welcome-preview-dashboard[hidden] {
    display: none;
}

.welcome-preview-dash-tile {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1px 3px;
    border-radius: 4px;
    border: 1px solid rgba(167, 139, 250, 0.4);
    background: rgba(124, 58, 237, 0.14);
    color: rgba(255, 255, 255, 0.78);
    font-size: 8px;
    line-height: 1.05;
    letter-spacing: 0.01em;
    text-align: center;
    overflow: hidden;
}

.welcome-preview-dash-tile > span {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    pointer-events: none;
}

.welcome-preview-dash-tile[data-short] {
    padding: 0 2px;
}

.welcome-preview-dash-tile[data-short] > span {
    font-size: 7px;
    line-height: 1;
}

/* Too small to hold a word without clipping it: the name lives in the tooltip. */
.welcome-preview-dash-tile[data-tiny] > span {
    display: none;
}

.welcome-preview-dash-tile {
    cursor: grab;
    user-select: none;
    touch-action: none;
}

.welcome-preview-dash-tile:hover {
    border-color: rgba(167, 139, 250, 0.75);
    background: rgba(124, 58, 237, 0.24);
}

.welcome-preview-dash-tile.is-editing {
    cursor: grabbing;
    border-color: rgba(196, 181, 253, 0.95);
    background: rgba(139, 92, 246, 0.3);
    z-index: 5;
}

.welcome-preview-dash-grip {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 8px;
    height: 8px;
    cursor: nwse-resize;
    background:
        linear-gradient(135deg, transparent 55%, rgba(255, 255, 255, 0.55) 55%);
    opacity: 0;
}

.welcome-preview-dash-tile:hover > .welcome-preview-dash-grip,
.welcome-preview-dash-tile.is-editing > .welcome-preview-dash-grip {
    opacity: 1;
}

.welcome-preview-dash-hint {
    margin: 8px 0 0;
    text-align: center;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.45);
}

[data-theme="light"] .welcome-preview-dash-hint {
    color: rgba(0, 0, 0, 0.5);
}

.welcome-preview-dash-tile[data-kind="hero"] {
    border-color: rgba(96, 165, 250, 0.35);
    background: rgba(37, 99, 235, 0.16);
}

.welcome-preview-dash-tile[data-kind="embed"] {
    border-color: rgba(52, 211, 153, 0.38);
    background: rgba(16, 185, 129, 0.16);
}

.welcome-preview-dash-empty {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    text-align: center;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
}

[data-theme="light"] .welcome-preview-dashboard {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .welcome-preview-dash-tile {
    color: rgba(0, 0, 0, 0.75);
}

.welcome-custom-image-preview-wrap {
    margin: 0 0 8px;
    padding: 0 4px;
}

.welcome-custom-image-preview {
    display: block;
    width: 100%;
    max-height: 120px;
    object-fit: contain;
    border-radius: var(--stealth-cut-panel, 22px 4px 4px 4px);
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.welcome-pinned-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 4px;
    margin-bottom: 4px;
}

.welcome-pinned-row {
    display: grid;
    grid-template-columns: 1fr 1.4fr auto auto;
    gap: 8px;
    align-items: center;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--stealth-cut-panel, 22px 4px 4px 4px);
}

.welcome-pinned-row input {
    width: 100%;
    min-width: 0;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--stealth-cut-sm, 8px 2px 2px 2px);
    color: inherit;
    padding: 8px 10px;
    font-size: 12px;
}

.welcome-pinned-row .welcome-pinned-remove,
.welcome-pinned-row .welcome-pinned-move,
.welcome-dashboard-row .welcome-pinned-remove {
    width: 32px;
    height: 32px;
    min-width: 32px;
    max-width: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    justify-self: end;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    color: inherit;
    border-radius: var(--stealth-cut-sm, 8px 2px 2px 2px);
    cursor: pointer;
}

.welcome-pinned-row .welcome-pinned-remove:hover,
.welcome-pinned-row .welcome-pinned-move:hover,
.welcome-dashboard-row .welcome-pinned-remove:hover {
    background: rgba(90, 13, 214, 0.28);
    border-color: rgba(90, 13, 214, 0.45);
}

.welcome-pinned-empty {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.45);
    padding: 4px 2px 8px;
}

[data-theme="light"] .welcome-settings-preview,
[data-theme="light"] .welcome-pinned-row {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .welcome-preview-tagline,
[data-theme="light"] .welcome-pinned-empty {
    color: rgba(0, 0, 0, 0.5);
}

[data-theme="light"] .welcome-preview-search,
[data-theme="light"] .welcome-pinned-row input {
    background: rgba(255, 255, 255, 0.7);
    border-color: rgba(0, 0, 0, 0.1);
    color: rgba(0, 0, 0, 0.55);
}

@container settings (max-width: 720px) {
    .welcome-pinned-row {
        grid-template-columns: 1fr;
    }
    .welcome-pinned-row .welcome-pinned-remove,
    .welcome-pinned-row .welcome-pinned-move {
        width: 100%;
    }
}

.welcome-dashboard-row {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.2fr) auto;
    gap: 8px;
    align-items: center;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--stealth-cut-panel, 22px 4px 4px 4px);
}

.welcome-dashboard-row .welcome-dash-url:not([hidden]) {
    grid-column: 1 / -2;
}

.welcome-dashboard-row .welcome-dash-url:not([hidden]) ~ .welcome-pinned-remove {
    grid-column: -2 / -1;
    grid-row: 2;
}

.home-dashboard-add-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.home-dashboard-add-row .setting-input {
    min-width: 160px;
}

.home-dashboard-profiles-block {
    margin-top: 14px;
}

.home-dashboard-profiles-panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0 0 8px;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid rgba(167, 139, 250, 0.22);
    background: rgba(90, 13, 214, 0.06);
}

.home-dashboard-profiles-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.home-dashboard-profiles-row .setting-input {
    flex: 1 1 180px;
    min-width: 140px;
}

.home-dashboard-profiles-status {
    margin: 0;
    min-height: 1.2em;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.62);
}

html[data-theme="light"] .home-dashboard-profiles-panel,
html.theme-light .home-dashboard-profiles-panel {
    background: rgba(90, 13, 214, 0.08);
    border-color: rgba(90, 13, 214, 0.2);
}

html[data-theme="light"] .home-dashboard-profiles-status,
html.theme-light .home-dashboard-profiles-status {
    color: rgba(28, 25, 22, 0.62);
}

@container settings (max-width: 900px) {
    .welcome-dashboard-row {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .welcome-dashboard-row .welcome-dash-type,
    .welcome-dashboard-row .welcome-dash-title,
    .welcome-dashboard-row .welcome-dash-url:not([hidden]) {
        grid-column: 1;
    }

    .welcome-dashboard-row .welcome-pinned-remove,
    .welcome-dashboard-row .welcome-dash-url:not([hidden]) ~ .welcome-pinned-remove {
        grid-column: 2;
        grid-row: 1;
    }
}
