:root {
    --bg-color: #1a1a1a;
    --primary-text: #e0e0e0;
    --secondary-text: #a0a0a0;
    --border-color: #444;
    --accent-color: #00aaff;
    --accent-hover: #0088cc;
    --card-bg: #2c2c2c;
    --modal-bg: #252525;
    --slot-empty: #333;
    --aura-color: #5f9ea0;
    --exilus-color: #8a2be2;
    --stance-color: #d4af37;
    --arcane-color: #ff69b4;
    --helminth-color: #ff69b4; 
    --archon-color: #ff8c00; 
    --delete-color: #9e2a2b;
    --delete-hover: #c13a3b;
    --incarnon-color: #f05a28;
    --riven-color: #a020f0; 
}

body {
    font-family: system-ui, sans-serif;
    background-color: var(--bg-color);
    color: var(--primary-text);
    margin: 0;
    padding: 20px;
    display: flex;
    align-items: center;
    min-height: 100vh;
    justify-content: center;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

html {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

body::-webkit-scrollbar,
html::-webkit-scrollbar {
    width: 0;
    height: 0;
}

.container {
    width: 100%;
    max-width: 1600px; 
}

h1,
h2,
h3,
h4 {
    text-align: center;
    color: var(--accent-color);
    text-shadow: 0 0 5px var(--accent-color);
}

.home-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    margin-bottom: 20px;
}

.site-logo {
    width: 80px;
    height: auto;
    filter: drop-shadow(0 0 6px var(--accent-color));
    margin-right: -8px;
}

.home-title h1 {
    margin: 0;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

#build-item-header {
    color: var(--primary-text);
    text-align: center;
    margin-top: -10px;
    margin-bottom: 20px;
    font-size: 1.2em;
}

#stats-sidebar h4, #conditionals-sidebar h4 {
    margin-top: 20px;
    color: var(--accent-color);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 5px;
    margin-bottom: 10px;
    text-align: left;
}
#stats-sidebar h4:first-child {
    margin-top: 0;
}

.editor-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

#share-build-btn {
    margin-left: auto;
    white-space: nowrap;
}

button {
    background-color: var(--accent-color);
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s;
}

button:hover {
    background-color: var(--accent-hover);
}

input,
select,
textarea {
    padding: 8px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    background-color: var(--card-bg);
    color: var(--primary-text);
    width: 100%;
    box-sizing: border-box;
    font-family: inherit;
}

#home-view,
#editor-view {
    display: none;
}

#trusted-builds-view {
    display: none;
    margin-bottom: 20px;
}

#build-list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#build-list li {
    background-color: var(--card-bg);
    padding: 15px;
    border-radius: 8px;
    border-left: 5px solid var(--accent-color);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.build-info {
    flex-grow: 1;
    cursor: pointer;
}

#build-list li:hover {
    transform: scale(1.02);
    box-shadow: 0 0 15px rgba(0, 170, 255, 0.3);
}

#build-list .build-type {
    font-style: italic;
    color: var(--secondary-text);
}

.build-actions button {
    background-color: #555;
    padding: 5px 10px;
    font-size: 0.9em;
    margin-left: 10px;
}

.build-actions button:hover {
    background-color: #666;
}

.build-actions .delete-btn {
    background-color: var(--delete-color);
}

.build-actions .delete-btn:hover {
    background-color: var(--delete-hover);
}

.home-actions {
    display: flex;
    text-align: center;
    margin-top: 20px;
    justify-content: center;
    flex-wrap: wrap;
    padding: 0;
}

.home-actions button {
    margin: 2px;
}

#editor-view {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 20px;
    margin-top: 20px;
}

#editor-main-wrapper {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 20px;
    position: relative;
    overflow: visible;
}

.mobile-tabs {
    display: none;
    gap: 10px;
    margin-bottom: 15px;
}

.editor-mobile-tab {
    flex: 1;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--secondary-text);
    padding: 10px 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.editor-mobile-tab.active,
.editor-mobile-tab:focus-visible {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    color: white;
    outline: none;
}

@media (max-width: 1200px) {
    #editor-view {
        grid-template-columns: 1fr;
    }
    #stats-sidebar {
        order: 2;
    }
    #editor-main-wrapper {
        order: 1;
    }
}

#stats-sidebar {
    background-color: var(--card-bg);
    padding: 15px;
    border-radius: 8px;
    height: fit-content;
    max-height: 85vh;
    overflow-y: auto;
}

#build-feature-toggles {
    display: none;
    flex-direction: column;
    gap: 8px;
    margin-top: 15px;
}

#build-feature-toggles label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--secondary-text);
}

#build-feature-toggles input[type="checkbox"] {
    width: auto;
}

#stats-list,
#weapon-stats-list ul {
    list-style: none;
    padding: 0;
}

#stats-list li,
#weapon-stats-list li {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    border-bottom: 1px solid var(--border-color);
}

.arcane-stats-section {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.arcane-stats-section h4 {
    margin: 0 0 8px;
    color: var(--accent-hover);
}

.arcane-stats-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.arcane-stats-list .arcane-stat {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 5px 0;
    border-bottom: 1px solid var(--border-color);
}

.arcane-stats-list .arcane-stat:last-child {
    border-bottom: none;
}

.arcane-stats-list .arcane-stat .arcane-stat-name {
    font-weight: 600;
}

.arcane-stats-list .arcane-stat .arcane-stat-value {
    text-align: left;
    color: var(--secondary-text);
    white-space: normal;
}
#weapon-stats-list li:last-child {
    border-bottom: none;
}
.fire-mode-stats {
    margin-bottom: 20px;
}
.fire-mode-stats h4 {
    color: var(--accent-hover);
    margin-bottom: 5px;
    text-align: left;
}
.fire-mode-stats h5 {
    color: var(--secondary-text);
    margin-top: 10px;
    margin-bottom: 5px;
    text-align: left;
    font-style: italic;
}

#progenitor-bonus-container {
    margin-bottom: 20px;
}
.progenitor-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}
#progenitor-element-select {
    flex-grow: 1;
}
#progenitor-value-input {
    width: 70px;
    text-align: right;
}
.progenitor-controls span {
    font-weight: bold;
}

#ability-slots-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    flex-wrap: nowrap;
    gap: 12px;
    margin-top: 10px;
}
#external-abilities-section {
    margin-bottom: 18px;
    display: none;
}
#external-ability-slots-container {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: flex-start;
    margin-top: 10px;
}
.ability-slot {
    width: 44px;
    height: 44px;
    background: radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.08), transparent 55%),
        linear-gradient(135deg, rgba(255, 255, 255, 0.07), rgba(0, 0, 0, 0.35));
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1em;
    font-weight: 700;
    letter-spacing: 0.03em;
    color: var(--primary-text);
    position: relative;
    cursor: pointer;
    box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.05), 0 6px 18px rgba(0, 0, 0, 0.45);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.ability-slot-icon {
    width: 36px;
    height: 36px;
    display: block;
    object-fit: contain;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    pointer-events: none;
}

.ability-slot:hover,
.ability-slot:focus-visible {
    transform: translateY(-2px) scale(1.05);
    box-shadow: inset 0 2px 6px rgba(255, 255, 255, 0.08), 0 12px 28px rgba(0, 170, 255, 0.25);
    border-color: var(--accent-color);
    outline: none;
}

.ability-slot.helminth {
    border-color: var(--helminth-color);
    box-shadow: inset 0 2px 6px rgba(255, 255, 255, 0.08), 0 10px 24px rgba(255, 105, 180, 0.25);
}
.ability-slot.external {
    border-color: rgba(148, 223, 255, 0.4);
}
.ability-slot.add-ability {
    font-size: 1.4em;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.85);
    background: radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.05), transparent 60%),
        linear-gradient(135deg, rgba(0, 170, 255, 0.08), rgba(0, 0, 0, 0.4));
    border: 1px dashed rgba(255, 255, 255, 0.15);
}
.ability-slot.add-ability:hover,
.ability-slot.add-ability:focus-visible {
    border-style: solid;
}

