
#settings-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 500;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
}

#settings-modal-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.settings-modal {
    width: min(780px, calc(100% - 32px));
    height: min(600px, calc(100% - 32px));
    background: var(--bg-main, #18181b);
    border: 1px solid var(--border-color, #2e2e36);
    border-radius: 8px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.96);
    transition: transform 0.22s cubic-bezier(0.34, 1.3, 0.64, 1);
}

#settings-modal-overlay.show .settings-modal {
    transform: scale(1);
}

.settings-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border-color, #24242a);
    background: var(--bg-header, #141416);
    flex-shrink: 0;
}

.settings-title {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-primary, #e0e0e0);
}

.settings-close-btn {
    background: transparent;
    border: none;
    color: #777777;
    cursor: pointer;
    display: flex;
    align-items: center;
    border-radius: 4px;
    padding: 3px;
    transition: color 0.15s ease;
}

.settings-close-btn:hover {
    color: #ffffff;
}

/* ---- Patch Log --------------------------------------------------------- */

#patchlog-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 540;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
}

#patchlog-modal-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.patchlog-modal {
    width: min(620px, calc(100% - 32px));
    height: min(520px, calc(100% - 32px));
    background: var(--bg-main, #18181b);
    border: 1px solid var(--border-color, #2e2e36);
    border-radius: 8px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.96);
    transition: transform 0.22s cubic-bezier(0.34, 1.3, 0.64, 1);
}

#patchlog-modal-overlay.show .patchlog-modal {
    transform: scale(1);
}

.patchlog-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border-color, #24242a);
    background: var(--bg-header, #141416);
    flex-shrink: 0;
}

.patchlog-title-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary, #e0e0e0);
}

.patchlog-title {
    font-size: 13.5px;
    font-weight: 600;
}

.patchlog-badge {
    font-size: 10.5px;
    background: rgba(37, 99, 235, 0.16);
    color: #6f9bff;
    border: 1px solid rgba(37, 99, 235, 0.3);
    padding: 2px 7px;
    border-radius: 10px;
    letter-spacing: 0.04em;
}