.ability-tooltip {
    position: fixed;
    width: min(320px, calc(100vw - 40px));
    background: linear-gradient(160deg, rgba(30, 30, 30, 0.95), rgba(18, 18, 18, 0.92));
    border: 1px solid rgba(0, 170, 255, 0.35);
    border-radius: 14px;
    padding: 18px 18px 16px;
    z-index: 1001;
    text-align: left;
    font-size: 0.92em;
    line-height: 1.5;
    color: var(--primary-text);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px) scale(0.98);
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(6px);
    pointer-events: none;
}

.ability-tooltip[data-visible="true"] {
    pointer-events: auto;
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.ability-tooltip::before {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid rgba(30, 30, 30, 0.95);
    bottom: -10px;
}

.ability-tooltip.ability-tooltip--flip::before {
    bottom: auto;
    top: -10px;
    border-top: none;
    border-bottom: 10px solid rgba(30, 30, 30, 0.95);
}

.ability-tooltip__inner {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ability-tooltip__header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ability-tooltip__slot-label {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(0, 170, 255, 0.45), rgba(0, 119, 178, 0.65));
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1em;
    text-shadow: 0 0 10px rgba(0, 170, 255, 0.65);
}

.ability-tooltip__slot-label.helminth {
    background: linear-gradient(135deg, rgba(255, 105, 180, 0.5), rgba(204, 32, 126, 0.65));
    text-shadow: 0 0 10px rgba(255, 105, 180, 0.6);
}

.ability-tooltip__heading {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.ability-tooltip__title {
    margin: 0;
    color: var(--primary-text);
    font-size: 1.05em;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.ability-tooltip__owner {
    font-size: 0.85em;
    color: var(--secondary-text);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.ability-tooltip__badge {
    font-size: 0.7em;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #fff;
    background: linear-gradient(135deg, rgba(255, 105, 180, 0.95), rgba(255, 168, 212, 0.8));
    border-radius: 999px;
    padding: 4px 10px;
    box-shadow: 0 0 10px rgba(255, 105, 180, 0.45);
}

.ability-tooltip__description {
    margin: 0;
    color: var(--secondary-text);
    font-style: italic;
}

.ability-tooltip__description a,
.ability-tooltip__misc a {
    color: var(--accent-color);
    text-decoration: underline;
}

.ability-tooltip__description a:hover,
.ability-tooltip__misc a:hover {
    color: #fff;
}

.ability-tooltip__stats-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ability-tooltip__stats-list li {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
}

.ability-tooltip__stat-label {
    color: var(--secondary-text);
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.ability-tooltip__stat-value {
    color: var(--accent-color);
    font-weight: 700;
    font-size: 0.95em;
    text-align: right;
}

.ability-tooltip__misc {
    margin-top: 4px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.85em;
    color: var(--secondary-text);
    line-height: 1.4;
}

#warframe-unequip-all-btn {
    margin-top: 15px;
    width: 100%;
}

.warframe-tab-header {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.warframe-tab-button {
    flex: 1;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 8px 10px;
    font-weight: 600;
    color: var(--secondary-text);
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.warframe-tab-button.active,
.warframe-tab-button:focus-visible {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    color: #fff;
    outline: none;
}

#warframe-tab-panels {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.warframe-tab-panel {
    display: none;
}

.warframe-tab-panel.active {
    display: block;
}

.warframe-dps-panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 16px;
}

.warframe-dps-external-status-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 4px;
}

.warframe-additional-controls-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 16px;
}

.warframe-additional-control {
    background-color: var(--slot-empty);
    border-radius: 8px;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.warframe-additional-control h4 {
    margin: 0;
    font-size: 1rem;
}

.warframe-additional-control .additional-control-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
}

.warframe-additional-control label {
    font-size: 0.85rem;
    color: var(--secondary-text);
}

.warframe-additional-control input,
.warframe-additional-control select {
    width: 100%;
    padding: 6px 8px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-color);
    color: inherit;
    font: inherit;
}

.warframe-additional-control .additional-control-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.warframe-ability-dps-controls {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
}

.warframe-ability-dps-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.warframe-ability-dps-controls select,
.warframe-ability-dps-controls button {
    max-width: 320px;
}
.additional-control-range-value {
    font-size: 0.75rem;
    color: var(--secondary-text);
    text-align: right;
}
.warframe-dps-external-status-controls {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    align-items: center;
    margin-top: 8px;
}

.warframe-dps-external-status-controls label {
    font-size: 0.85rem;
    color: var(--secondary-text);
}

.warframe-dps-external-status-controls select,
.warframe-dps-external-status-controls input {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background-color: var(--bg-color);
    color: inherit;
    font: inherit;
}

.warframe-dps-external-status-controls button {
    grid-column: 1 / -1;
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background-color: var(--accent-color);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
}

body.warframe-dps-view #headshot-toggle-row,
body.warframe-dps-view #weapon-stats-container > h4,
body.warframe-dps-view #weapon-stats-list,
body.warframe-dps-view #progenitor-bonus-container,
body.warframe-dps-view #exalted-strength-container {
    display: none !important;
}

body.warframe-dps-view #headshot-multiplier-row,
body.warframe-dps-view #headshot-multiplier,
body.warframe-dps-view #headshot-toggle,
body.warframe-dps-view #headshot-accuracy-row,
body.warframe-dps-view #head-crit-row,
body.warframe-dps-view #head-crit-inputs {
    display: none !important;
}

body.warframe-dps-view #head-crit-multi-row,
body.warframe-dps-view #head-crit-multi-inputs {
    display: none !important;
}

body.warframe-dps-view #enemy-shields-row,
body.warframe-dps-view #enemy-overguard-row,
body.warframe-dps-view #attenuation-row,
body.warframe-dps-view #attenuation-inputs {
    display: none !important;
}

#headshot-toggle:not(:checked) ~ #head-crit-multi-row,
#headshot-toggle:not(:checked) ~ #head-crit-multi-inputs {
    display: none;
}

body.warframe-dps-view .dps-controls button {
    display: none;
}

body.warframe-dps-view .dps-controls #calculate-dps-btn,
body.warframe-dps-view .dps-controls #luck-averaged-dps-btn {
    display: inline-flex;
}

#graph-strength-btn {
    display: none;
}

body.warframe-dps-view .dps-controls #graph-strength-btn {
    display: inline-flex;
}

body.warframe-dps-view .dps-controls #graph-strength-csv-btn {
    display: inline-flex;
}

body.warframe-dps-view .dps-controls #accurate-ammo-container,
body.warframe-dps-view .dps-controls label[for="dps-firing-mode"],
body.warframe-dps-view .dps-controls #dps-firing-mode,
body.warframe-dps-view .dps-controls #dps-stance-combo-container,
body.warframe-dps-view .dps-controls label[for="dps-stance-combo"] {
    display: none !important;
}

.warframe-external-buffs-section {
    display: flex;
    flex-direction: column;
    gap: 14px;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 16px;
    flex-shrink: 0;
}

.warframe-external-buffs-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    flex-wrap: wrap;
}

.warframe-external-buffs-heading h4 {
    margin: 0;
    text-align: left;
}

.warframe-external-buffs-note {
    margin: 6px 0 0;
    font-size: 0.85rem;
    color: var(--secondary-text);
    text-align: left;
}

.warframe-external-buffs-badge {
    background-color: var(--accent-color);
    color: var(--bg-color);
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
}

.warframe-external-buff-controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.warframe-external-buff-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
}

.warframe-external-buff-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.warframe-external-buff-field label {
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--secondary-text);
}

.warframe-external-buff-controls .add-btn {
    align-self: flex-start;
}

.warframe-external-buff-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.warframe-external-buff-item {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 14px;
    background-color: rgba(255, 255, 255, 0.03);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.warframe-external-buff-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    flex-wrap: wrap;
}

.warframe-external-buff-title-group {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
    min-width: 0;
}

.warframe-external-buff-name {
    font-weight: 600;
    font-size: 1rem;
    word-break: break-word;
}

.warframe-external-buff-element {
    font-size: 0.85rem;
    color: var(--accent-color);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.warframe-external-buff-total {
    font-weight: 600;
    font-size: 0.9rem;
    padding: 4px 10px;
    border-radius: 999px;
    background-color: rgba(0, 170, 255, 0.15);
    color: var(--accent-color);
}

.warframe-external-buff-auto-summary {
    font-size: 0.9rem;
    color: var(--secondary-text);
    margin-top: 4px;
}

.warframe-external-buff-sources {
    margin: 0;
    padding-left: 1.2rem;
    font-size: 0.85rem;
    color: var(--secondary-text);
}

.warframe-external-buff-manual {
    display: grid;
    grid-template-columns: max-content 1fr max-content;
    gap: 8px;
    align-items: center;
}

.warframe-external-buff-manual label {
    font-size: 0.85rem;
    color: var(--secondary-text);
}

.warframe-external-buff-manual input {
    width: 100%;
}

.warframe-external-buff-unit {
    font-size: 0.85rem;
    color: var(--secondary-text);
}

.warframe-external-buff-remove {
    align-self: flex-start;
    background: none;
    border: 1px solid var(--border-color);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.85rem;
    color: var(--secondary-text);
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.warframe-external-buff-remove:hover,
.warframe-external-buff-remove:focus-visible {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    color: var(--bg-color);
}

#warframe-external-buffs-mobile {
    width: 100%;
}

#editor-view:not(.mobile-mode) #warframe-external-buffs-mobile {
    display: none !important;
}

@media (max-width: 700px) {
    .warframe-external-buffs-section {
        padding: 14px;
    }

    .warframe-external-buff-fields {
        grid-template-columns: 1fr;
    }

    #warframe-external-buffs-mobile .warframe-external-buff-controls .add-btn {
        width: 100%;
    }
}

#main-content-area {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0; 
}

#mod-grid-container {
    background-color: var(--card-bg);
    padding: 20px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 600px;
}

#mod-slots {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    width: 100%;
}

.polarity-summary {
    display: flex;
    justify-content: center;
    gap: 20px;
    font-weight: 600;
    margin-bottom: 10px;
}

.special-slots-row {
    display: flex;
    justify-content: center;
    gap: 15px;
    width: 100%;
    align-items: stretch;
    flex-wrap: wrap;
}

.special-slots-row > .mod-slot-wrapper,
.special-slots-row > .arcane-slot-wrapper {
    flex: 0 1 250px;
    min-width: 180px;
    width: auto;
}

@media (min-width: 901px) {
    .special-slots-row[data-build-type="Melee"] {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 15px;
        align-items: stretch;
        justify-items: stretch;
    }

    .special-slots-row[data-build-type="Melee"] > .mod-slot-wrapper,
    .special-slots-row[data-build-type="Melee"] > .arcane-slot-wrapper {
        flex: unset;
        min-width: 0;
    }

    .special-slots-row[data-build-type="Melee"] .stance-slot-wrapper {
        grid-column: 2;
    }

    .special-slots-row[data-build-type="Melee"] .exilus-slot-wrapper {
        grid-column: 3;
    }

    .special-slots-row[data-build-type="Melee"] .melee-arcane-slot {
        grid-column: 4;
        justify-self: center;
    }
}

.main-mods-wrapper {
    display: grid;
    grid-template-columns: 4fr 1fr;
    gap: 15px;
    width: 100%;
    align-items: center;
}

.main-mod-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    width: 100%;
}

.main-mod-grid.companion-mod-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

#companion-weapon-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
}

#companion-weapon-header {
    grid-column: 1 / -1;
}

#companion-weapon-mod-slots {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 15px;
    align-items: stretch;
    width: 100%;
}

@media (max-width: 900px) {
    .mobile-tabs {
        display: flex;
    }

    #editor-view {
        gap: 15px;
    }

    #editor-view.mobile-mode {
        flex-direction: column;
    }

    #editor-main-wrapper,
    #stats-sidebar,
    #conditionals-sidebar {
        width: 100%;
    }

    #editor-main-wrapper {
        display: grid;
        grid-template-columns: 1fr;
        gap: 15px;
    }

    #editor-view.mobile-mode #main-content-area {
        display: none;
    }

    #editor-view.mobile-mode.mobile-panel-build #main-content-area {
        display: block;
    }

    #editor-view.mobile-mode #stats-sidebar {
        display: none;
        max-height: none;
        padding-bottom: 20px;
    }

    #editor-view.mobile-mode.mobile-panel-stats #stats-sidebar {
        display: block;
    }

    #editor-view.mobile-mode #conditionals-sidebar {
        display: none;
        border-radius: 8px;
        max-height: none;
        width: 100%;
        flex: 1 1 auto;
    }

    #editor-view.mobile-mode #conditionals-sidebar.hidden {
        width: 100%;
        flex: 1 1 auto;
    }

    #editor-view.mobile-mode.mobile-panel-conditionals #conditionals-sidebar {
        display: flex;
    }

    #editor-view.mobile-mode.mobile-panel-conditionals #conditionals-sidebar .conditionals-content,
    #editor-view.mobile-mode.mobile-panel-conditionals #conditionals-sidebar.hidden .conditionals-content {
        opacity: 1;
        pointer-events: auto;
    }

    #toggle-conditionals-btn {
        display: none;
    }

    .special-slots-row {
        justify-content: center;
    }

    .special-slots-row > .mod-slot-wrapper,
    .special-slots-row > .arcane-slot-wrapper {
        flex: 1 1 200px;
        min-width: 160px;
        max-width: 240px;
        width: auto;
    }

    .main-mods-wrapper {
        grid-template-columns: 1fr;
    }

    .main-mod-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }

    #mod-grid-container {
        padding: 15px;
        min-height: auto;
    }

    #mod-slots {
        gap: 12px;
    }

    #companion-weapon-mod-slots {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }

    .mod-slot-wrapper.exilus-with-arcane {
        max-width: 190px;
        margin: 10px auto 0;
        align-items: center;
    }

    .mod-slot-wrapper.exilus-with-arcane .arcane-slot-wrapper {
        position: static;
        top: auto;
        left: auto;
        transform: none;
        width: 100%;
        height: auto;
        margin: 12px 0 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 6px;
        order: 2;
    }

    .mod-slot-wrapper.exilus-with-arcane .rank-controls {
        order: 3;
    }

    .mod-slot-wrapper.exilus-with-arcane .arcane-slot {
        width: 100%;
        max-width: 150px;
        aspect-ratio: 9 / 7;
        height: auto;
    }
}

@media (max-width: 600px) {
    .main-mod-grid,
    #companion-weapon-mod-slots {
        grid-template-columns: repeat(2, minmax(140px, 1fr));
    }

    .special-slots-row {
        justify-content: center;
    }

    .special-slots-row > .mod-slot-wrapper,
    .special-slots-row > .arcane-slot-wrapper {
        flex: 1 1 150px;
        min-width: 140px;
        max-width: 200px;
        width: auto;
    }
}

.mod-slot-wrapper.companion-weapon-slot {
    width: 100%;
}

.mod-slot-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    position: relative;
    width: 100%;
}

.mod-slot-wrapper.exilus-with-arcane {
    
}

.mod-slot-wrapper:hover { z-index: 10; }

.mod-slot {
    width: 100%;
    aspect-ratio: 2 / 1;
    background-color: var(--slot-empty);
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    overflow: visible;
    display: flex;
    align-items: center;
    justify-content: center;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    color: var(--primary-text);
    font-size: 1.1em;
    font-weight: bold;
}

.mod-slot:hover {
    border-color: var(--accent-color);
    transform: scale(1.05);
}

.mod-slot.polarity-match {
    box-shadow: 0 0 12px rgba(80, 255, 160, 0.35);
}