.patchlog-body {
    flex: 1;
    overflow-y: auto;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.patchlog-entry {
    border: 1px solid var(--border-color, #2a2a32);
    border-radius: 7px;
    background: var(--bg-header, #141416);
    padding: 12px 14px;
}

.patchlog-entry-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 6px;
}

.patchlog-version {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    background: var(--bg-btn, #22222a);
    border: 1px solid var(--border-btn, #33333d);
    color: var(--text-primary, #dcdce2);
}

.patchlog-date {
    font-size: 11px;
    color: var(--text-dim, #7a7a86);
}

.patchlog-entry-title {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-primary, #e0e0e0);
    margin-bottom: 7px;
}

.patchlog-list {
    margin: 0;
    padding-left: 18px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.patchlog-list li {
    font-size: 12px;
    line-height: 1.45;
    color: var(--text-muted, #a8a8b4);
}

/* The overlay sits above the frosted surfaces, so it needs the light scrim
   treatment too - otherwise it stays dark over a light theme. */
body.theme-light #patchlog-modal-overlay {
    background: rgba(15, 20, 30, 0.42);
}

body.theme-light .patchlog-badge {
    background: rgba(37, 99, 235, 0.1);
    color: #1d4ed8;
}

.settings-modal-layout {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.settings-sidebar {
    width: 155px;
    background: var(--bg-sidebar, #141417);
    border-right: 1px solid var(--border-color, #24242a);
    display: flex;
    flex-direction: column;
    padding: 8px 6px;
    gap: 3px;
    flex-shrink: 0;
}

.settings-nav-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: 5px;
    cursor: pointer;
    color: #888892;
    font-size: 12.5px;
    font-weight: 500;
    transition: all 0.18s ease;
}

.settings-nav-item:hover {
    background: var(--bg-tab-hover, #1d1d22);
    color: var(--text-primary, #cccccc);
}

.settings-nav-item.active {
    background: var(--bg-tab-active, #24242c);
    color: #ffffff;
}

.settings-content-area {
    flex: 1;
    padding: 16px;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.settings-tab-pane {
    display: none;
    flex-direction: column;
    gap: 14px;
}

.settings-tab-pane.active {
    display: flex;
}

.setting-section-header {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #666672;
    margin-bottom: 2px;
}

.setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-sidebar, #1c1c20);
    padding: 9px 12px;
    border-radius: 6px;
    border: 1px solid var(--border-color, #26262d);
}

.setting-row.autoexec-setting-highlight {
    box-shadow: 0 0 0 2px rgba(123, 136, 255, 0.65), 0 0 18px rgba(123, 136, 255, 0.2);
}

.setting-label {
    font-size: 13px;
    color: var(--text-primary, #cccccc);
}

.setting-sublabel {
    font-size: 11px;
    color: #777782;
    margin-top: 2px;
}

.setting-toggle {
    width: 36px;
    height: 20px;
    background: var(--bg-btn, #2a2a32);
    border-radius: 10px;
    cursor: pointer;
    position: relative;
    transition: background 0.2s ease;
    flex-shrink: 0;
}

.setting-toggle::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: #888888;
    border-radius: 50%;
    transition: transform 0.2s ease, background 0.2s ease;
}

.setting-toggle.on {
    background: var(--bg-btn-hover, #444452);
}

.setting-toggle.on::after {
    transform: translateX(16px);
    background: #ffffff;
}

.setting-select {
    background: var(--bg-btn, #24242c);
    border: 1px solid var(--border-btn, #333340);
    color: var(--text-primary, #e0e0e0);
    padding: 5px 10px;
    border-radius: 5px;
    outline: none;
    font-size: 12.5px;
}

.fflag-status-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-sidebar, #141418);
    border: 1px solid var(--border-color, #262630);
    border-radius: 6px;
    padding: 10px 14px;
}

.fflag-status-left {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.fflag-status-text {
    font-size: 12.5px;
    font-weight: 500;
    color: var(--text-primary, #e0e0e0);
}

.fflag-status-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #777777;
    margin-right: 5px;
}

.fflag-status-dot.online {
    background: #4ade80;
}

.fflag-version-tag {
    font-size: 10.5px;
    font-family: monospace;
    color: #777785;
}

.fflag-presets-bar {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.preset-btn {
    background: var(--bg-btn, #222228);
    border: 1px solid var(--border-btn, #2e2e38);
    border-radius: 5px;
    color: var(--text-primary, #c4c4ce);
    font-size: 11.5px;
    padding: 5px 10px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.preset-btn:hover {
    background: var(--bg-btn-hover, #2a2a32);
    border-color: var(--border-btn, #404050);
    color: #ffffff;
}

.fflag-add-form {
    display: flex;
    gap: 6px;
    align-items: center;
}

.fflag-input {
    background: var(--bg-main, #1e1e24);
    border: 1px solid var(--border-btn, #2d2d38);
    border-radius: 5px;
    color: var(--text-primary, #ffffff);
    font-size: 12.5px;
    padding: 6px 10px;
    outline: none;
    flex: 2;
}

.fflag-input:focus {
    border-color: var(--border-btn, #444458);
}

.fflag-val-input {
    flex: 1;
}

.fflag-add-btn {
    background: var(--bg-btn, #2a2a34);
    border: 1px solid var(--border-btn, #363644);
    color: #ffffff;
    border-radius: 5px;
    padding: 6px 12px;
    font-size: 12.5px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.fflag-add-btn:hover {
    background: var(--bg-btn-hover, #343442);
}

.fflag-list-container {
    max-height: 140px;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    display: flex;
    flex-direction: column;
    gap: 3px;
    background: var(--bg-header, #141417);
    border: 1px solid var(--border-color, #24242d);
    border-radius: 6px;
    padding: 6px;
}

.fflag-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-sidebar, #1b1b20);
    padding: 5px 8px;
    border-radius: 4px;
    font-size: 12px;
}

.fflag-row-name {
    color: var(--text-primary, #d4d4dc);
    font-family: monospace;
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fflag-row-val {
    color: #9cdcfe;
    font-family: monospace;
}

.fflag-row-del {
    color: #777780;
    cursor: pointer;
    border-radius: 3px;
    padding: 1px 4px;
}

.fflag-row-del:hover {
    color: #ef4444;
}

.fflag-action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
}

.fps-control-box {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: var(--bg-sidebar, #141418);
    border: 1px solid var(--border-color, #262630);
    border-radius: 6px;
    padding: 10px 12px;
}

.fps-input-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

.fps-input {
    background: var(--bg-main, #1e1e24);
    border: 1px solid var(--border-btn, #2d2d38);
    border-radius: 5px;
    color: var(--text-primary, #ffffff);
    font-size: 13px;
    padding: 6px 10px;
    width: 120px;
    outline: none;
    font-family: inherit;
}

.fps-input:focus {
    border-color: var(--border-btn, #444458);
}

.primary-btn {
    background: var(--bg-btn, #282834) !important;
    border: 1px solid var(--border-btn, #3e3e50) !important;
    color: #ffffff !important;
    font-weight: 500;
}

.primary-btn:hover {
    background: var(--bg-btn-hover, #343444) !important;
    border-color: var(--border-btn, #505066) !important;
}

.theme-dropdown-wrapper {
    position: relative;
    width: 100%;
    margin-bottom: 8px;
}

.theme-select-btn {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-btn, #1c1c22);
    border: 1px solid var(--border-btn, #2d2d38);
    border-radius: 6px;
    padding: 9px 12px;
    cursor: pointer;
    transition: all 0.18s ease;
    box-sizing: border-box;
    user-select: none;
    -webkit-user-select: none;
}

.theme-select-btn:hover {
    background: var(--bg-btn-hover, #23232c);
    border-color: var(--border-btn, #3e3e50);
}

.theme-selected-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary, #ffffff);
    text-align: left;
    margin: 0;
    padding: 0;
    line-height: 1;
}

.theme-chevron {
    color: #888898;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.theme-dropdown-wrapper.open .theme-chevron {
    transform: rotate(180deg);
}

.theme-dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--bg-header, #19191e);
    border: 1px solid var(--border-color, #323242);
    border-radius: 6px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.6);
    display: none;
    flex-direction: column;
    padding: 5px;
    gap: 2px;
    z-index: 100;
    max-height: 220px;
    overflow-y: auto;
    box-sizing: border-box;
}

.theme-dropdown-wrapper.open .theme-dropdown-menu {
    display: flex;
}

.theme-option {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.14s ease;
    user-select: none;
    -webkit-user-select: none;
}

.theme-option:hover {
    background: var(--bg-tab-hover, #242430);
}

.theme-option.active {
    background: var(--bg-tab-active, #282838);
}

.theme-option-label {
    font-size: 12.5px;
    color: var(--text-primary, #dcdce6);
}

.theme-option.active .theme-option-label {
    color: #ffffff;
    font-weight: 500;
}

#custom-bg-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    pointer-events: none;
    z-index: 0;
    opacity: 0;
    transition: opacity 0.3s ease, filter 0.3s ease;
}

body.has-custom-bg {
    background-color: #0d0d0f !important;
}

body.has-custom-bg #app-container {
    background-color: transparent !important;
}

body.has-custom-bg #main-content {
    background-color: transparent !important;
}

body.has-custom-bg #editor-container {
    background-color: rgba(20, 20, 20, 0.45) !important;
    backdrop-filter: blur(2px);
}

body.has-custom-bg #editor {
    background-color: transparent !important;
}

body.has-custom-bg .ace_editor {
    background-color: transparent !important;
}

body.has-custom-bg .ace_scroller {
    background-color: transparent !important;
}

body.has-custom-bg .ace_content {
    background-color: transparent !important;
}

body.has-custom-bg .ace_gutter {
    background-color: rgba(20, 20, 20, 0.35) !important;
}

body.has-custom-bg #sidebar {
    background-color: rgba(22, 22, 24, 0.82) !important;
    backdrop-filter: blur(12px);
}

body.has-custom-bg #bottom-bar {
    background-color: rgba(22, 22, 24, 0.86) !important;
    backdrop-filter: blur(12px);
}

body.has-custom-bg #tabbar-container {
    background-color: rgba(20, 20, 22, 0.86) !important;
    backdrop-filter: blur(12px);
}

body.has-custom-bg #titlebar {
    background-color: rgba(18, 18, 20, 0.88) !important;
    backdrop-filter: blur(12px);
}

#scripthub-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.74);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 550;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
}

#scripthub-modal-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.scripthub-modal {
    width: min(1120px, calc(100% - 32px));
    height: min(680px, calc(100% - 32px));
    position: relative;
    background: var(--bg-main, #18181c);
    border: 1px solid var(--border-color, #2e2e38);
    border-radius: 9px;
    box-shadow: 0 16px 44px rgba(0, 0, 0, 0.75);
    display: flex;
    flex-direction: row;
    overflow: hidden;
    transform: scale(0.96);
    transition: transform 0.22s cubic-bezier(0.34, 1.3, 0.64, 1);
}

#scripthub-modal-overlay.show .scripthub-modal {
    transform: scale(1);
}

.scripthub-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 18px;
    border-bottom: 1px solid var(--border-color, #24242e);
    background: var(--bg-header, #141418);
    flex-shrink: 0;
}

.scripthub-title-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary, #e0e0e0);
}

.scripthub-title {
    font-size: 14px;
    font-weight: 600;
}

.scripthub-badge {
    font-size: 10.5px;
    background: rgba(88, 101, 242, 0.18);
    color: #7b88ff;
    border: 1px solid rgba(88, 101, 242, 0.3);
    padding: 2px 7px;
    border-radius: 10px;
    font-weight: 500;
}

.scripthub-search-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    background: var(--bg-header, #141418);
    border-bottom: 1px solid var(--border-color, #22222a);
    flex-shrink: 0;
}

.scripthub-search-input {
    flex: 1;
    background: var(--bg-main, #1d1d24);
    border: 1px solid var(--border-btn, #2d2d38);
    border-radius: 6px;
    color: var(--text-primary, #ffffff);
    font-size: 12.5px;
    padding: 7px 12px;
    outline: none;
    font-family: inherit;
    transition: border-color 0.15s ease;
}

.scripthub-search-input:focus {
    border-color: #5865f2;
}

.scripthub-grid {
    flex: 1;
    overflow-y: auto;
    padding: 14px 18px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.scripthub-item {
    background: var(--bg-sidebar, #1c1c22);
    border: 1px solid var(--border-color, #282832);
    border-radius: 7px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 10px;
    transition: all 0.18s ease;
}

.scripthub-item:hover {
    background: var(--bg-tab-hover, #22222a);
    border-color: var(--border-color, #38384a);
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

.scripthub-item-top {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.scripthub-icon-box {
    width: 36px;
    height: 36px;
    background: var(--bg-btn, #252530);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #9999b0;
}

.scripthub-item:hover .scripthub-icon-box {
    background: var(--bg-btn-hover, #2d2d3c);
    color: #ffffff;
}

.scripthub-item-meta {
    flex: 1;
    overflow: hidden;
}

.scripthub-item-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary, #ffffff);
}

.scripthub-item-desc {
    font-size: 11px;
    color: #777785;
    margin-top: 2px;
    line-height: 1.35;
}

.scripthub-item-actions {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
}

.scripthub-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11.5px;
    font-weight: 500;
    cursor: pointer;
    background: var(--bg-btn, #24242c);
    border: 1px solid var(--border-btn, #33333e);
    color: var(--text-primary, #cccccc);
    transition: all 0.15s ease;
}

.scripthub-btn:hover {
    background: var(--bg-btn-hover, #2c2c38);
    color: #ffffff;
    border-color: var(--border-btn, #444455);
}

.scripthub-btn.primary {
    background: var(--bg-btn-hover, #2c2c3d);
    border-color: var(--border-btn, #45455e);
    color: #ffffff;
}

.scripthub-btn.primary:hover {
    background: var(--bg-tab-hover, #383850);
    border-color: var(--border-btn, #585878);
}


.scripthub-sources {
    display: flex;
    gap: 8px;
    padding: 10px 18px;
    background: var(--bg-header, #141418);
    border-bottom: 1px solid var(--border-color, #22222a);
    flex-shrink: 0;
}

.scripthub-source {
    padding: 4px 12px;
    font-size: 11.5px;
    font-weight: 500;
    border-radius: 10px;
    cursor: pointer;
    background: var(--bg-btn, #24242c);
    border: 1px solid var(--border-btn, #33333e);
    color: #9999b0;
    font-family: inherit;
    transition: all 0.15s ease;
}

.scripthub-source:hover {
    color: #ffffff;
    border-color: #444455;
}

.scripthub-source.active {
    background: rgba(88, 101, 242, 0.18);
    color: #7b88ff;
    border-color: rgba(88, 101, 242, 0.3);
}

.scripthub-pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 10px 18px;
    border-top: 1px solid var(--border-color, #22222a);
    background: var(--bg-header, #141418);
    flex-shrink: 0;
}

.scripthub-page-info {
    font-size: 11.5px;
    color: #777785;
    min-width: 70px;
    text-align: center;
}

.scripthub-item-img {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    object-fit: cover;
    background: var(--bg-btn, #252530);
    flex-shrink: 0;
    display: block;
}

.scripthub-item-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
}

.scripthub-item-tag {
    font-size: 9.5px;
    padding: 1px 6px;
    border-radius: 8px;
    background: rgba(88, 101, 242, 0.15);
    color: #8b96ff;
    border: 1px solid rgba(88, 101, 242, 0.25);
    font-weight: 500;
}

.scripthub-item-tag.key {
    background: rgba(232, 180, 76, 0.12);
    color: #e8b44c;
    border-color: rgba(232, 180, 76, 0.3);
}

.scripthub-item-tag.game {
    background: rgba(80, 200, 120, 0.12);
    color: #64d08c;
    border-color: rgba(80, 200, 120, 0.25);
}


/* Script Hub - Real-style layout */
.hub-sidebar {
    width: 190px;
    flex-shrink: 0;
    background: var(--bg-header, #141418);
    border-right: 1px solid var(--border-color, #22222a);
    display: flex;
    flex-direction: column;
    padding: 14px 12px;
    gap: 10px;
}

.hub-side-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 4px;
}

.hub-side-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary, #e8e8ee);
}

.hub-search-wrap {
    display: flex;
    align-items: center;
    gap: 7px;
    background: var(--bg-main, #1d1d24);
    border: 1px solid var(--border-btn, #2d2d38);
    border-radius: 7px;
    padding: 7px 10px;
    color: #66667a;
}

.hub-search-wrap:focus-within {
    border-color: #5865f2;
}

.hub-search-wrap input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--text-primary, #ffffff);
    font-size: 12px;
    font-family: inherit;
    min-width: 0;
}

.hub-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.hub-nav-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 12.5px;
    font-weight: 500;
    color: #9a9aac;
    cursor: pointer;
    user-select: none;
    transition: all 0.13s ease;
}

.hub-nav-item:hover {
    background: var(--bg-btn, #24242c);
    color: #ffffff;
}

.hub-nav-item.active {
    background: var(--bg-btn, #24242c);
    color: #ffffff;
}

.hub-sources {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
    border-top: 1px solid var(--border-color, #22222a);
    padding-top: 10px;
}

.hub-source-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 10px;
    border-radius: 7px;
    font-size: 12.5px;
    font-weight: 600;
    color: #b8b8c6;
    cursor: pointer;
    user-select: none;
    border: 1px solid transparent;
    transition: all 0.13s ease;
}

.hub-source-item:hover {
    background: var(--bg-btn, #24242c);
    color: #ffffff;
}

.hub-source-item.active {
    background: var(--bg-btn, #24242c);
    border-color: var(--border-btn, #33333e);
    color: #ffffff;
}

.hub-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    position: relative;
    background: var(--bg-main, #18181c);
}

.hub-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 14px 16px;
    min-height: 0;
}

.hub-section {
    margin-bottom: 18px;
}

.hub-section-title {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary, #e8e8ee);
    margin-bottom: 10px;
    padding-left: 2px;
}

.hub-row {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    padding-bottom: 6px;
    scrollbar-width: thin;
}

.hub-row::-webkit-scrollbar {
    height: 6px;
}

.hub-row::-webkit-scrollbar-thumb {
    background: #2c2c38;
    border-radius: 3px;
}

.hub-row-loading {
    color: #66667a;
    font-size: 12px;
    padding: 30px 10px;
}

.hub-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.hub-card {
    flex: 0 0 218px;
    width: 218px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.hub-grid .hub-card {
    flex: none;
    width: auto;
}

.hub-card-img {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 4px;
}

.hub-card-thumb {
    width: 100%;
    aspect-ratio: 16 / 8.5;
    object-fit: cover;
    display: block;
    background: #101014;
}

.hub-card-thumb-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #55556a;
}

.hub-card-flag {
    position: absolute;
    top: 7px;
    left: 7px;
    font-size: 9.5px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 20px;
    background: rgba(10, 10, 14, 0.78);
    color: #e8c268;
    backdrop-filter: blur(4px);
}

.hub-card-game {
    font-size: 9.5px;
    font-weight: 600;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    color: #77778a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hub-card-title {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-primary, #f0f0f4);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hub-card-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 2px;
}

.hub-meta-bit {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10.5px;
    color: #77778a;
    white-space: nowrap;
}

.hub-card-acts {
    margin-left: auto;
    display: flex;
    gap: 3px;
    opacity: 0.55;
    transition: opacity 0.13s ease;
}

.hub-card:hover .hub-card-acts {
    opacity: 1;
}

.hub-act {
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    border: none;
    background: transparent;
    color: #9a9aac;
    cursor: pointer;
    padding: 0;
    transition: all 0.12s ease;
}

.hub-act:hover {
    background: var(--bg-btn, #2a2a34);
    color: #ffffff;
}

.hub-act.saved {
    color: #7b88ff;
}


.hub-row-wrap {
    position: relative;
}

.hub-row-nav {
    position: absolute;
    top: 38%;
    transform: translateY(-50%);
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(18, 18, 24, 0.88);
    border: 1px solid var(--border-color, #2e2e38);
    color: #c5c5d4;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.15s ease, background 0.13s ease, color 0.13s ease;
    z-index: 3;
    padding: 0;
}

.hub-row-wrap:hover .hub-row-nav {
    opacity: 1;
}

.hub-row-nav:hover {
    background: var(--bg-btn-hover, #2c2c38);
    color: #ffffff;
}

.hub-row-nav.left {
    left: 5px;
}

.hub-row-nav.right {
    right: 5px;
}


.hub-card-thumb-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: #55556a;
}

.hub-empty-label {
    font-size: 9.5px;
    font-weight: 500;
    letter-spacing: 0.3px;
    color: #55556a;
    text-transform: uppercase;
}


/* Script detail overlay */
.hub-detail-overlay {
    position: absolute;
    inset: 0;
    background: var(--bg-main, #18181c);
    z-index: 6;
    animation: hubDetailIn 0.24s cubic-bezier(0.2, 0.7, 0.3, 1);
}

@keyframes hubDetailIn {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hub-detail-scroll {
    height: 100%;
    overflow-y: auto;
    padding: 14px 16px 18px;
}

.hub-d-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px 5px 9px;
    border-radius: 6px;
    border: 1px solid var(--border-btn, #2d2d38);
    background: var(--bg-btn, #24242c);
    color: var(--text-primary, #cccccc);
    font-size: 11.5px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    margin-bottom: 12px;
    transition: all 0.13s ease;
}

.hub-d-back:hover {
    background: var(--bg-btn-hover, #2c2c38);
    color: #ffffff;
}

.hub-d-bannerwrap {
    position: relative;
    border-radius: 9px;
    overflow: hidden;
    margin-bottom: 10px;
}

.hub-d-banner {
    width: 100%;
    aspect-ratio: 21 / 7;
    object-fit: cover;
    display: block;
    background: #101014;
}

.hub-d-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.hub-d-ava {
    width: 52px;
    height: 52px;
    border-radius: 9px;
    object-fit: cover;
    background: #101014;
    flex-shrink: 0;
}

.hub-d-ava-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #55556a;
}

.hub-d-ava-empty svg {
    width: 22px;
    height: 22px;
}

.hub-d-headmeta {
    min-width: 0;
}

.hub-d-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary, #f0f0f4);
    line-height: 1.2;
}

.hub-d-sub {
    font-size: 12px;
    color: #77778a;
    margin-top: 3px;
}

.hub-d-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
}

.hub-d-exec {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px;
    border-radius: 8px;
    border: none;
    background: #e8e8ee;
    color: #141418;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.13s ease;
}

.hub-d-exec:hover {
    background: #ffffff;
}

.hub-d-icbtn {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 1px solid var(--border-btn, #2d2d38);
    background: var(--bg-btn, #24242c);
    color: #9a9aac;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    transition: all 0.13s ease;
}

.hub-d-icbtn:hover {
    background: var(--bg-btn-hover, #2c2c38);
    color: #ffffff;
}

.hub-d-icbtn.saved {
    color: #7b88ff;
    border-color: rgba(88, 101, 242, 0.35);
}

.hub-d-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-bottom: 14px;
}

.hub-d-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 500;
    color: #9a9aac;
    background: var(--bg-btn, #20202a);
    border: 1px solid var(--border-btn, #2a2a34);
    padding: 4px 10px;
    border-radius: 20px;
}

.hub-d-chip.src {
    color: #7b88ff;
}

.hub-d-links {
    border-radius: 8px;
    border: 1px solid var(--border-color, #24242e);
    background: var(--bg-sidebar, #1a1a21);
    overflow: hidden;
    margin-bottom: 14px;
}

.hub-d-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 14px;
    font-size: 12.5px;
    color: var(--text-primary, #e0e0e6);
    cursor: pointer;
    transition: background 0.12s ease;
}

.hub-d-link:hover {
    background: var(--bg-btn, #22222c);
}

.hub-d-link + .hub-d-link {
    border-top: 1px solid var(--border-color, #23232b);
}

.hub-d-link-l {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-weight: 500;
    color: #b8b8c6;
}

.hub-d-link-r {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #77778a;
    font-size: 12px;
}

.hub-d-prev {
    border-radius: 8px;
    border: 1px solid var(--border-color, #24242e);
    background: var(--bg-sidebar, #1a1a21);
    overflow: hidden;
}

.hub-d-prev-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-primary, #e0e0e6);
    border-bottom: 1px solid var(--border-color, #23232b);
}

.hub-d-lines {
    margin-left: auto;
    font-size: 10.5px;
    font-weight: 500;
    color: #77778a;
}

.hub-d-code {
    margin: 0;
    padding: 12px 14px;
    font-family: Consolas, 'Cascadia Code', monospace;
    font-size: 11.5px;
    line-height: 1.55;
    color: #c9d1d9;
    white-space: pre;
    overflow-x: auto;
    max-height: 320px;
    overflow-y: auto;
}


.hub-card-img .hub-card-thumb {
    transition: transform 0.28s cubic-bezier(0.2, 0.7, 0.3, 1);
}

.hub-card:hover .hub-card-img .hub-card-thumb {
    transform: scale(1.06);
}

.hub-card-play {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 20px;
    border: none;
    background: rgba(232, 232, 238, 0.95);
    color: #141418;
    font-size: 11.5px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s cubic-bezier(0.2, 0.7, 0.3, 1), background 0.13s ease;
    z-index: 2;
}

.hub-card:hover .hub-card-play {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
}

.hub-card-play:hover {
    background: #ffffff;
}


.hub-close-float {
    position: absolute;
    top: 10px;
    right: 12px;
    z-index: 8;
    background: rgba(18, 18, 24, 0.85);
    border: 1px solid var(--border-color, #2e2e38);
    border-radius: 6px;
    backdrop-filter: blur(6px);
}

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

.clients-empty {
    font-size: 12px;
    color: #777782;
    padding: 14px;
    text-align: center;
    background: var(--bg-sidebar, #1c1c20);
    border: 1px dashed var(--border-color, #26262d);
    border-radius: 6px;
}

.client-row {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-sidebar, #1c1c20);
    padding: 10px 12px;
    border-radius: 6px;
    border: 1px solid var(--border-color, #26262d);
}

.client-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    background: #2a2a32;
    flex-shrink: 0;
}

.client-meta {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.client-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary, #cccccc);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.client-username {
    font-weight: 400;
    color: #777782;
    font-size: 12px;
}

.client-sub {
    font-size: 11px;
    color: #777782;
    margin-top: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.client-status {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    padding: 4px 10px;
    border-radius: 10px;
    flex-shrink: 0;
}

.client-status.attached {
    background: rgba(60, 200, 120, 0.15);
    color: #4fd68a;
    border: 1px solid rgba(60, 200, 120, 0.35);
}

.client-status.running {
    background: rgba(80, 140, 255, 0.15);
    color: #6ea3ff;
    border: 1px solid rgba(80, 140, 255, 0.35);
}

.client-status.offline {
    background: rgba(120, 120, 130, 0.12);
    color: #888892;
    border: 1px solid rgba(120, 120, 130, 0.3);
}

.sound-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sound-option {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-sidebar, #1c1c20);
    padding: 9px 12px;
    border-radius: 6px;
    border: 1px solid var(--border-color, #26262d);
    cursor: pointer;
    transition: all 0.14s ease;
    user-select: none;
    -webkit-user-select: none;
}

.sound-option:hover {
    background: var(--bg-tab-hover, #242430);
    border-color: var(--border-btn, #333340);
}

.sound-option.active {
    background: var(--bg-tab-active, #282838);
    border-color: var(--file-icon, #4b82e8);
}

.sound-preview-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--bg-btn, #24242c);
    border: 1px solid var(--border-btn, #333340);
    color: var(--text-muted, #aaaaaa);
    cursor: pointer;
    transition: all 0.14s ease;
}

.sound-preview-btn:hover {
    color: #ffffff;
    background: var(--bg-btn-hover, #23232c);
    border-color: var(--file-icon, #4b82e8);
}

.sound-option.active .sound-preview-btn {
    color: var(--file-icon, #4b82e8);
    border-color: var(--file-icon, #4b82e8);
}

.sound-eq {
    display: none;
    align-items: flex-end;
    gap: 2px;
    height: 12px;
}

.sound-eq span {
    width: 2.5px;
    border-radius: 1px;
    background: currentColor;
    animation: soundEqBounce 0.5s infinite ease-in-out;
}

.sound-eq span:nth-child(1) { height: 60%; animation-delay: 0s; }
.sound-eq span:nth-child(2) { height: 100%; animation-delay: 0.15s; }
.sound-eq span:nth-child(3) { height: 45%; animation-delay: 0.3s; }

.sound-preview-btn.playing {
    color: var(--file-icon, #4b82e8);
    border-color: var(--file-icon, #4b82e8);
}

.sound-preview-btn.playing .sound-icon-play {
    display: none;
}

.sound-preview-btn.playing .sound-eq {
    display: inline-flex;
}

@keyframes soundEqBounce {
    0%, 100% { transform: scaleY(0.4); }
    50% { transform: scaleY(1); }
}

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

.sound-option-label {
    font-size: 13px;
    color: var(--text-primary, #cccccc);
}

.sound-option.active .sound-option-label {
    color: #ffffff;
    font-weight: 500;
}

.sound-option-desc {
    font-size: 11px;
    color: var(--text-muted, #888888);
}

.sound-selected-badge {
    display: none;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    border-radius: 50%;
    color: #ffffff;
    background: var(--file-icon, #4b82e8);
}

.sound-option.active .sound-selected-badge {
    display: inline-flex;
}

/* ---- Sound player card ---- */
.sound-player {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-sidebar, #1c1c20);
    border: 1px solid var(--border-color, #26262d);
    border-radius: 6px;
    padding: 10px 12px;
    margin-bottom: 8px;
}

.sp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--bg-btn, #24242c);
    border: 1px solid var(--border-btn, #333340);
    color: var(--text-muted, #aaaaaa);
    cursor: pointer;
    transition: all 0.14s ease;
}

.sp-btn:hover {
    color: #ffffff;
    background: var(--bg-btn-hover, #23232c);
    border-color: var(--file-icon, #4b82e8);
}

.sp-btn.on {
    color: var(--file-icon, #4b82e8);
    border-color: var(--file-icon, #4b82e8);
}

.sp-btn.sp-play {
    width: 36px;
    height: 36px;
    color: var(--text-primary, #ffffff);
    border-color: var(--text-primary, #e0e0e0);
    background: rgba(255, 255, 255, 0.06);
}

.sp-btn.sp-play:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: var(--text-primary, #ffffff);
}

.sp-track {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.sp-track-top {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sp-title {
    font-size: 13px;
    color: var(--text-primary, #cccccc);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sp-desc {
    font-size: 11px;
    color: var(--text-muted, #888888);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sp-eq {
    display: none;
    align-items: flex-end;
    gap: 2px;
    height: 12px;
    color: var(--file-icon, #4b82e8);
}

.sp-eq span {
    width: 2.5px;
    border-radius: 1px;
    background: currentColor;
    animation: soundEqBounce 0.5s infinite ease-in-out;
}

.sp-eq span:nth-child(1) { height: 55%; animation-delay: 0s; }
.sp-eq span:nth-child(2) { height: 100%; animation-delay: 0.12s; }
.sp-eq span:nth-child(3) { height: 70%; animation-delay: 0.24s; }
.sp-eq span:nth-child(4) { height: 40%; animation-delay: 0.36s; }

.sound-player.playing .sp-eq {
    display: inline-flex;
}

.sound-player.playing .sp-icon-play { display: none; }
.sound-player.playing .sp-icon-stop { display: block; }

.sp-progress {
    height: 3px;
    border-radius: 2px;
    background: var(--bg-btn, #24242c);
    overflow: hidden;
}

.sp-progress-fill {
    height: 100%;
    width: 0%;
    border-radius: 2px;
    background: var(--file-icon, #4b82e8);
}

/* ---- Wallpaper dropzone ---- */
.bg-dropzone {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 12px;
    border-radius: 6px;
    border: 1px dashed var(--border-btn, #333340);
    background: var(--bg-btn, #20202a);
    color: var(--text-muted, #aaaaaa);
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
    -webkit-user-select: none;
}

.bg-dropzone:hover {
    border-color: var(--file-icon, #4b82e8);
    color: var(--text-primary, #cccccc);
    background: var(--bg-tab-hover, #242430);
}

.bg-dropzone.dragover {
    border-color: var(--file-icon, #4b82e8);
    background: rgba(75, 130, 232, 0.10);
    color: #ffffff;
}

.bg-dropzone-icon {
    flex-shrink: 0;
    opacity: 0.8;
}

.bg-dropzone-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.bg-dropzone-title {
    font-size: 12.5px;
    color: var(--text-primary, #cccccc);
}

.bg-dropzone-sub {
    font-size: 11px;
    color: var(--text-muted, #888888);
}

.bg-preview {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid var(--border-color, #26262d);
    background: var(--bg-btn, #20202a);
}

.bg-preview-img {
    width: 56px;
    height: 36px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid var(--border-btn, #333340);
    flex-shrink: 0;
    background: #000;
}

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

.bg-preview-info span:first-child {
    font-size: 12.5px;
    color: var(--text-primary, #cccccc);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bg-preview-info span:last-child {
    font-size: 11px;
    color: var(--text-muted, #888888);
}

.setting-text-input {
    background: var(--bg-btn, #24242c);
    border: 1px solid var(--border-btn, #333340);
    color: var(--text-primary, #e0e0e0);
    padding: 5px 10px;
    border-radius: 5px;
    outline: none;
    font-size: 12.5px;
    width: 200px;
}

.setting-text-input:focus {
    border-color: var(--file-icon, #4b82e8);
}

/* ---- Recent wallpapers ---- */
.bg-recent {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.bg-recent-header {
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-dim, #777785);
}

.bg-recent-list {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.bg-recent-item {
    position: relative;
    width: 96px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--border-btn, #333340);
    background: var(--bg-btn, #20202a);
    cursor: pointer;
    transition: border-color 0.14s ease, transform 0.14s ease;
}

.bg-recent-item:hover {
    border-color: var(--file-icon, #4b82e8);
    transform: translateY(-1px);
}

.bg-recent-item.active {
    border-color: var(--file-icon, #4b82e8);
    box-shadow: 0 0 0 1px var(--file-icon, #4b82e8) inset;
}

.bg-recent-item img {
    display: block;
    width: 100%;
    height: 54px;
    object-fit: cover;
}

.bg-recent-name {
    display: block;
    padding: 4px 6px;
    font-size: 10.5px;
    color: var(--text-muted, #9a9aac);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---- Light theme overrides (hardcoded surfaces not covered by vars) ---- */
body.theme-light {
    color-scheme: light;
    scrollbar-color: #c8cdd8 transparent !important;
}

body.theme-light::-webkit-scrollbar-thumb,
body.theme-light *::-webkit-scrollbar-thumb {
    background: #c0c6d2 !important;
}

body.theme-light #titlebar,
body.theme-light #tabbar-container,
body.theme-light #bottombar,
body.theme-light .settings-modal,
body.theme-light .scripthub-modal,
body.theme-light .patchlog-modal {
    background-color: var(--bg-header);
    border-color: var(--border-color) !important;
}

body.theme-light #sidebar,
body.theme-light .settings-sidebar,
body.theme-light .hub-sidebar {
    background-color: var(--bg-sidebar);
    border-color: var(--border-color) !important;
}

body.theme-light .title-text,
body.theme-light .win-btn,
body.theme-light .tab-icon,
body.theme-light .tab-add-btn {
    color: #6a7280;
}

body.theme-light .win-btn:hover,
body.theme-light .tab-add-btn:hover {
    background-color: rgba(0, 0, 0, 0.06);
    color: #1f2430;
}

body.theme-light .win-btn.close:hover {
    background-color: #e81123;
    color: #ffffff;
}

body.theme-light .titlebar-pill-menu {
    background: rgba(255, 255, 255, 0.72);
    border-color: var(--border-color);
}

body.theme-light .titlebar-pill-btn:hover {
    background-color: rgba(0, 0, 0, 0.06);
    color: #1f2430;
}

body.theme-light .titlebar-pill-btn:active,
body.theme-light .tab-close:hover {
    background-color: rgba(0, 0, 0, 0.10);
    color: #1f2430;
}

body.theme-light .tab-item {
    color: #6a7280;
    border-color: transparent;
}

body.theme-light .tab-item:hover {
    color: #3c4350;
}

body.theme-light .tab-item.active {
    color: #1f2430;
    border-color: rgba(0, 0, 0, 0.08);
}

/* The base sheet paints an active tab's icon pure white (`.tab-item.active
   .tab-icon`, specificity 0,3,0), which beats the light-theme `.tab-icon` rule
   and left the `</>` glyph white-on-white. These selectors are deliberately one
   class deeper so they win by specificity instead of another !important. */
body.theme-light .tab-item .tab-icon {
    color: #6a7280;
}

body.theme-light .tab-item:hover .tab-icon {
    color: #3c4350;
}

body.theme-light .tab-item.active .tab-icon {
    color: #1f2430;
}

body.theme-light .tab-item .tab-close {
    color: #8a90a0;
}

body.theme-light .tab-item:hover .tab-close,
body.theme-light .tab-item.active .tab-close {
    color: #5d6472;
}

body.theme-light .tab-rename-input {
    background: #ffffff;
    color: #1f2430;
    caret-color: #1f2430;
}

/* settings + cards */
body.theme-light .settings-modal,
body.theme-light .scripthub-modal,
body.theme-light .fflag-status-card,
body.theme-light .setting-row,
body.theme-light .sound-option,
body.theme-light .sound-player,
body.theme-light .hub-card,
body.theme-light .scripthub-item,
body.theme-light .scripthub-source,
body.theme-light .fps-control-box,
body.theme-light .user-profile-badge,
body.theme-light .script-item,
body.theme-light .bg-preview,
body.theme-light .bg-dropzone,
body.theme-light .bg-recent-item,
body.theme-light .engine-num-input,
body.theme-light .fps-input-pill,
body.theme-light .preset-btn,
body.theme-light .theme-select-btn,
body.theme-light .fflag-row,
body.theme-light .fflag-input,
body.theme-light .fflag-val-input,
body.theme-light .fflag-add-btn,
body.theme-light .setting-select,
body.theme-light .setting-text-input,
body.theme-light .scripthub-search-input,
body.theme-light .hub-search-wrap,
body.theme-light .editor-autocomplete-dropdown,
body.theme-light #tab-context-menu,
body.theme-light .theme-dropdown-menu {
    background: #ffffff;
    border-color: var(--border-color);
    color: var(--text-primary);
}

body.theme-light .setting-row,
body.theme-light .sound-option,
body.theme-light .hub-card,
body.theme-light .scripthub-item,
body.theme-light .fflag-row,
body.theme-light .script-item,
body.theme-light .scripthub-source {
    background: #f7f8fb;
}

body.theme-light .setting-row:hover,
body.theme-light .sound-option:hover,
body.theme-light .hub-card:hover,
body.theme-light .scripthub-item:hover,
body.theme-light .fflag-row:hover,
body.theme-light .script-item:hover,
body.theme-light .scripthub-source:hover,
body.theme-light .preset-btn:hover,
body.theme-light .theme-select-btn:hover,
body.theme-light .fflag-add-btn:hover,
body.theme-light .bg-dropzone:hover,
body.theme-light .bg-recent-item:hover,
body.theme-light .settings-nav-item:hover,
body.theme-light .hub-nav-item:hover,
body.theme-light .hub-source-item:hover,
body.theme-light .theme-option:hover {
    background: #eceff5;
    color: var(--text-primary);
}

body.theme-light .settings-nav-item.active,
body.theme-light .hub-nav-item.active,
body.theme-light .hub-source-item.active,
body.theme-light .sound-option.active,
body.theme-light .theme-option.active,
body.theme-light .scripthub-source.active {
    background: #e4e9f4;
    color: var(--text-primary);
    border-color: var(--file-icon);
}

body.theme-light .setting-label,
body.theme-light .sp-title,
body.theme-light .sound-option-label,
body.theme-light .settings-title,
body.theme-light .scripthub-title,
body.theme-light .fflag-row-name,
body.theme-light .script-item-name,
body.theme-light .scripthub-item-title,
body.theme-light .hub-section-title,
body.theme-light .theme-option-label,
body.theme-light .console-line,
body.theme-light .context-menu-item,
body.theme-light .editor-autocomplete-item,
body.theme-light .user-display-name {
    color: var(--text-primary);
}

body.theme-light .setting-sublabel,
body.theme-light .sp-desc,
body.theme-light .sound-option-desc,
body.theme-light .bg-dropzone-sub,
body.theme-light .bg-recent-name,
body.theme-light .scripthub-item-desc,
body.theme-light .scripthub-item-meta,
body.theme-light .hub-side-title,
body.theme-light .fflag-version-tag,
body.theme-light .console-time,
body.theme-light .user-username,
body.theme-light .user-place-id,
body.theme-light .theme-selected-name,
body.theme-light .tab-item,
body.theme-light .fflag-row-val {
    color: var(--text-muted);
}

body.theme-light .action-btn,
body.theme-light .scripthub-btn,
body.theme-light .fps-apply-btn,
body.theme-light .sp-btn,
body.theme-light .console-drawer-btn {
    background: #eef0f5;
    border-color: var(--border-btn);
    color: var(--text-primary);
}

body.theme-light .action-btn:hover,
body.theme-light .scripthub-btn:hover,
body.theme-light .fps-apply-btn:hover,
body.theme-light .sp-btn:hover,
body.theme-light .console-drawer-btn:hover {
    background: #e2e6ee;
    color: var(--text-primary);
}

body.theme-light .sp-btn.sp-play {
    color: var(--text-primary);
    border-color: var(--text-primary);
    background: rgba(0, 0, 0, 0.05);
}

body.theme-light .sp-btn.sp-play:hover {
    background: rgba(0, 0, 0, 0.10);
}

body.theme-light .primary-btn {
    background: var(--file-icon);
    border-color: var(--file-icon);
    color: #ffffff;
}

body.theme-light .scripthub-btn.primary {
    background: var(--file-icon);
    color: #ffffff;
}

body.theme-light .setting-toggle {
    background: #d3d8e2;
}

body.theme-light .setting-toggle.on {
    background: var(--file-icon);
}

.setting-segment {
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 3px;
    background: var(--bg-btn, #2a2a32);
    border: 1px solid var(--border-btn, transparent);
    border-radius: 7px;
    flex-shrink: 0;
}

.setting-segment-item {
    padding: 4px 12px;
    border-radius: 5px;
    font-size: 11.5px;
    font-weight: 500;
    color: var(--text-muted, #888892);
    cursor: pointer;
    user-select: none;
    transition: background 0.16s ease, color 0.16s ease;
}

.setting-segment-item:hover {
    color: var(--text-primary, #cccccc);
}

.setting-segment-item.active {
    background: var(--file-icon, #4b82e8);
    color: #ffffff;
}

body.theme-light .setting-segment {
    background: #e7eaf1;
    border-color: #d3d8e2;
}

body.theme-light .setting-segment-item {
    color: #5d6472;
}

body.theme-light .setting-segment-item:hover {
    color: #1f2430;
}

body.theme-light .setting-segment-item.active {
    background: var(--file-icon);
    color: #ffffff;
}

body.theme-light .engine-slider::-webkit-slider-runnable-track {
    height: 6px !important;
    border-radius: 999px !important;
    background: #d3d8e2 !important;
}

body.theme-light #toast {
    background: #ffffff;
    color: var(--text-primary);
    border-color: var(--border-color);
}

body.theme-light .context-menu-item:hover {
    background: #eceff5;
    color: var(--text-primary);
}

body.theme-light #ctx-tab-autoexec {
    background: #eef0ff;
    color: #4b559c;
}

body.theme-light #ctx-tab-autoexec.checked,
body.theme-light #ctx-tab-autoexec:hover:not(.unavailable) {
    background: #e1e5ff;
    color: #354194;
}

body.theme-light #ctx-tab-autoexec.unavailable {
    background: #f3f4f7;
    border-color: #e7e8ed;
    color: #92949f;
}

body.theme-light #ctx-tab-autoexec.unavailable:hover {
    background: #eceef3;
    color: #777a86;
}

body.theme-light .console-drawer-header {
    background: var(--bg-header) !important;
    border-color: var(--border-color) !important;
    color: var(--text-primary);
}

body.theme-light .console-drawer-body {
    background: var(--bg-editor) !important;
    color: var(--console-text, #cbd5e1) !important;
}

body.theme-light .editor-autocomplete-item .ac-badge {
    color: var(--text-muted);
}

body.theme-light .hub-content,
body.theme-light .settings-content-area,
body.theme-light #main-content {
    background: var(--bg-main);
}

body.theme-light .bg-dropzone {
    background: #f4f6fa;
    border-color: var(--border-btn);
    color: var(--text-muted);
}

body.theme-light .bg-dropzone.dragover {
    background: rgba(37, 99, 235, 0.08);
    color: var(--file-icon);
}

body.theme-light .theme-dropdown-menu,
body.theme-light #tab-context-menu {
    box-shadow: 0 8px 24px rgba(15, 20, 30, 0.16);
}

/* ---- Light-theme fixes ------------------------------------------------- */

body.theme-light .engine-slider::-webkit-slider-thumb {
    -webkit-appearance: none !important;
    appearance: none !important;
    width: 16px !important;
    height: 16px !important;
    min-width: 16px !important;
    min-height: 16px !important;
    max-width: 16px !important;
    max-height: 16px !important;
    margin-top: -5px !important;
    border: none !important;
    background: radial-gradient(circle, var(--file-icon, #2563eb) 68%, transparent 72%) !important;
    border-radius: 50% !important;
    box-shadow: none !important;
    cursor: pointer;
    transition: transform 0.15s ease;
}

body.theme-light .engine-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    background: radial-gradient(circle, #1d4ed8 68%, transparent 72%) !important;
    box-shadow: none !important;
}

body.theme-light .engine-slider {
    -webkit-appearance: none !important;
    appearance: none !important;
    height: 6px !important;
    background: #d3d8e2 !important;
    overflow: visible !important;
    border-radius: 999px !important;
}

/* Ace's chrome theme draws the caret in its own dark colour, but the app also
   sets a light caret through CSS - on a white editor that caret is invisible. */
body.theme-light .ace_cursor {
    color: #1b1f27 !important;
    border-left-color: #1b1f27 !important;
}

body.theme-light .ace_cursor-layer .ace_cursor,
body.theme-light .ace_editor .ace_cursor {
    border-left: 2px solid #1b1f27 !important;
}

body.theme-light .ace_hidden-cursors .ace_cursor {
    opacity: 0.2 !important;
}

/* A wallpaper needs a light scrim in light mode: the dark scrim left every
   label in the Workspace tree dark-on-dark. */
body.theme-light.has-custom-bg #sidebar {
    background-color: rgba(255, 255, 255, 0.88) !important;
}

body.theme-light.has-custom-bg #bottombar,
body.theme-light.has-custom-bg #tabbar-container {
    background-color: rgba(255, 255, 255, 0.9) !important;
}

body.theme-light.has-custom-bg #titlebar {
    background-color: rgba(255, 255, 255, 0.86) !important;
}

body.theme-light.has-custom-bg #editor-container {
    /* Nearly-opaque frosted surface. At 0.55 the wallpaper showed straight
       through the glyphs and the code stopped being readable; the layout keeps
       the image visible around the editor while the text gets a real backdrop. */
    background-color: rgba(255, 255, 255, 0.9) !important;
    backdrop-filter: blur(10px) saturate(115%);
}

body.theme-light.has-custom-bg .ace_gutter {
    background-color: rgba(240, 242, 246, 0.72) !important;
    color: #8b92a1 !important;
}

/* Ace paints the current-line gutter strip a dark grey; on the light frosted
   surface it read as a smudge rather than a highlight. */
body.theme-light.has-custom-bg .ace_gutter-active-line {
    background-color: rgba(15, 20, 30, 0.06) !important;
}

body.theme-light.has-custom-bg .ace_marker-layer .ace_active-line {
    background-color: rgba(15, 20, 30, 0.04) !important;
}

body.theme-light.has-custom-bg .workspace-row,
body.theme-light.has-custom-bg .workspace-empty,
body.theme-light.has-custom-bg .script-item-name,
body.theme-light.has-custom-bg #workspace-count {
    color: var(--text-primary) !important;
}

body.theme-light.has-custom-bg .workspace-row .workspace-caret,
body.theme-light.has-custom-bg .workspace-row .workspace-more {
    color: var(--text-muted) !important;
}

body.theme-light.has-custom-bg .workspace-row:hover,
body.theme-light.has-custom-bg .workspace-row.selected {
    background: rgba(15, 20, 30, 0.07) !important;
}

:root {
    --ui-corner-radius: 6px;
    --color-primary: var(--file-icon, #4b82e8);
}

.action-btn, .scripthub-btn, .tab-item, .setting-segment, .setting-select, .theme-select-btn, .sound-option, .theme-option, .hub-card {
    border-radius: var(--ui-corner-radius) !important;
}

.setting-toggle.on {
    background-color: var(--color-primary, #4b82e8) !important;
}

.setting-segment-item.active {
    background: var(--color-primary, #4b82e8) !important;
}

.tab-item.active {
    border-bottom: 2px solid var(--color-primary, #ff9e3b) !important;
}

/* ---- Player Settings Pane Styles ---- */
.player-local-list {
    margin-top: 14px;
    background: var(--bg-sidebar, #121316);
    border: 1px solid var(--border-color, #24242c);
    border-radius: 8px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.player-local-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted, #8c8c9a);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.player-local-items {
    max-height: 180px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.player-local-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    border-radius: 6px;
    background: var(--bg-btn, rgba(255, 255, 255, 0.03));
    border: 1px solid var(--border-btn, rgba(255, 255, 255, 0.05));
    font-size: 12px;
    color: var(--text-primary, #ffffff);
    transition: background 0.15s ease, border-color 0.15s ease;
}

.player-local-item:hover {
    background: var(--bg-btn-hover, rgba(255, 255, 255, 0.08));
    border-color: var(--file-icon, #38bdf8);
}

.player-local-item-name {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.player-local-item-del {
    background: transparent;
    border: none;
    color: var(--text-muted, #7a7a86);
    cursor: pointer;
    padding: 3px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s ease;
}

.player-local-item-del:hover {
    color: #ff5c5c;
}

.player-local-empty {
    padding: 18px 10px;
    text-align: center;
    font-size: 11.5px;
    color: var(--text-dim, #666672);
}

/* Theme adaptation for music player widget */
.music-player-widget {
    background: var(--bg-sidebar, #16181d) !important;
    border-color: var(--border-color, rgba(255, 255, 255, 0.12)) !important;
    color: var(--text-primary, #e0e0e4) !important;
}

.mp-header {
    background: var(--bg-header, rgba(255, 255, 255, 0.03)) !important;
    border-bottom-color: var(--border-color, rgba(255, 255, 255, 0.06)) !important;
}

.mp-btn-play {
    background: var(--color-primary, var(--file-icon, #38bdf8)) !important;
    color: var(--bg-main, #000000) !important;
}

.mp-progress-bar-bg {
    background: var(--border-color, rgba(255, 255, 255, 0.15)) !important;
}

.mp-progress-bar-fill {
    background: var(--color-primary, var(--file-icon, #38bdf8)) !important;
}

.mp-progress-thumb {
    background: var(--text-primary, #ffffff) !important;
}

.mp-vinyl-center {
    background: var(--color-primary, var(--file-icon, #38bdf8)) !important;
}

.mp-cover-art {
    background: var(--bg-editor, #121214) !important;
    border-color: var(--border-color, rgba(255, 255, 255, 0.08)) !important;
    color: var(--color-primary, var(--file-icon, #38bdf8)) !important;
}

.mp-btn-ctrl {
    color: var(--text-muted, #9898a6) !important;
}

.mp-btn-ctrl:hover {
    color: var(--text-primary, #ffffff) !important;
}

.mp-btn-ctrl.active {
    color: var(--color-primary, var(--file-icon, #38bdf8)) !important;
}

.mp-btn-icon {
    color: var(--text-muted, #888894) !important;
}

.mp-btn-icon:hover {
    color: var(--text-primary, #ffffff) !important;
    background: var(--bg-btn-hover, rgba(255, 255, 255, 0.08)) !important;
}

.mp-btn-icon.close:hover {
    color: #ff5c5c !important;
    background: rgba(255, 92, 92, 0.15) !important;
}

.mp-track-name {
    color: var(--text-primary, #ffffff) !important;
}

.mp-artist-name {
    color: var(--text-muted, #8c8c9a) !important;
}

.mp-cur-time,
.mp-total-time,
#mp-cur-time,
#mp-total-time {
    color: var(--text-dim, #727280) !important;
}

.mp-title {
    color: var(--text-primary, #e0e0e4) !important;
}

.mp-details {
    color: var(--text-primary, #ffffff) !important;
}

.mp-connect-btn {
    background: var(--bg-btn, rgba(255, 255, 255, 0.05)) !important;
    border-color: var(--border-btn, rgba(255, 255, 255, 0.1)) !important;
    color: var(--text-muted, #c0c0ca) !important;
}

.mp-connect-btn:hover {
    background: var(--bg-btn-hover, rgba(255, 255, 255, 0.1)) !important;
    border-color: var(--color-primary, var(--file-icon, #38bdf8)) !important;
    color: var(--color-primary, var(--file-icon, #38bdf8)) !important;
}

.mp-playlist-drawer {
    border-top-color: var(--border-color, rgba(255, 255, 255, 0.08)) !important;
}

.mp-playlist-head {
    color: var(--text-muted, #92929e) !important;
}

.mp-track-item {
    color: var(--text-muted, #c4c4ce) !important;
}

.mp-track-item:hover {
    background: var(--bg-btn-hover, rgba(255, 255, 255, 0.07)) !important;
    color: var(--text-primary, #ffffff) !important;
}

.mp-track-item.active {
    background: var(--bg-btn-active, rgba(56, 189, 248, 0.15)) !important;
    color: var(--color-primary, var(--file-icon, #38bdf8)) !important;
}

.mp-custom-input-row input {
    background: var(--bg-editor, rgba(0, 0, 0, 0.35)) !important;
    border-color: var(--border-color, rgba(255, 255, 255, 0.1)) !important;
    color: var(--text-primary, #e0e0e0) !important;
}

.mp-custom-input-row button {
    background: var(--color-primary, var(--file-icon, #38bdf8)) !important;
    color: var(--bg-main, #000000) !important;
}

.mp-logo-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.mp-logo-icon svg {
    display: block;
}

/* Light Theme overrides for player */
body.theme-light .music-player-widget {
    background: #ffffff !important;
    border-color: #d1d5db !important;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12), 0 0 16px rgba(0, 0, 0, 0.06) !important;
}

body.theme-light .mp-header {
    background: #f3f4f6 !important;
    border-bottom-color: #e5e7eb !important;
}

body.theme-light .mp-title {
    color: #1f2430 !important;
}

body.theme-light .mp-track-name {
    color: #1f2430 !important;
}

body.theme-light .mp-artist-name {
    color: #6b7280 !important;
}

body.theme-light .mp-cover-art {
    background: #e5e7eb !important;
    border-color: #d1d5db !important;
}

body.theme-light .mp-btn-ctrl {
    color: #6b7280 !important;
}

body.theme-light .mp-btn-ctrl:hover {
    color: #111827 !important;
}

body.theme-light .mp-btn-icon {
    color: #6b7280 !important;
}

body.theme-light .mp-btn-icon:hover {
    color: #111827 !important;
    background: rgba(0, 0, 0, 0.06) !important;
}

body.theme-light .mp-playlist-drawer {
    border-top-color: #e5e7eb !important;
}

body.theme-light .mp-track-item {
    color: #4b5563 !important;
}

body.theme-light .mp-track-item:hover {
    background: #f3f4f6 !important;
    color: #111827 !important;
}

body.theme-light .mp-custom-input-row input {
    background: #f9fafb !important;
    border-color: #d1d5db !important;
    color: #111827 !important;
}

body.theme-light .mp-progress-bar-bg {
    background: #e5e7eb !important;
}

body.theme-light .mp-cur-time,
body.theme-light .mp-total-time,
body.theme-light #mp-cur-time,
body.theme-light #mp-total-time {
    color: #6b7280 !important;
}

body.theme-light .mp-btn-play {
    color: #ffffff !important;
}

/* ---- FFlags & Quick Engine Inputs Styling ---- */
.engine-input {
    background: var(--bg-main, #1c1c22);
    border: 1px solid var(--border-btn, #32323e);
    border-radius: 6px;
    color: var(--text-primary, #ffffff);
    font-size: 13px;
    font-weight: 600;
    padding: 6px 10px;
    outline: none;
    transition: all 0.15s ease;
    box-sizing: border-box;
    font-family: inherit;
}

.engine-input:focus {
    border-color: var(--file-icon, #38bdf8);
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

body.theme-light .engine-input {
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
    color: #1e293b !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

body.theme-light .engine-input:focus {
    border-color: var(--file-icon, #2563eb) !important;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15) !important;
}

/* Light Theme FFlag open button styling */
body.theme-light #btn-open-fflag-browser {
    background: var(--file-icon, #2563eb) !important;
    color: #ffffff !important;
    border: none !important;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25) !important;
}

body.theme-light #btn-open-fflag-browser:hover {
    background: #1d4ed8 !important;
}

body.theme-light #btn-apply-settings-fps {
    background: var(--file-icon, #2563eb) !important;
    color: #ffffff !important;
    border-color: var(--file-icon, #2563eb) !important;
    padding: 6px 14px !important;
    font-size: 12px !important;
    font-weight: 500 !important;
}

body.theme-light #btn-apply-settings-fps:hover {
    background: #1d4ed8 !important;
}

/* Setting Toggle Light Theme active state guarantee */
body.theme-light .setting-toggle.on {
    background-color: var(--file-icon, #2563eb) !important;
}

body.theme-light .setting-toggle.on::after {
    background: #ffffff !important;
}

/* Quick FPS pill container & input aesthetics */
.fps-quick-control {
    display: inline-flex;
    align-items: center;
    background: var(--bg-btn, rgba(255, 255, 255, 0.04));
    border: 1px solid var(--border-btn, rgba(255, 255, 255, 0.08));
    border-radius: 8px;
    padding: 3px 4px 3px 8px;
    gap: 6px;
    transition: all 0.18s ease;
}

.fps-quick-control:focus-within {
    border-color: var(--file-icon, #38bdf8);
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.18);
}

body.theme-light .fps-quick-control {
    background: #f8fafc;
    border-color: #cbd5e1;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

body.theme-light .fps-quick-control:focus-within {
    border-color: var(--file-icon, #2563eb);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.16);
}

.fps-quick-control input {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 4px 0 !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    color: var(--text-primary, #ffffff) !important;
    width: 64px !important;
    text-align: center !important;
    outline: none !important;
}

body.theme-light .fps-quick-control input {
    color: #0f172a !important;
}

.fps-quick-control .action-btn {
    border-radius: 6px !important;
    padding: 5px 12px !important;
    font-size: 11.5px !important;
    font-weight: 600 !important;
    background: var(--file-icon, #38bdf8) !important;
    color: #ffffff !important;
    border: none !important;
    cursor: pointer;
    transition: all 0.15s ease;
}

.fps-quick-control .action-btn:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

/* Settings Logs Viewer */
.settings-logs-viewer {
    height: 250px;
    overflow-y: auto;
    background: #0e0e12;
    border: 1px solid var(--border-color, #22222a);
    border-radius: 6px;
    padding: 8px 12px;
    font-family: 'JetBrains Mono', Consolas, monospace;
    font-size: 11.5px;
    line-height: 1.5;
    color: #c0c0c8;
    user-select: text;
    box-sizing: border-box;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

body.theme-light .settings-logs-viewer {
    background: #ffffff !important;
    border-color: var(--border-color, #d2d6df) !important;
    color: var(--console-text, #3f4756) !important;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
}

body.theme-light .settings-logs-viewer .console-line,
body.theme-light .console-drawer-body .console-line {
    color: var(--console-text, #3f4756) !important;
}

body.theme-light .settings-logs-viewer .console-time,
body.theme-light .console-drawer-body .console-time {
    color: #727b8e !important;
}

body.theme-light .settings-logs-viewer .console-line.error,
body.theme-light .console-drawer-body .console-line.error {
    color: #dc2626 !important;
}

body.theme-light .settings-logs-viewer .console-line.info .console-badge,
body.theme-light .console-drawer-body .console-line.info .console-badge {
    color: #0284c7 !important;
}

body.theme-light .settings-logs-viewer .console-line.step .console-badge,
body.theme-light .console-drawer-body .console-line.step .console-badge {
    color: #d97706 !important;
}

body.theme-light .settings-logs-viewer .console-line.ok .console-badge,
body.theme-light .settings-logs-viewer .console-line.success .console-badge,
body.theme-light .console-drawer-body .console-line.ok .console-badge,
body.theme-light .console-drawer-body .console-line.success .console-badge {
    color: #059669 !important;
}

.settings-btn-action {
    padding: 4px 10px;
    font-size: 11px;
    border-radius: 4px;
    background: var(--bg-btn, #1e1e24);
    color: var(--text-primary, #d0d0d8);
    border: 1px solid var(--border-color, #2a2a34);
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.settings-btn-action:hover {
    background: var(--bg-btn-hover, #282830);
    border-color: var(--border-btn, #3a3a46);
    color: #ffffff;
}

body.theme-light .settings-btn-action {
    background: #eef0f5 !important;
    border-color: var(--border-btn, #c0c6d2) !important;
    color: var(--text-primary, #212733) !important;
}

body.theme-light .settings-btn-action:hover {
    background: #e2e5ec !important;
    border-color: #aeb6c4 !important;
    color: #11141a !important;
}

/* A gradient is the selected interface background, not a tint beneath the
   preset theme. The extra app ID also beats light+wallpaper selectors.
   Removing gradient-enabled restores the original theme/wallpaper rules. */
body.gradient-enabled #app-container {
    background: var(--interface-gradient) !important;
}
body.gradient-enabled #app-container #main-content,
body.gradient-enabled #app-container #titlebar,
body.gradient-enabled #app-container #tabbar-container,
body.gradient-enabled #app-container #editor-container,
body.gradient-enabled #app-container #sidebar,
body.gradient-enabled #app-container #bottombar,
body.gradient-enabled #app-container #editor,
body.gradient-enabled #app-container .ace_editor,
body.gradient-enabled #app-container .ace_content,
body.gradient-enabled #app-container .ace_scroller,
body.gradient-enabled #app-container .ace_gutter {
    background: transparent !important;
}
body.gradient-enabled #custom-bg-layer { visibility: hidden; }