.mod-slot.polarity-mismatch {
    box-shadow: 0 0 12px rgba(255, 120, 120, 0.25);
}

.slot-polarity-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 999px;
    background-color: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.15);
    letter-spacing: 0.03em;
    text-transform: none;
    display: flex;
    align-items: center;
    gap: 4px;
}

.slot-polarity-badge img {
    width: 14px;
    height: 14px;
    display: block;
}

.mod-cost-badge {
    position: absolute;
    bottom: 6px;
    right: 6px;
    font-size: 0.75rem;
    padding: 2px 7px;
    border-radius: 6px;
    background-color: rgba(0, 0, 0, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.mod-slot-wrapper.polarity-changed .slot-polarity-badge {
    background-color: rgba(255, 140, 0, 0.3);
    border-color: rgba(255, 140, 0, 0.45);
}

.polarity-select-preview {
    margin-top: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
}

.polarity-select-preview img {
    width: 20px;
    height: 20px;
    display: block;
}

.mod-slot.aura { border-color: var(--aura-color); }
.mod-slot.exilus { border-color: var(--exilus-color); }
.mod-slot.stance { border-color: var(--stance-color); }
.mod-slot.riven { 
    border-color: var(--riven-color); 
    background-color: #2c2038;
}

.mod-slot.riven-slot {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 12px 10px;
    gap: 6px;
    text-align: center;
    overflow: hidden;
}

.mod-slot.riven-slot > span {
    font-size: 0.85em;
    line-height: 1.15;
    text-align: center;
}

.riven-stats-display {
    font-size: 0.8em;
    font-weight: 600;
    line-height: 1.15;
    text-align: center;
    word-break: break-word;
    width: 100%;
}

.mod-slot-label {
    position: absolute;
    top: 5px;
    right: 8px;
    font-size: 0.7em;
    font-weight: bold;
    opacity: 0.7;
    text-shadow: 1px 1px 2px black;
}

.mod-slot.aura .mod-slot-label { color: var(--aura-color); }
.mod-slot.exilus .mod-slot-label { color: var(--exilus-color); }
.mod-slot.stance .mod-slot-label { color: var(--stance-color); }

.mod-name-display {
    font-size: 0.9em;
    padding: 5px;
    text-align: center;
}

.rank-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.rank-controls button {
    padding: 2px 8px;
    font-size: 1.2em;
    line-height: 1;
}

.mod-tooltip {
    display: none;
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 280%;
    background-size: 100% 100%;
    background-repeat: no-repeat;
    z-index: 100;
    pointer-events: none;
    transform: translateY(-25%);
}

.mod-slot:hover .mod-tooltip { display: block; }

#arcane-slots-container {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.arcane-slot-wrapper {
    position: relative;
}

.arcane-slot-label {
    display: block;
    text-align: center;
    font-size: 0.75em;
    color: var(--secondary-text);
    margin-bottom: 6px;
}

.archgun-arcane-slot .arcane-slot-label {
    color: var(--accent-color);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

@media (min-width: 901px) {
    .mod-slot-wrapper.exilus-with-arcane .arcane-slot-wrapper {
        position: absolute;
        top: -85px;
        left: 50%;
        transform: translateX(-50%);
        width: 90px;
        height: 70px;
    }
}

.arcane-slot {
    width: 90px;
    height: 70px;
    background-color: var(--slot-empty);
    border: 2px dashed var(--arcane-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(0 0 3px var(--arcane-color));
}
.arcane-slot:hover {
    transform: scale(1.1);
    border-color: var(--accent-color);
    filter: drop-shadow(0 0 8px var(--accent-color));
}

.arcane-tooltip {
    display: none;
    position: absolute;
    bottom: 105%;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--modal-bg);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    padding: 10px;
    width: 250px;
    z-index: 100;
    pointer-events: none;
    text-align: center;
}
.arcane-tooltip .arcane-name {
    color: var(--arcane-color);
    font-weight: bold;
    margin-bottom: 5px;
}
.arcane-slot-wrapper:hover .arcane-tooltip {
    display: block;
}

#archon-shard-slots-container {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.archon-shard-slot-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.archon-shard-slot {
    width: 40px;
    height: 80px;
    background-color: var(--slot-empty);
    border: 2px dashed var(--archon-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
}
.archon-shard-slot:hover {
    transform: scale(1.1);
    border-color: var(--accent-color);
}

.archon-shard-tooltip {
    display: none;
    position: absolute;
    bottom: 105%;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--modal-bg);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    padding: 10px;
    width: 220px;
    z-index: 100;
    pointer-events: none;
    text-align: center;
}

.archon-shard-tooltip-name {
    color: var(--archon-color);
    font-weight: bold;
    margin-bottom: 4px;
}

.archon-shard-tooltip-variant {
    color: var(--secondary-text);
    font-size: 0.85em;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.archon-shard-tooltip-effect {
    color: var(--primary-text);
    font-size: 0.9em;
}

.archon-shard-slot-wrapper:hover .archon-shard-tooltip {
    display: block;
}

#archon-shard-selection-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-height: 60vh;
    overflow-y: auto;
}
.shard-type-container {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
}
.shard-type-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}
.shard-type-header img {
    width: 32px;
    height: 32px;
}
.shard-type-header h4 {
    margin: 0;
    color: var(--primary-text);
}
.shard-effects-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.shard-effect-button {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--secondary-text);
    padding: 10px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    font-size: 0.9em;
    width: 100%;
}
.shard-effect-button:hover {
    background-color: var(--accent-hover);
    color: white;
    border-color: var(--accent-color);
}
.shard-effect-button strong {
    color: var(--primary-text);
}

#incarnon-evolutions-container {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.evolution-perk-slot {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--slot-empty);
    border: 2px solid var(--incarnon-color);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2em;
    font-weight: bold;
    color: var(--incarnon-color);
    user-select: none;
}

.evolution-perk-slot.disabled {
    cursor: not-allowed;
    opacity: 0.5;
    border-style: dashed;
}

.evolution-perk-slot:not(.disabled):hover {
    transform: scale(1.1);
    box-shadow: 0 0 10px var(--incarnon-color);
}

.evolution-perk-slot.active, .evolution-perk-slot.selected {
    background-color: var(--incarnon-color);
    color: var(--bg-color);
}

#incarnon-perk-selection-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 60vh;
    overflow-y: auto;
}

.incarnon-perk-item {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--primary-text);
    padding: 12px;
    text-align: left;
    width: 100%;
    font-size: 0.95em;
}
.incarnon-perk-item:hover {
    background-color: var(--accent-hover);
    border-color: var(--accent-color);
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: var(--modal-bg);
    padding: 25px;
    border-radius: 10px;
    width: 90%;
    max-width: 800px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
}

.modal.scrollable-modal {
    align-items: flex-start;
    padding: 30px 0;
}

.modal.scrollable-modal .modal-content {
    max-height: 90vh;
    overflow-y: auto;
}

.left-right-riven-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.left-right-riven-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.left-right-riven-column img {
    max-width: 100%;
    max-height: 320px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background-color: rgba(0, 0, 0, 0.25);
    object-fit: contain;
}

.modal-actions {
    margin-top: 20px;
    text-align: right;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.clear-cache-modal {
    max-width: 720px;
}

.clear-cache-question {
    margin: 0 0 12px;
    line-height: 1.5;
}

.clear-cache-choice {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.clear-cache-choice button {
    flex: 1;
    min-width: 180px;
}

.clear-cache-option-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 12px 0;
    max-height: 55vh;
    overflow-y: auto;
    padding-right: 4px;
}

.clear-cache-item {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.clear-cache-item-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.clear-cache-item-title {
    font-weight: 600;
    color: var(--primary-text);
}

.clear-cache-item-desc {
    color: var(--secondary-text);
    font-size: 0.9em;
    line-height: 1.4;
}

.clear-cache-footnote {
    color: var(--secondary-text);
    font-size: 0.9em;
    margin-top: 4px;
}

@media (max-width: 640px) {
    .clear-cache-choice button {
        flex: 1 1 100%;
    }

    .clear-cache-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .clear-cache-option-list {
        max-height: 45vh;
    }
}

#mod-selection-list, #arcane-selection-list, #helminth-selection-list {
    display: grid;
    gap: 15px;
    max-height: 60vh;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    padding: 10px;
}
#mod-selection-list {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}
#arcane-selection-list {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}

#helminth-selection-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}

@media (max-width: 600px) {
    #mod-selection-list {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 10px;
    }

    .mod-item {
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .mod-item img {
        width: auto;
        max-width: 100%;
        max-height: 110px;
        height: auto;
    }
}

.helminth-item {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--primary-text);
    padding: 12px;
    text-align: left;
    width: 100%;
    font-size: 0.95em;
    border-radius: 4px;
    cursor: pointer;
}
.helminth-item:hover {
    background-color: var(--accent-hover);
    border-color: var(--accent-color);
}

.mod-item img, .arcane-item img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s;
    object-fit: contain;
}
.arcane-item img {
    background-color: rgba(0,0,0,0.2);
    padding: 5px;
}

.mod-item img:hover, .arcane-item img:hover {
    transform: scale(1.05);
    box-shadow: 0 0 10px var(--accent-color);
}

.mod-item.riven-placeholder {
    background-color: var(--slot-empty);
    border: 2px dashed var(--riven-color);
    color: var(--riven-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2em;
    aspect-ratio: 2 / 1;
    cursor: pointer;
    border-radius: 8px;
}
.mod-item.riven-placeholder:hover {
    background-color: #2c2038;
}

.mod-item {
    position: relative;
}

.mod-preview {
    width: 100%;
    height: 100%;
}

.mod-favorite-toggle {
    position: absolute;
    top: 40px;
    right: 12px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.6);
    background: rgba(0, 0, 0, 0.25);
    color: transparent;
    -webkit-text-stroke: 1px rgba(0, 0, 0, 0.65);
    font-size: 18px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
    z-index: 2;
    transition: background-color 0.2s, color 0.2s, transform 0.1s, box-shadow 0.2s;
}

.mod-favorite-toggle:hover {
    background: rgba(0, 0, 0, 0.4);
    transform: scale(1.05);
}

.mod-favorite-toggle.active {
    color: #f6c344;
    -webkit-text-stroke: 0;
    background: rgba(255, 220, 120, 0.15);
    box-shadow: 0 0 0 1px rgba(255, 220, 120, 0.5);
    border-color: rgba(0, 0, 0, 0.4);
}

.arcane-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}
.arcane-item-name {
    font-size: 0.9em;
    text-align: center;
}

#mod-search, #arcane-search, #item-search, #helminth-search, #partner-filter-search {
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 10px;
}
#external-ability-search {
    font-size: 1rem;
}

#external-ability-list {
    max-height: 260px;
    overflow-y: auto;
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.external-ability-item {
    background-color: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--primary-text);
    padding: 10px 12px;
    text-align: left;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}
.external-ability-item:hover,
.external-ability-item.selected {
    border-color: var(--accent-color);
    background-color: rgba(0, 170, 255, 0.08);
}
.external-ability-item--disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.external-ability-item--disabled:hover {
    border-color: rgba(255, 255, 255, 0.08);
    background-color: var(--card-bg);
}
.external-ability-item__name {
    font-weight: 600;
    font-size: 0.95em;
}
.external-ability-item__owner {
    font-size: 0.8em;
    color: rgba(255, 255, 255, 0.6);
}
.external-ability-empty {
    text-align: center;
    padding: 16px;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.7);
}
#external-ability-inputs {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
#external-ability-inputs label {
    font-weight: 600;
}
#external-ability-inputs input {
    width: 100%;
    box-sizing: border-box;
}

#riven-stat-selectors {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.riven-review-note {
    margin: 0 0 12px 0;
    font-size: 0.9rem;
    color: #ccc;
}

.riven-review-preview {
    display: flex;
    justify-content: center;
    margin-bottom: 15px;
}

.riven-review-preview img {
    max-width: 100%;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}
.riven-stat-row {
    display: flex;
    align-items: center;
    gap: 10px;
}
.riven-stat-row select {
    flex-grow: 1;
}
.riven-stat-row .remove-stat-btn {
    background-color: var(--delete-color);
    padding: 5px 10px;
    font-size: 1em;
}
.riven-stat-row .remove-stat-btn:hover {
    background-color: var(--delete-hover);
}
.riven-stat-row.positive .stat-label {
    color: #4CAF50; 
    font-weight: bold;
}
.riven-stat-row.negative .stat-label {
    color: #F44336; 
    font-weight: bold;
}
.riven-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}
.riven-controls button {
    background-color: #555;
}
.riven-controls button:hover {
    background-color: #666;
}
.riven-controls button:disabled {
    background-color: #333;
    cursor: not-allowed;
    opacity: 0.5;
}

#item-selection-list {
    max-height: 50vh;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.item-selection-item {
    padding: 10px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s;
    border: 1px solid transparent;
}

.item-selection-item:hover {
    background-color: var(--card-bg);
}

.item-selection-item.selected {
    background-color: var(--accent-color);
    color: white;
    border-color: var(--accent-hover);
}

#build-details-container {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}
#build-description {
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 15px;
    resize: vertical;
    min-height: 80px;
}
#tags-container, #partner-builds-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
    min-height: 24px;
    align-items: center;
}
.tag-item {
    background-color: var(--accent-color);
    color: white;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.85em;
}
.partner-build-item {
    background-color: var(--card-bg);
    padding: 8px;
    border-radius: 4px;
    margin-top: 5px;
    border-left: 3px solid var(--accent-hover);
    width: 100%;
}
.sidebar-edit-btn {
    width: 100%;
    margin-top: 5px;
    background-color: #444;
    padding: 8px;
}
.sidebar-edit-btn:hover {
    background-color: #555;
}
.placeholder-text {
    font-style: italic;
    color: var(--secondary-text);
    font-size: 0.9em;
}

#tag-selection-list, #partner-build-selection-list, #partner-filter-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 60vh;
    overflow-y: auto;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
}
.tag-checkbox-item, .partner-checkbox-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}
.tag-checkbox-item:hover, .partner-checkbox-item:hover {
    background-color: var(--card-bg);
}
.tag-checkbox-item input, .partner-checkbox-item input {
    width: auto;
    cursor: pointer;
    flex-shrink: 0;
}
.partner-filter-option-category {
    margin-left: auto;
    color: var(--secondary-text);
    font-size: 0.85em;
}

.empty-partner-filter {
    padding: 12px 8px;
    color: var(--secondary-text);
    font-style: italic;
}
.tag-value-input {
    width: 60px;
    margin-left: auto;
}

#stance-stats-container {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 2px solid var(--stance-color);
}

#stance-stats-container h4 {
    color: var(--stance-color);
    text-align: left;
}

#stance-combo-select {
    width: 100%;
    margin-bottom: 10px;
}

#enemy-selection-container {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#attenuation-inputs {
    display: none;
    flex-direction: column;
    gap: 10px;
}

.enemy-stat-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 10px;
}

.enemy-stat-row label {
    font-size: 0.9em;
    color: var(--secondary-text);
}

.enemy-stat-row input[type="number"],
.enemy-stat-row select {
    width: 100%;
}

.enemy-stat-row.checkbox-row {
    grid-template-columns: 1fr auto;
}
.enemy-stat-row.checkbox-row input {
    width: auto;
    justify-self: end;
}
.enemy-stat-row.slider-row {
    grid-template-columns: auto 1fr auto;
}
.enemy-stat-row.slider-row #headshot-accuracy-value {
    min-width: 45px;
    width: 60px;
    text-align: right;
}

#dps-calculator-container {
    background-color: var(--card-bg);
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
}

.dps-controls {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.dps-controls label {
    font-weight: bold;
}
.dps-controls select {
    flex-grow: 1;
}
.dps-controls #simulation-time {
    width: 80px;
}

#dps-results {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    text-align: center;
}

.dps-result-item h4 {
    margin: 0 0 5px 0;
    font-size: 1.1em;
    color: var(--secondary-text);
}

.dps-result-item p {
    margin: 0;
    font-size: 1.8em;
    font-weight: bold;
    color: var(--accent-color);
}

.dps-sub-value {
    display: block;
    font-size: 0.6em;
    font-weight: normal;
    color: var(--primary-text);
}

#dps-log-container {
    margin-top: 20px;
}

#dps-log-output {
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    padding: 10px;
    height: 200px;
    overflow-x: auto;
    overflow-y: hidden;
    font-family: monospace;
    font-size: 0.9em;
    display: flex;
    gap: 10px;
}

.log-entry {
    flex-shrink: 0;
    border-right: 1px solid var(--border-color);
    padding: 5px 10px;
    width: 250px;
    white-space: normal;
}

.log-entry h5 {
    margin: 0 0 5px 0;
    color: var(--accent-color);
}

.log-entry p {
    margin: 2px 0;
    font-size: 0.85em;
}

.log-entry .status-proc {
    color: #ffd700; 
}
.log-entry .crit {
    color: #ff8c00; 
}
.log-entry .headshot {
    color: #ff4500; 
}
.log-entry .enemy-status-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px 8px;
    margin-top: 5px;
    border-top: 1px dashed var(--border-color);
    padding-top: 5px;
}

#conditionals-sidebar {
    background-color: var(--card-bg);
    border-radius: 8px 0 0 8px;
    width: 300px;
    flex: 0 0 300px;
    transition: width 0.3s ease-in-out, flex-basis 0.3s ease-in-out;
    position: relative;
    padding: 15px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

#conditionals-sidebar.hidden {
    width: 60px;
    flex-basis: 60px;
    padding-right: 10px;
}

#toggle-conditionals-btn {
    position: absolute;
    left: 0;
    top: 10px;
    width: 40px;
    height: 40px;
    border-radius: 5px 0 0 5px;
    padding: 0;
    font-size: 1.5em;
    line-height: 1;
    z-index: 5;
    transition: transform 0.3s ease-in-out;
}

#conditionals-sidebar.hidden #toggle-conditionals-btn {
    transform: rotate(180deg);
}

.conditionals-content {
    transition: opacity 0.2s ease-in-out;
    opacity: 1;
    display: flex;
    flex-direction: column;
}

#conditionals-sidebar.hidden .conditionals-content {
    opacity: 0;
    pointer-events: none;
}

#toggle-all-conditionals-btn {
    width: 100%;
    margin-bottom: 15px;
    background-color: #444;
}
#toggle-all-conditionals-btn:hover {
    background-color: #555;
}

#conditionals-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    overflow-y: auto;
    padding-right: 5px; 
    flex-shrink: 1;
}

.conditional-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.conditional-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.conditional-name {
    font-size: 0.95em;
    font-weight: bold;
    
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: help;
}

.switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 20px;
  flex-shrink: 0; 
}
.switch input { 
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: .4s;
  border-radius: 20px;
}
.slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}
input:checked + .slider {
  background-color: var(--accent-color);
}
input:checked + .slider:before {
  transform: translateX(20px);
}

.stack-control {
    display: flex;
    align-items: center;
    gap: 10px;
}
.stack-control input[type="range"] {
    flex-grow: 1;
    padding: 0;
}
.stack-control .stack-value {
    min-width: 40px;
    text-align: right;
    font-size: 0.9em;
    color: var(--secondary-text);
}

#external-status-manager {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.external-status-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.external-status-controls select {
    flex-grow: 1;
}

.external-status-controls input {
    width: 60px;
}

.external-status-controls button {
    padding: 8px 12px;
    font-size: 1.2em;
    line-height: 1;
}

#external-status-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.external-status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--slot-empty);
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.9em;
}

.external-status-item button {
    background-color: var(--delete-color);
    padding: 2px 8px;
    font-size: 0.9em;
}
.external-status-item button:hover {
    background-color: var(--delete-hover);
}

#blacklist-input-container {
    position: relative;
    margin-bottom: 15px;
}

#blacklist-search-results {
    position: absolute;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    margin-top: 5px;
    width: 100%;
    z-index: 1001;
    max-height: 200px;
    overflow-y: auto;
}

.auto-build-settings-modal {
    max-width: 640px;
    max-height: 80vh;
    overflow-y: auto;
}

.auto-build-settings-section {
    margin-bottom: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 16px;
}

.auto-build-settings-section:first-of-type {
    border-top: none;
    padding-top: 0;
}

.auto-build-settings-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.auto-build-targeting-controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.auto-build-targeting-controls input[type="range"] {
    width: 100%;
}

.auto-build-targeting-labels {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.auto-build-targeting-label {
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    color: rgba(255, 255, 255, 0.65);
    transition: background-color 0.2s ease, color 0.2s ease;
}

.auto-build-targeting-label:hover {
    background-color: rgba(255, 255, 255, 0.08);
}

.auto-build-targeting-label.active {
    color: #ffffff;
    font-weight: 600;
    background-color: rgba(255, 255, 255, 0.12);
}

.auto-build-settings-subsection {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.auto-build-limited-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 35vh;
    overflow-y: auto;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    padding: 10px;
}

.auto-build-limited-options label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
}

.auto-build-limited-quick {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.auto-build-limited-quick button {
    padding: 6px 12px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    background: transparent;
    color: inherit;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.auto-build-limited-quick button:hover,
.auto-build-limited-quick button.active {
    background-color: var(--accent-hover);
    border-color: var(--accent-color);
}

.auto-build-limited-selected {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.auto-build-limited-empty {
    font-size: 0.85rem;
    color: var(--secondary-text);
}

.auto-build-limited-custom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 4px 8px;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    font-size: 0.9rem;
}

.auto-build-limited-custom button {
    background-color: transparent;
    border: none;
    color: inherit;
    font-size: 1rem;
    cursor: pointer;
}

.auto-build-limited-preset-add {
    display: flex;
}

.auto-build-limited-preset-add select {
    width: 100%;
    padding: 6px 8px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    background-color: var(--card-bg);
    color: inherit;
}

.auto-build-limited-custom-add {
    display: flex;
    gap: 8px;
    align-items: center;
    grid-column: 1 / -1;
}

.auto-build-limited-custom-add input {
    flex: 1;
    padding: 6px 8px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    background-color: var(--card-bg);
    color: inherit;
}

.auto-build-limited-custom-add button {
    padding: 6px 12px;
}

.auto-build-settings-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.blacklist-search-item {
    padding: 8px 12px;
    cursor: pointer;
}

.blacklist-search-item:hover {
    background-color: var(--accent-hover);
}

#blacklist-list .external-status-item { 
    font-size: 1em;
}

.modal-progress {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 350px;
    background-color: var(--modal-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    z-index: 2000;
    transition: opacity 0.3s, transform 0.3s;
    opacity: 1;
    transform: translateY(0);
}

.modal-progress.hidden {
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
}

#auto-build-title {
    font-size: 1.1em;
    font-weight: bold;
    color: var(--accent-color);
    margin-bottom: 10px;
}

#auto-build-step {
    font-size: 0.9em;
    color: var(--primary-text);
    margin-bottom: 8px;
}

.progress-bar-container {
    width: 100%;
    height: 10px;
    background-color: var(--bg-color);
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 8px;
}

#auto-build-bar {
    width: 0%;
    height: 100%;
    background-color: var(--accent-color);
    transition: width 0.2s ease-in-out;
}

#auto-build-details {
    font-size: 0.8em;
    color: var(--secondary-text);
    min-height: 1.2em;
}

#blacklist-list {
    flex-grow: 0;
    max-height: 35vh;
    overflow-y: auto; 
    background-color: var(--bg-color); 
    border: 1px solid var(--border-color);
    border-radius: 5px;
    padding: 10px;
    margin-top: 5px;
}

.banner {
    width: fit-content;
    margin-left: auto;
    padding: 8px 16px;
    background-color: var(--card-bg);
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
}

.top-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.banner-left {
    margin-left: 0;
}

.banner-left button {
    background: none;
    border: none;
    color: var(--accent-color);
    font-weight: bold;
    cursor: pointer;
    padding: 0;
}

.banner-left button:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

.banner-left button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    text-decoration: none;
}

.banner-left button.is-loading::after {
    content: '';
    display: inline-block;
    width: 0.75rem;
    height: 0.75rem;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    margin-left: 0.35rem;
    vertical-align: middle;
    animation: trusted-toggle-spin 0.8s linear infinite;
}

@keyframes trusted-toggle-spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.build-filter-panel {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 18px 20px;
    margin: 20px auto;
    max-width: 1100px;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.filter-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.filter-search {
    flex: 1 1 320px;
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    padding: 10px 16px;
    cursor: text;
}

.filter-search input {
    border: none;
    background: transparent;
    color: var(--primary-text);
    width: 100%;
    font-size: 0.95rem;
}

.filter-search input:focus {
    outline: none;
}

.search-icon {
    width: 16px;
    height: 16px;
    border: 2px solid var(--secondary-text);
    border-radius: 50%;
    position: relative;
}

.search-icon::after {
    content: '';
    position: absolute;
    width: 8px;
    height: 2px;
    background-color: var(--secondary-text);
    border-radius: 999px;
    transform: rotate(45deg);
    right: -6px;
    bottom: -1px;
}

.filter-toolbar-actions {
    display: flex;
    gap: 8px;
}

.filter-toolbar-actions button {
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 0.95rem;
    cursor: pointer;
}

.tag-toggle-btn {
    background: none;
    border: none;
    padding: 6px;
    margin: -4px auto 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 50%;
    color: var(--secondary-text);
    transition: color 0.2s ease;
}

.tag-toggle-btn:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

.tag-toggle-btn.is-hidden {
    display: none;
}

.tag-toggle-btn .tag-toggle-icon {
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
}

.tag-toggle-btn:hover,
.tag-toggle-btn:focus-visible {
    color: var(--accent-color);
}

.tag-toggle-top {
    margin-top: 0;
}

.tag-toggle-bottom {
    margin-top: -4px;
}

.tag-toggle-btn[data-direction="down"] .tag-toggle-icon {
    border-bottom: 0;
    border-top: 8px solid currentColor;
}

.tag-toggle-btn[data-direction="up"] .tag-toggle-icon {
    border-top: 0;
    border-bottom: 8px solid currentColor;
}

.trusted-tag-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow: hidden;
    max-height: none;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    transition: max-height 0.3s ease, opacity 0.2s ease, transform 0.3s ease;
}

.trusted-tag-section.is-animating {
    will-change: max-height, opacity, transform;
}

.trusted-tag-section.is-collapsed {
    max-height: 0;
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
}

#reset-filters-btn {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--primary-text);
}

#reset-filters-btn:hover,
#reset-filters-btn:focus-visible {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.active-filter-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 32px;
}

.active-filter-list:empty::after {
    content: 'No filters applied. Add tags or refine your search to narrow things down.';
    color: var(--secondary-text);
    font-size: 0.9rem;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    background-color: rgba(90, 180, 255, 0.15);
    color: var(--primary-text);
    border: 1px solid rgba(90, 180, 255, 0.3);
    font-size: 0.85rem;
}

.filter-chip strong {
    font-weight: 600;
}

.filter-chip-remove {
    border: none;
    background: none;
    color: inherit;
    cursor: pointer;
    padding: 0;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 0.9rem;
    line-height: 1;
}

.filter-chip-remove:hover,
.filter-chip-remove:focus-visible {
    background-color: rgba(0, 0, 0, 0.15);
}

.filter-tag-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 16px;
}

.filter-tag-section:first-of-type {
    margin-top: 12px;
}

.filter-section-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--secondary-text);
}

.filter-tag-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-tag-grid:empty::after {
    content: 'Tags will appear once trusted builds are loaded.';
    color: var(--secondary-text);
    font-size: 0.85rem;
}

#trusted-filter-extra-list:empty::after {
    content: 'Additional filters appear once trusted builds are loaded.';
}

.filter-tag-button {
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--secondary-text);
    padding: 6px 14px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.filter-tag-button:hover,
.filter-tag-button:focus-visible {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.filter-tag-button.active {
    background: rgba(90, 180, 255, 0.24);
    border-color: rgba(90, 180, 255, 0.7);
    color: var(--primary-text);
}

.filter-tag-button.numeric-tag.active::after {
    content: ' (min)';
    font-weight: 500;
    font-size: 0.8rem;
    margin-left: 4px;
    color: inherit;
}

.filter-type-control {
    position: relative;
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}

.filter-type-control .filter-type-toggle {
    white-space: nowrap;
}

.filter-subtype-container {
    position: relative;
    width: 100%;
}

.filter-subtype-toggle {
    border: 1px solid rgba(90, 180, 255, 0.5);
    border-radius: 999px;
    background: rgba(90, 180, 255, 0.18);
    color: var(--primary-text);
    font-size: 0.7rem;
    padding: 4px 10px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.filter-subtype-toggle::after {
    content: '\25BE';
    font-size: 0.6rem;
    line-height: 1;
}

.filter-subtype-toggle:hover,
.filter-subtype-toggle:focus-visible {
    border-color: rgba(90, 180, 255, 0.8);
    background: rgba(90, 180, 255, 0.25);
}

.filter-subtype-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    background: rgba(24, 26, 31, 0.95);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 160px;
    z-index: 20;
}

.filter-subtype-option {
    border: none;
    background: transparent;
    color: var(--secondary-text);
    text-align: left;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
}

.filter-subtype-option:hover,
.filter-subtype-option:focus-visible {
    background: rgba(90, 180, 255, 0.2);
    color: var(--primary-text);
}

.filter-subtype-option.selected {
    background: rgba(90, 180, 255, 0.32);
    color: var(--primary-text);
    font-weight: 600;
}


.trusted-modal-content {
    max-width: 720px;
    width: 95%;
}

.trusted-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.trusted-modal-header h3 {
    margin: 0;
    text-align: left;
}

#close-trusted-builds-btn {
    background: none;
    border: none;
    color: var(--accent-color);
    font-size: 1.5rem;
    cursor: pointer;
}

.trusted-modal-note {
    margin-top: 0;
    color: var(--secondary-text);
}

.trusted-build-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-height: 55vh;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.trusted-build-list::-webkit-scrollbar {
    width: 0;
    height: 0;
}

.trusted-build-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    cursor: pointer;
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
    outline: none;
}

.trusted-build-card:hover,
.trusted-build-card:focus-visible {
    border-color: var(--accent-color);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
}

.trusted-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.trusted-card-titles {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.trusted-card-titles .build-name {
    font-size: 1.1rem;
    font-weight: 600;
}

.trusted-card-titles .build-item {
    color: var(--secondary-text);
    font-size: 0.9rem;
}

.trusted-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.trusted-card-type {
    font-weight: 600;
    color: var(--accent-color);
}

.trusted-card-pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--secondary-text);
    font-size: 0.8rem;
}

.trusted-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.trusted-tag-chip {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(90, 180, 255, 0.15);
    color: var(--primary-text);
    font-size: 0.8rem;
}

.trusted-empty {
    text-align: center;
    color: var(--secondary-text);
    padding: 24px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
}

#view-only-details {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    margin-top: 20px;
}

#view-only-details h3 {
    text-align: left;
    margin: 0;
}

.view-only-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.copy-edit-btn {
    background: var(--accent-color);
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 8px 18px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.copy-edit-btn:hover,
.copy-edit-btn:focus-visible {
    background: var(--accent-hover);
}

#view-only-details .detail-section {
    margin-bottom: 18px;
}

#view-only-details .detail-section:last-child {
    margin-bottom: 0;
}

#view-only-details .detail-section p {
    white-space: pre-line;
}

.detail-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.detail-summary-pill {
    background: rgba(255, 255, 255, 0.06);
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 0.85rem;
    color: var(--secondary-text);
}

.detail-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.detail-chip {
    background: rgba(90, 180, 255, 0.18);
    border-radius: 999px;
    padding: 6px 12px;
    color: var(--primary-text);
    font-size: 0.85rem;
}

.partner-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.partner-card {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--primary-text);
    padding: 8px 14px;
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.partner-card:hover,
.partner-card:focus-visible {
    border-color: var(--accent-color);
    background: rgba(90, 180, 255, 0.15);
}

.partner-card-disabled {
    cursor: not-allowed;
    opacity: 0.6;
    pointer-events: none;
}

.detail-empty-state {
    color: var(--secondary-text);
    font-size: 0.95rem;
    text-align: center;
}

.view-only-mode #dps-calculator-container,
.view-only-mode #build-details-container,
.view-only-mode #edit-tags-btn,
.view-only-mode #edit-partners-btn,
.view-only-mode #auto-build-settings-btn,
.view-only-mode #auto-build-btn,
.view-only-mode #slot-my-riven-btn,
.view-only-mode #slot-optimal-riven-btn,
.view-only-mode #riven-image-import-btn,
.view-only-mode #left-right-riven-btn,
.view-only-mode #warframe-unequip-all-btn,
.view-only-mode #unequip-all-btn,
.view-only-mode #accurate-ammo-container,
.view-only-mode #progenitor-element-select,
.view-only-mode #progenitor-value-input,
.view-only-mode #exalted-strength-container,
.view-only-mode #enemy-selection-container,
.view-only-mode #toggle-conditionals-btn,
.view-only-mode #conditionals-sidebar,
.view-only-mode #toggle-polarity-btn {
    display: none !important;
}

.view-only-mode #progenitor-display {
    display: block !important;
    color: var(--primary-text);
    margin-top: 8px;
}

.view-only-mode #polarity-summary {
    display: flex !important;
}

.view-only-mode .mod-slot,
.view-only-mode .mod-slot-wrapper,
.view-only-mode .arcane-slot,
.view-only-mode .arcane-slot-wrapper,
.view-only-mode .archon-shard-slot,
.view-only-mode .archon-shard-slot-wrapper,
.view-only-mode .incarnon-perk-slot {
    cursor: default;
}

.view-only-mode textarea,
.view-only-mode input,
.view-only-mode select {
    background-color: var(--card-bg);
    color: var(--primary-text);
}

.view-only-mode textarea[readonly] {
    cursor: default;
}

.banner a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: bold;
}

.banner a:hover {
    text-decoration: underline;
    color: var(--accent-hover);
}

h1,
h2,
h3,
h4 {
    text-align: center;
    color: var(--accent-color);
    text-shadow: 0 0 5px var(--accent-color);
}

#luck-averaged-dps-btn {
    background-color: #0077b6;
}
#luck-averaged-dps-btn:hover {
    background-color: #023e8a;
}
#luck-averaged-dps-btn:disabled {
    background-color: #333;
    cursor: not-allowed;
    opacity: 0.7;
}

#unequip-all-btn {
    background-color: var(--delete-color);
    margin-left: auto;
}
#unequip-all-btn:hover {
    background-color: var(--delete-hover);
}

#conditionals-sidebar .conditionals-content h4 {
    text-align: center;
    margin-left: 45px;
}

.mod-slot-wrapper.dragging {
    opacity: 0.5;
}

.mod-slot-wrapper.drag-over {
    border: 2px dashed #ccc;
}

.has-ui-hovertext {
    position: relative;
}

.ui-hovertext-tooltip {
    position: fixed;
    z-index: 9999;
    display: none;
    max-width: min(360px, calc(100vw - 32px));
    padding: 1rem 1.1rem;
    border-radius: 12px;
    border: 1px solid rgba(87, 208, 255, 0.4);
    background: linear-gradient(165deg, rgba(9, 14, 23, 0.95), rgba(17, 28, 44, 0.92));
    box-shadow: 0 22px 50px rgba(3, 8, 18, 0.55);
    color: #f5f8ff;
    font-size: 0.95rem;
    line-height: 1.45;
    pointer-events: none;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.16s ease, transform 0.18s ease;
    backdrop-filter: blur(14px);
    overflow: hidden;
}

.ui-hovertext-tooltip.visible {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.ui-hovertext-tooltip[data-placement="top"] {
    transform: translateY(-6px);
}

.ui-hovertext-tooltip[data-placement="top"].visible {
    transform: translateY(0);
}

.ui-hovertext-tooltip::after {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border: 10px solid transparent;
    pointer-events: none;
}

.ui-hovertext-tooltip[data-placement="top"]::after {
    top: 100%;
    left: calc(50% - 10px);
    border-top-color: rgba(17, 28, 44, 0.92);
}

.ui-hovertext-tooltip[data-placement="bottom"]::after {
    bottom: 100%;
    left: calc(50% - 10px);
    border-bottom-color: rgba(17, 28, 44, 0.92);
}

.ui-hovertext-tooltip[data-placement="left"]::after {
    left: 100%;
    top: calc(50% - 10px);
    border-left-color: rgba(17, 28, 44, 0.92);
}

.ui-hovertext-tooltip[data-placement="right"]::after {
    right: 100%;
    top: calc(50% - 10px);
    border-right-color: rgba(17, 28, 44, 0.92);
}

.ui-hovertext-tooltip .ui-hovertext-title {
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    margin-bottom: 0.55rem;
    color: #8ee4ff;
    text-shadow: 0 0 10px rgba(89, 200, 255, 0.55);
}

.ui-hovertext-tooltip .ui-hovertext-media {
    margin: 0 0 0.65rem;
}

.ui-hovertext-tooltip .ui-hovertext-media img {
    width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

.ui-hovertext-tooltip .ui-hovertext-media figcaption {
    margin-top: 0.35rem;
    font-size: 0.8rem;
    color: rgba(227, 236, 255, 0.78);
    text-align: center;
}

.ui-hovertext-tooltip .ui-hovertext-body p {
    margin: 0 0 0.45rem;
}

.ui-hovertext-tooltip .ui-hovertext-body p:last-child {
    margin-bottom: 0;
}

.ui-hovertext-tooltip .ui-hovertext-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 0.85rem;
}

.ui-hovertext-tooltip .ui-hovertext-links a {
    color: #9ae2ff;
    text-decoration: none;
    border-bottom: 1px dashed rgba(154, 226, 255, 0.55);
    padding-bottom: 0.1rem;
    transition: color 0.18s ease, border-color 0.18s ease;
}

.ui-hovertext-tooltip .ui-hovertext-links a:hover {
    color: #ffffff;
    border-bottom-color: rgba(255, 255, 255, 0.85);
}

.ui-hovertext-tooltip .ui-hovertext-custom {
    margin-top: 0.5rem;
}

.rolls-scan-section {
    margin-bottom: 1.25rem;
}

.rolls-scan-section h4 {
    margin: 0 0 0.4rem;
    font-size: 1rem;
}

.rolls-scan-hint {
    margin: 0 0 0.65rem;
    font-size: 0.85rem;
    color: #b5c4d6;
}

.rolls-scan-option-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.rolls-scan-option {
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
    color: #f5f5f5;
    padding: 0.35rem 0.65rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.rolls-scan-option:hover {
    border-color: rgba(84, 172, 255, 0.7);
}

.rolls-scan-option.active {
    border-color: #4da3ff;
    background: rgba(77, 163, 255, 0.2);
}

.rolls-scan-empty {
    margin: 0;
    font-size: 0.85rem;
    color: #a2b1c2;
}
