/* Lineage 2 Web Application — configurable local Geoform typography. */

@font-face { font-family: 'Find Sans Pro'; src: url('/static/fonts/FindSansPro.ttf') format('truetype'); font-display: swap; }
@font-face { font-family: 'Geoform'; src: url('/static/fonts/Geoform.ttf') format('truetype'); font-display: swap; }

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: var(--project-body-font, 'Geoform'), cursive, sans-serif;
}

:root {
    --bg-dark:        #0a0c13;
    --bg-surface:     rgba(19, 23, 34, 0.3);
    --bg-card:        rgba(24, 29, 44, 0.35);
    --bg-card-hover:  rgba(33, 40, 60, 0.5);
    --bg-input:       rgba(10, 12, 19, 0.5);

    --primary-gold:   #d4af37;
    --gold-light:     #fcd34d;
    --gold-dim:       rgba(212, 175, 55, 0.15);
    --gold-glow:      rgba(212, 175, 55, 0.4);

    --blue-accent:    #3b82f6;
    --green-accent:   #10b981;
    --purple-accent:  #a855f7;

    --text-main:      #f8fafc;
    --text-sub:       #cbd5e1;
    --text-muted:     #94a3b8;

    --border-color:   rgba(212, 175, 55, 0.25);
    --border-subtle:  rgba(255, 255, 255, 0.12);

    --font-heading:   var(--project-body-font, 'Geoform'), cursive, sans-serif;
    --font-body:      var(--project-body-font, 'Geoform'), cursive, sans-serif;
}

/* Profession insignia is a static screen-space image, independent of the
   model, camera and animation loop. Assignments are editable in Appearance. */
#main-3d-stage .l2-profession-emblem {
    position: absolute;
    top: 72px;
    right: 18px;
    left: auto;
    z-index: 11;
    width: min(360px, 44vw);
    text-align: center;
    pointer-events: none;
    user-select: none;
    color: #e9d5a5;
    text-shadow: 0 2px 4px #000;
}

#main-3d-stage .l2-profession-emblem[hidden] { display: none; }
#main-3d-stage .l2-profession-emblem img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    object-fit: contain;
}
#main-3d-stage .l2-profession-emblem span {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

@media (max-width: 760px) {
    #main-3d-stage .l2-profession-emblem {
        top: 66px;
        right: 4px;
        left: auto;
        width: min(240px, 46vw);
    }
    #main-3d-stage .l2-profession-emblem span { font-size: 10px; }
}

body {
    background-color: var(--bg-dark);
    background-image: 
        linear-gradient(180deg, 
            rgba(10, 12, 19, 0.2) 0%, 
            rgba(10, 12, 19, 0.4) 30%, 
            rgba(10, 12, 19, 0.85) 70%, 
            #0a0c13 98%),
        url('/static/images/site_bg.png');
    background-repeat: no-repeat;
    background-position: center top;
    background-size: cover;
    background-attachment: fixed;
    color: var(--text-main);
    font-family: var(--project-body-font, 'Geoform'), cursive, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
}

button, input, select, textarea, option {
    font-family: var(--project-body-font, 'Geoform'), cursive, sans-serif;
}

/* TOP GLOBAL NAVIGATION BAR */
.top-nav-bar {
    height: 64px;
    background: rgba(10, 12, 19, 0.35);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 32px;
}

.brand-logo {
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.l2-logo-text {
    font-family: var(--project-body-font, 'Geoform'), cursive, sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 2px;
    background: linear-gradient(180deg, #ffffff 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.main-links {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-link {
    color: var(--text-sub);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: color 0.2s ease;
}

.nav-link:hover, .nav-link.active {
    color: var(--primary-gold);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 18px;
}

.icon-btn {
    background: transparent;
    border: none;
    color: var(--text-sub);
    font-size: 1.1rem;
    cursor: pointer;
    transition: color 0.2s ease;
}

.icon-btn:hover {
    color: var(--primary-gold);
}

.user-profile-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(19, 23, 34, 0.3);
    backdrop-filter: blur(8px);
    padding: 4px 12px 4px 6px;
    border-radius: 20px;
    border: 1px solid var(--border-subtle);
}

.avatar-circle img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center 18%;
}

.profile-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 0.8rem;
    font-weight: 700;
    color: #ffffff;
}

.status-online {
    font-size: 0.65rem;
    color: var(--green-accent);
}

.btn-download-game {
    background: linear-gradient(135deg, #d4af37 0%, #b48811 100%);
    color: #000000;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.78rem;
    padding: 8px 18px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-download-game:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.5);
}

.victory-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    height: 112px;
    min-height: 112px;
    padding: 18px clamp(26px, 4vw, 60px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    overflow: hidden;
    border-bottom: 1px solid rgba(212,175,55,.3);
    background: linear-gradient(90deg, rgba(10,12,19,.78) 0%, rgba(10,12,19,.58) 55%, rgba(10,12,19,.42) 100%);
    backdrop-filter: blur(7px);
    box-shadow: 0 20px 55px rgba(0,0,0,.34);
}
.victory-header::after { content: ''; position: absolute; inset: auto 0 0; height: 1px; background: linear-gradient(90deg,transparent,var(--primary-gold),transparent); opacity: .55; }
.victory-header-content { position: relative; z-index: 1; min-width: 0; max-width: none; }
.victory-header .hero-title { margin: 0; font-size: clamp(1.12rem, 2.05vw, 1.85rem); white-space: nowrap; }
.victory-header-side { position: relative; z-index: 1; margin-left: auto; display: flex; flex: 0 0 auto; flex-direction: row; align-items: center; gap: 12px; }
.victory-header-side .hero-buttons { justify-content: flex-end; gap: 8px; }
.victory-header-account { position: relative; z-index: 1; }
.victory-header .user-profile-badge { min-height: 44px; padding: 5px 12px 5px 6px; background: rgba(10,12,19,.7); border-color: rgba(212,175,55,.34); }
.victory-header .btn-hero-primary,.victory-header .btn-hero-secondary { min-height: 42px; padding: 9px 14px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; white-space: nowrap; }
.victory-header .btn-hero-secondary { text-decoration: none; }

/* APP MAIN LAYOUT */
.app-layout {
    display: flex;
    min-height: calc(100vh - 112px);
}

/* LEFT SIDEBAR */
.sidebar {
    width: 240px;
    background: rgba(19, 23, 34, 0.3);
    backdrop-filter: blur(10px);
    border-right: 1px solid var(--border-subtle);
    padding: 20px 14px;
    flex-shrink: 0;
    position: sticky;
    top: 112px;
    height: calc(100vh - 112px);
    overflow-y: auto;
}

.sidebar-group-title {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 8px;
    color: var(--text-sub);
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 600;
    margin-bottom: 4px;
    transition: all 0.2s ease;
}

.sidebar-item:hover {
    background: rgba(24, 29, 44, 0.45);
    color: #ffffff;
}

.sidebar-item.active {
    background: var(--gold-dim);
    color: var(--primary-gold);
    border: 1px solid var(--border-color);
}

.my-builds-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 14px;
}

.my-build-card {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(24, 29, 44, 0.3);
    backdrop-filter: blur(6px);
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    border: 1px solid var(--border-subtle);
}

.build-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}

.build-icon.pve { background: rgba(59, 130, 246, 0.2); color: var(--blue-accent); }
.build-icon.pvp { background: rgba(239, 68, 68, 0.2); color: #ef4444; }
.build-icon.farm { background: rgba(212, 175, 55, 0.2); color: var(--primary-gold); }

.build-info .title { font-size: 0.8rem; font-weight: 700; color: #fff; }
.build-info .sub { font-size: 0.68rem; color: var(--text-muted); }

.btn-create-build-side {
    width: 100%;
    padding: 10px;
    background: transparent;
    border: 1px dashed var(--border-color);
    color: var(--primary-gold);
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.2s ease;
}

.btn-create-build-side:hover {
    background: var(--gold-dim);
}

/* MAIN CONTENT */
.main-content {
    flex: 1;
    padding: 24px 32px;
    overflow-y: auto;
}

/* HERO BANNER CARD */
.hero-banner {
    position: relative;
    padding: 24px 32px;
    background: rgba(19, 23, 34, 0.3);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.hero-content {
    position: relative;
    z-index: 10;
    max-width: 560px;
}

.replacement-summary-hero { margin-bottom: 24px; overflow: hidden; border: 1px solid rgba(212,175,55,.3); border-radius: 16px; background: linear-gradient(145deg,rgba(24,29,44,.7),rgba(10,12,19,.62)); box-shadow: 0 16px 45px rgba(0,0,0,.28); }
.replacement-summary-under-constructor { width: 100%; margin: 24px 0 0; box-sizing: border-box; }
.replacement-summary-heading { padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--border-subtle); }
.replacement-summary-heading h2 { margin: 4px 0 5px; color: #fff; font-size: 1.08rem; }
.replacement-summary-heading p { margin: 0; color: var(--text-muted); font-size: .76rem; line-height: 1.5; }
.replacement-summary-heading .section-kicker { color: var(--primary-gold); font-size: .72rem; font-weight: 800; letter-spacing: .14em; }
.replacement-direction { padding: 6px 10px; flex: 0 0 auto; border: 1px solid rgba(212,175,55,.34); border-radius: 8px; background: var(--gold-dim); color: var(--gold-light); font-size: .7rem; font-weight: 700; }
.replacement-top-five { padding: 8px; display: flex; align-items: stretch; gap: 7px; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; scrollbar-color: rgba(212,175,55,.55) rgba(255,255,255,.04); }
.replacement-top-five::-webkit-scrollbar { height: 5px; }
.replacement-top-five::-webkit-scrollbar-thumb { border-radius: 999px; background: rgba(212,175,55,.55); }
.replacement-empty { padding: 25px 15px; color: var(--text-muted); font-size: .8rem; text-align: center; }
.replacement-rank-card { position: relative; min-width: 218px; flex: 1 1 218px; padding: 8px; display: flex; flex-direction: column; align-items: stretch; gap: 6px; border: 1px solid var(--border-subtle); border-radius: 9px; background: rgba(10,12,19,.46); }
.replacement-rank-card:first-child { border-color: rgba(212,175,55,.5); background: linear-gradient(90deg,rgba(212,175,55,.11),rgba(10,12,19,.46)); }
.replacement-rank { flex: 0 0 auto; width: 21px; height: 21px; display: grid; place-items: center; border-radius: 5px; background: rgba(8,10,15,.9); color: var(--text-sub); font-size: .6rem; font-weight: 800; }
.replacement-rank-card:first-child .replacement-rank { background: var(--primary-gold); color: #111; }
.replacement-rank-header { min-width: 0; display: flex; align-items: flex-start; gap: 6px; }
.replacement-rank-body { min-width: 0; display: grid; grid-template-columns: 50px minmax(0,1fr); align-items: start; gap: 7px; }
.replacement-rank-body.no-icon { grid-template-columns: minmax(0,1fr); }
.replacement-rank-details { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.replacement-rank-icon { position: relative; width: 50px; height: 50px; margin: 0; flex: 0 0 auto; overflow: hidden; border: 1px solid var(--border-color); border-radius: 7px; background: #05070b; }
.replacement-rank-icon img,.replacement-rank-icon .item-icon-composite { width: 100% !important; height: 100% !important; }
.replacement-rank-name { min-width: 0; flex: 1 1 auto; }
.replacement-rank-name > strong,.replacement-rank-name > span { display: block; }
.replacement-rank-name strong { overflow: hidden; color: #fff; font-size: .72rem; line-height: 1.25; text-align: left; }
.replacement-rank-name > span { margin-top: 3px; color: var(--text-muted); font-size: .63rem; text-align: left; }
.replacement-boosts { min-width: 0; display: flex; flex-wrap: wrap; align-content: flex-start; gap: 3px; }
.replacement-boost { padding: 2px 5px; border-radius: 5px; background: rgba(16,185,129,.1); color: #6ee7b7; font-size: .59rem; line-height: 1.25; }
.replacement-trigger-boost { background: rgba(168,85,247,.12); color: #d8b4fe; }
.replacement-condition-boost { background: rgba(245,158,11,.1); color: #fbbf24; }
.replacement-cost { margin-top: auto; padding-top: 5px; border-top: 1px solid var(--border-subtle); text-align: left; }
.replacement-cost strong,.replacement-cost span { display: block; }
.replacement-cost strong { color: var(--gold-light); font-size: .64rem; white-space: nowrap; }
.replacement-cost span { margin-top: 2px; color: var(--text-muted); font-size: .58rem; }

@media (max-width: 1050px) {
    .victory-header { gap: 18px; }
    .victory-header .profile-info { display: none; }
    .victory-header .user-profile-badge { padding-right: 6px; }
}

@media (max-width: 720px) {
    .victory-header { position: relative; height: auto; min-height: 0; padding: 14px 16px; align-items: stretch; flex-direction: column; gap: 11px; }
    .victory-header-content { width: 100%; }
    .victory-header .hero-tag { margin-bottom: 4px; font-size: .65rem; }
    .victory-header .hero-title { width: 100%; font-size: clamp(.82rem, 4vw, 1.25rem); letter-spacing: 0; }
    .victory-header-side { width: 100%; margin: 0; justify-content: flex-end; gap: 8px; }
    .victory-header .hero-buttons { min-width: 0; flex-wrap: nowrap; }
    .victory-header .btn-hero-primary,.victory-header .btn-hero-secondary { min-height: 38px; padding: 7px 10px; font-size: .68rem; }
    .victory-header .user-profile-badge { min-height: 40px; padding: 4px 8px 4px 4px; }
    .victory-header .profile-info { display: none; }
    .app-layout { min-height: 0; display: block; }
    .sidebar { position: sticky; top: 0; z-index: 900; width: 100%; height: auto; padding: 10px; overflow-x: auto; }
    .sidebar-group-title,.my-builds-list,.btn-create-build-side { display: none; }
    .sidebar-menu { display: flex; gap: 6px; }
    .sidebar-item { flex: 0 0 auto; margin: 0; padding: 8px 10px; }
    .sidebar-item span { display: none; }
    .main-content { padding: 14px 10px; }
}

@media (max-width: 440px) { .replacement-rank-card { min-width: 205px; flex-basis: 205px; } }

.right-hero-column { min-height: 0; overflow: hidden; }
.right-hero-column .active-sets-box { min-height: 0; display: flex; flex: 1 1 0; flex-direction: column; overflow: hidden; box-sizing: border-box; }
.equipment-effects-heading { flex: 0 0 auto; }
.equipment-effects-scroll { position: relative; z-index: 1; height: 0; min-height: 0; max-height: 100%; flex: 1 1 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; scrollbar-gutter: stable; padding-right: 7px; display: flex; flex-direction: column; align-items: stretch; gap: 7px; color: var(--text-sub); line-height: 1.4; scrollbar-width: auto; scrollbar-color: var(--primary-gold) rgba(255,255,255,.06); }
.equipment-effects-scroll > * { flex: 0 0 auto; }
.equipment-effects-scroll::-webkit-scrollbar { width: 12px; }
.equipment-effects-scroll::-webkit-scrollbar-track { border-radius: 8px; background: rgba(255,255,255,.06); }
.equipment-effects-scroll::-webkit-scrollbar-thumb { min-height: 36px; border: 3px solid transparent; border-radius: 8px; background: var(--primary-gold); background-clip: padding-box; }
.equipment-effects-scroll::-webkit-scrollbar-thumb:hover { background: var(--gold-light); background-clip: padding-box; }
.equipment-effects-empty { padding: 12px; color: var(--text-muted); font-size: .78rem; text-align: center; }
.equipment-weapon-warning { padding: 9px; border: 1px solid rgba(245,158,11,.35); border-radius: 8px; background: rgba(245,158,11,.08); color: #fbbf24; font-size: .7rem; line-height: 1.45; }
.equipment-effect-item { border: 1px solid var(--border-subtle); border-radius: 9px; background: rgba(255,255,255,.02); overflow: hidden; }
.equipment-effect-item[open] { border-color: rgba(212,175,55,.3); }
.equipment-effect-item summary { padding: 9px; display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 8px; cursor: pointer; list-style: none; }
.equipment-effect-item summary::-webkit-details-marker { display: none; }
.equipment-effect-item summary strong { overflow: hidden; color: #fff; font-size: .74rem; text-overflow: ellipsis; white-space: nowrap; }
.equipment-effect-status { color: #6ee7b7; font-size: .63rem; }
.equipment-effect-status.inactive { color: #fbbf24; }
.equipment-effect-body { padding: 0 9px 9px; border-top: 1px solid rgba(255,255,255,.05); }
.equipment-effect-body p { margin: 7px 0 0; color: var(--text-sub); font-size: .68rem; line-height: 1.5; white-space: pre-line; }
.equipment-effect-body b { color: var(--gold-light); }
.equipment-trigger-list { padding: 8px; display: grid; gap: 7px; }
.equipment-trigger-card { overflow: hidden; border: 1px solid rgba(168,85,247,.25); border-radius: 8px; background: linear-gradient(135deg, rgba(168,85,247,.09), rgba(14,17,26,.62)); }
.equipment-effect-body > .equipment-trigger-card { margin-top: 8px; }
.equipment-trigger-source { min-width: 0; padding: 7px 8px; display: grid; grid-template-columns: 22px minmax(0,1fr) auto; align-items: center; gap: 6px; border-bottom: 1px solid rgba(168,85,247,.16); }
.equipment-trigger-source > strong { min-width: 0; overflow: hidden; font-size: .68rem; text-overflow: ellipsis; white-space: nowrap; }
.equipment-trigger-source > span:last-child { color: #c4b5fd; font-size: .57rem; white-space: nowrap; }
.equipment-trigger-symbol { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 6px; background: rgba(168,85,247,.16); color: #d8b4fe; font-size: .62rem; }
.equipment-trigger-content { padding: 7px 8px; display: grid; gap: 6px; }
.equipment-trigger-content > div { display: grid; grid-template-columns: 48px minmax(0,1fr); align-items: start; gap: 7px; }
.equipment-trigger-content b { padding-top: 1px; color: #a78bfa; font-size: .55rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.equipment-trigger-content span { color: #e9ddff; font-size: .66rem; line-height: 1.45; }
.equipment-nested-effects { margin-top: 8px; padding: 7px; display: grid; gap: 6px; border-top: 1px solid rgba(255,255,255,.06); border-radius: 0 0 8px 8px; background: rgba(0,0,0,.16); }
.equipment-effect-nested { border-color: rgba(212,175,55,.18); background: rgba(255,255,255,.018); }
.equipment-effect-nested summary { padding: 7px 8px; }
.equipment-effect-nested summary strong { font-size: .68rem; }
.equipment-effect-nested .equipment-effect-body { padding: 0 8px 8px; }

.hero-tag {
    font-family: var(--project-body-font, 'Geoform'), cursive, sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary-gold);
    letter-spacing: 2px;
    display: block;
    margin-bottom: 8px;
    text-transform: uppercase;
    background: transparent;
    border: none;
    padding: 0;
    box-shadow: none;
}

.hero-title {
    font-family: var(--project-body-font, 'Geoform'), cursive, sans-serif;
    font-size: 1.9rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.25;
    margin-bottom: 10px;
    letter-spacing: 0.5px;
}

.hero-description {
    font-size: 0.85rem;
    color: var(--text-sub);
    margin-bottom: 18px;
}

.hero-buttons {
    display: flex;
    gap: 14px;
}

.btn-hero-primary {
    background: linear-gradient(135deg, #d4af37 0%, #b48811 100%);
    color: #000000;
    border: none;
    font-weight: 700;
    font-size: 0.82rem;
    padding: 10px 22px;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
}

.btn-hero-secondary {
    background: transparent;
    color: #ffffff;
    border: 1px solid var(--border-color);
    font-weight: 600;
    font-size: 0.82rem;
    padding: 10px 22px;
    border-radius: 8px;
    cursor: pointer;
}

/* WORKSPACE FLEX/GRID LAYOUT */
.workspace-grid {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 20px;
    align-items: flex-start;
    width: 100%;
}

.center-workspace {
    flex: 1 1 0%;
    min-width: 0;
}

.right-stats-panel {
    flex: 0 0 340px;
    width: 340px;
    min-width: 340px;
}

.constructor-header-card {
    background: rgba(19, 23, 34, 0.3);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}

.constructor-title {
    font-family: var(--project-body-font, 'Geoform'), cursive, sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 10px;
}

.constructor-selectors {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.selector-group {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    color: var(--text-sub);
}
.constructor-pvp-toggles { display: flex; align-items: stretch; gap: 6px; flex-wrap: nowrap; }
.constructor-pvp-toggle { min-height: 38px; padding: 5px 9px; display: flex; align-items: center; gap: 7px; border: 1px solid rgba(96,165,250,.25); border-radius: 8px; background: rgba(37,99,235,.07); color: #dbeafe; font-size: .66rem; font-weight: 700; line-height: 1.15; white-space: nowrap; cursor: pointer; }
.constructor-pvp-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.constructor-toggle-track { position: relative; width: 30px; height: 17px; flex: 0 0 auto; border: 1px solid rgba(148,163,184,.4); border-radius: 999px; background: rgba(15,23,42,.9); transition: .18s ease; }
.constructor-toggle-track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 11px; height: 11px; border-radius: 50%; background: #94a3b8; transition: .18s ease; }
.constructor-pvp-toggle input:checked + .constructor-toggle-track { border-color: #60a5fa; background: #2563eb; box-shadow: 0 0 10px rgba(59,130,246,.28); }
.constructor-pvp-toggle input:checked + .constructor-toggle-track::after { left: 15px; background: #fff; }
.constructor-pvp-toggle input:focus-visible + .constructor-toggle-track { outline: 2px solid #93c5fd; outline-offset: 2px; }
.constructor-pvp-toggle small { color: var(--text-muted); font-size: .54rem; font-weight: 600; }

.select-dark {
    background: rgba(10, 12, 19, 0.5);
    color: #ffffff;
    border: 1px solid var(--border-subtle);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.82rem;
    outline: none;
}

.select-dark.short { width: 70px; }
.character-level-input {
    width: 82px !important;
    min-height: 34px;
    color: var(--gold-light);
    border-color: rgba(212, 175, 55, .42);
    background: linear-gradient(180deg, rgba(48, 37, 15, .56), rgba(10, 12, 19, .72));
    font-weight: 800;
    text-align: center;
}
.character-level-input:focus { border-color: var(--primary-gold); box-shadow: 0 0 0 2px rgba(212, 175, 55, .12); }

/* EQUIPMENT & FULL-BODY CHARACTER CONTAINER */
.l2-equipment-card {
    display: flex;
    flex-direction: column;
    background: rgba(19, 23, 34, 0.3);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.equipment-with-character-layout {
    order: 1;
    display: flex;
    gap: 24px;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

/* FULL-BODY CHARACTER ARTWORK CARD */
.fullbody-character-card {
    width: 300px;
    height: 420px;
    border-radius: 14px;
    border: 1px solid var(--border-color);
    background: radial-gradient(circle at center, rgba(212, 175, 55, 0.15) 0%, rgba(13, 15, 23, 0.6) 80%);
    backdrop-filter: blur(8px);
    overflow: hidden;
    position: relative;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
    flex-shrink: 0;
}

.character-image-wrap {
    width: 100%;
    height: 100%;
    position: relative;
}

.character-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    display: block;
}

.character-overlay-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    box-sizing: border-box;
    padding: 36px 14px 14px;
    background: linear-gradient(0deg, rgba(7, 9, 15, .98) 0%, rgba(10, 13, 21, .9) 58%, rgba(10, 13, 21, 0) 100%);
    text-align: left;
}
.character-overlay-info::after {
    content: "";
    position: absolute;
    right: 14px;
    bottom: 0;
    left: 14px;
    height: 2px;
    border-radius: 999px;
    background: linear-gradient(90deg, transparent, var(--primary-gold), transparent);
    box-shadow: 0 0 14px rgba(212, 175, 55, .5);
}
.character-name-row { display: flex; align-items: center; gap: 8px; }
.character-name-row .char-profile-name { min-width: 0; flex: 1; }
.character-save-button { width: 30px; height: 30px; flex: 0 0 auto; display: grid; place-items: center; border: 1px solid rgba(212,175,55,.5); border-radius: 8px; background: rgba(9,11,17,.82); color: #ffe28a; cursor: pointer; transition: .16s ease; }
.character-save-button:hover { border-color: #f6d46b; background: rgba(212,175,55,.18); transform: translateY(-1px); }
.character-image-wrap > img.is-empty { visibility: hidden; }
.character-profile-meta {
    margin-top: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.char-class-name {
    font-family: var(--project-body-font, 'Geoform'), cursive, sans-serif;
    min-width: 0;
    overflow: hidden;
    font-size: .78rem;
    font-weight: 700;
    color: var(--primary-gold);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.char-level-badge {
    flex: 0 0 auto;
    padding: 5px 9px;
    border: 1px solid rgba(212, 175, 55, .46);
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(212, 175, 55, .2), rgba(95, 67, 15, .16));
    color: #fff2bd;
    box-shadow: inset 0 0 10px rgba(212, 175, 55, .08);
    font-size: .62rem;
    font-weight: 850;
    white-space: nowrap;
}

/* EQUIPMENT DOLL GRID */
.equipment-grid-wrap {
    display: flex;
    align-items: center;
}

.l2-equipment-inner {
    display: flex;
    gap: 16px;
    align-items: center;
}

.left-spirit-stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.authentic-doll-grid {
    display: grid;
    grid-template-columns: repeat(3, 76px);
    grid-template-rows: repeat(5, 76px);
    gap: 12px;
}

.doll-slot {
    position: relative;
    overflow: hidden;
    width: 76px;
    height: 76px;
    background: rgba(10, 12, 19, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(6px);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.doll-slot.mini {
    width: 48px;
    height: 48px;
}

.doll-slot.sm {
    width: 60px;
    height: 60px;
}

.doll-slot.master-set {
    border: 2px solid var(--primary-gold);
    background: rgba(212, 175, 55, 0.18);
}

.doll-slot:hover {
    border-color: var(--primary-gold);
    box-shadow: 0 0 15px var(--gold-glow);
    transform: scale(1.03);
}

.slot-icon-bg {
    font-size: 1.6rem;
    color: var(--text-muted);
}

.slot-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-top: 4px;
    text-align: center;
}

.doll-slot img,
.special-parent-slot img,
.quick-slot img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 9px;
}

.doll-slot .slot-default-image,
.special-parent-slot .slot-default-image {
    object-fit: cover;
    opacity: .82;
    filter: none;
}

.ench-badge {
    position: absolute;
    top: 3px;
    left: 3px;
    background: rgba(10, 12, 19, 0.92);
    color: var(--primary-gold);
    font-weight: 800;
    font-size: 0.72rem;
    padding: 1px 5px;
    border-radius: 4px;
    border: 1px solid var(--primary-gold);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.8);
    z-index: 5;
}


.soul-crystal-panel { margin-top: 14px; padding: 14px; border: 1px solid rgba(86,151,204,.28); border-radius: 14px; background: linear-gradient(145deg, rgba(14,25,39,.88), rgba(9,12,20,.9)); }
.soul-crystal-panel-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 12px; }
.soul-crystal-panel-heading h3 { margin: 2px 0; color: #a9d8ff; font-size: .96rem; }
.soul-crystal-panel-heading p { margin: 0; color: var(--text-muted); font-size: .76rem; }
.soul-crystal-total { padding: 4px 9px; border: 1px solid rgba(96,165,250,.3); border-radius: 999px; color: #8fc9ff; background: rgba(59,130,246,.08); font-size: .74rem; font-weight: 700; white-space: nowrap; }
.soul-crystal-groups { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 8px; }
.soul-crystal-group { min-width: 0; padding: 9px; border: 1px solid var(--border-subtle); border-radius: 10px; background: rgba(0,0,0,.22); }
.soul-crystal-group > strong { display: block; margin-bottom: 7px; color: var(--text-sub); font-size: .76rem; }
.soul-host-row { padding-top: 7px; border-top: 1px solid rgba(255,255,255,.05); }
.soul-host-row + .soul-host-row { margin-top: 7px; }
.soul-host-label { display: block; overflow: hidden; margin-bottom: 5px; color: var(--text-muted); font-size: .66rem; text-overflow: ellipsis; white-space: nowrap; }
.soul-slot-row { display: flex; flex-wrap: wrap; gap: 5px; }
.soul-crystal-slot { position: relative; width: 34px; height: 34px; padding: 0; overflow: hidden; border: 1px solid rgba(96,165,250,.45); border-radius: 7px; background: radial-gradient(circle,rgba(51,105,143,.2),rgba(4,8,14,.85)); cursor: pointer; }
.soul-crystal-slot.special { border-color: rgba(215,180,92,.65); box-shadow: inset 0 0 8px rgba(215,180,92,.1); }
.soul-crystal-slot img,.soul-crystal-slot .item-icon-composite { width: 100%; height: 100%; }
.soul-group-empty { color: rgba(148,163,184,.55); font-size: .67rem; line-height: 1.4; }
.character-system-tabs { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 8px; margin-bottom: 12px; padding: 6px; border: 1px solid var(--border-subtle); border-radius: 13px; background: rgba(7,10,17,.72); }
.character-system-tab { min-width: 0; padding: 10px 12px; display: flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid transparent; border-radius: 9px; background: transparent; color: var(--text-muted); cursor: pointer; font-size: .72rem; font-weight: 750; }
.character-system-tab:hover { color: #fff; background: rgba(255,255,255,.035); }
.character-system-tab.active { border-color: rgba(212,175,55,.45); background: linear-gradient(180deg,rgba(212,175,55,.16),rgba(212,175,55,.06)); color: #f8e7a4; box-shadow: inset 0 0 14px rgba(212,175,55,.05); }
.character-system-panel { display: none; }
.character-system-panel.active { display: block; }
.forgotten-power-panel { padding: 18px; border: 1px solid rgba(245,158,11,.3); border-radius: 14px; background: linear-gradient(145deg,rgba(69,42,10,.35),rgba(8,12,20,.94)); box-shadow: inset 0 0 36px rgba(245,158,11,.035); }
.forgotten-power-heading { margin-bottom: 15px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.forgotten-power-heading h3 { margin: 2px 0 4px; color: #fde68a; font-size: 1rem; }
.forgotten-power-heading p { max-width: 700px; margin: 0; color: var(--text-muted); font-size: .8rem; line-height: 1.5; }
.forgotten-power-controls { display: flex; align-items: flex-end; gap: 9px; }
.forgotten-book-price { min-width: 180px; display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 2px 8px; }
.forgotten-book-price span { color: #fde68a; font-size: .72rem; font-weight: 800; }
.forgotten-book-price small { color: var(--text-muted); font-size: .68rem; text-align: right; }
.forgotten-book-price input { grid-column: 1 / -1; width: 100%; box-sizing: border-box; padding: 8px 9px; border: 1px solid rgba(245,158,11,.35); border-radius: 8px; outline: none; background: rgba(3,7,13,.84); color: #fff; font: inherit; font-size: .78rem; text-align: right; }
.forgotten-book-price input:focus { border-color: #f59e0b; box-shadow: 0 0 0 2px rgba(245,158,11,.12); }
.forgotten-power-total { padding: 5px 10px; border: 1px solid rgba(245,158,11,.35); border-radius: 999px; background: rgba(180,83,9,.11); color: #fde68a; font-size: .76rem; font-weight: 800; white-space: nowrap; }
.forgotten-power-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.forgotten-power-empty { grid-column: 1 / -1; padding: 28px; border: 1px dashed rgba(245,158,11,.25); border-radius: 11px; color: var(--text-muted); font-size: .72rem; text-align: center; }
.forgotten-target-level { display:grid; gap:6px; margin-top:12px; color:#d9be7a; font-size:.72rem; font-weight:700; }.forgotten-target-dropdown { position:relative; width:100%; }.forgotten-target-dropdown-toggle { width:100%; min-height:34px; padding:7px 9px; display:flex; align-items:center; justify-content:space-between; gap:8px; border:1px solid rgba(245,158,11,.35); border-radius:8px; background:#080d13; color:#fde68a; font:inherit; font-weight:700; cursor:pointer; text-align:left; }.forgotten-target-dropdown-toggle>i { font-size:.66rem; transition:transform .16s ease; }.forgotten-target-dropdown.is-open .forgotten-target-dropdown-toggle { border-color:#f59e0b; border-radius:8px 8px 0 0; }.forgotten-target-dropdown.is-open .forgotten-target-dropdown-toggle>i { transform:rotate(180deg); }.forgotten-target-dropdown-toggle:disabled { opacity:.65; cursor:not-allowed; }.forgotten-target-dropdown-menu { position:absolute; z-index:80; top:calc(100% - 1px); left:0; right:0; display:none; max-height:96px; overflow-y:auto; border:1px solid #f59e0b; border-radius:0 0 8px 8px; background:#080d13; box-shadow:0 12px 26px rgba(0,0,0,.48); }.forgotten-target-dropdown.is-open .forgotten-target-dropdown-menu { display:grid; grid-auto-rows:32px; }.forgotten-target-dropdown-option { min-height:32px; padding:7px 10px; border:0; border-bottom:1px solid rgba(245,158,11,.12); background:transparent; color:#e5e7eb; font:inherit; font-size:.72rem; text-align:left; cursor:pointer; }.forgotten-target-dropdown-option:last-child { border-bottom:0; }.forgotten-target-dropdown-option:hover,.forgotten-target-dropdown-option.is-selected { background:rgba(245,158,11,.16); color:#fde68a; }
.progression-system-placeholder { display:grid; justify-items:center; gap:10px; min-height:210px; padding:30px; border:1px dashed rgba(212,175,55,.28); border-radius:12px; background:linear-gradient(145deg,rgba(30,43,58,.54),rgba(5,9,14,.76)); text-align:center; }.progression-system-placeholder>i { display:grid; width:48px; height:48px; place-items:center; border:1px solid rgba(212,175,55,.4); border-radius:50%; color:#f2cf78; font-size:20px; }.progression-system-placeholder strong { color:#f6e5b8; font-size:.92rem; }.progression-system-placeholder p { max-width:430px; margin:0; color:var(--text-muted); font-size:.76rem; line-height:1.5; }.progression-system-state { padding:4px 8px; border:1px solid rgba(212,175,55,.26); border-radius:99px; color:#d9be7a; font-size:.68rem; }
.forgotten-power-card { min-width: 0; padding: 12px; border: 1px solid rgba(255,255,255,.075); border-radius: 12px; background: rgba(3,7,13,.58); transition: border-color .18s ease, background .18s ease; }
.forgotten-power-card.learned { border-color: rgba(245,158,11,.35); background: linear-gradient(145deg,rgba(120,53,15,.15),rgba(3,7,13,.72)); }
.forgotten-power-card-head { min-width: 0; display: grid; grid-template-columns: 46px minmax(0,1fr); align-items: center; gap: 10px; }
.forgotten-power-icon { width: 46px; height: 46px; display: grid; place-items: center; overflow: hidden; border: 1px solid rgba(245,158,11,.35); border-radius: 9px; background: radial-gradient(circle,rgba(180,83,9,.22),rgba(3,7,13,.92)); color: #fbbf24; font-size: 1.05rem; }
.forgotten-power-icon img { width: 100%; height: 100%; object-fit: cover; }
.forgotten-power-card-head div { min-width: 0; }
.forgotten-power-card-head strong,.forgotten-power-card-head small { display: block; overflow: hidden; text-overflow: ellipsis; }
.forgotten-power-card-head strong { color: #fff7d6; font-size: .86rem; white-space: nowrap; }
.forgotten-power-card-head small { max-height: 3.2em; margin-top: 4px; color: var(--text-muted); font-size: .7rem; line-height: 1.5; }
.forgotten-level-select { margin-top: 11px; display: grid; grid-template-columns: auto minmax(130px,180px); align-items: center; justify-content: space-between; gap: 10px; color: #d6d9e2; font-size: .75rem; font-weight: 750; }
.forgotten-level-select select { min-width: 0; padding: 7px 28px 7px 9px; border: 1px solid rgba(245,158,11,.32); border-radius: 8px; outline: none; background: #0a0d14; color: #fde68a; font: inherit; cursor: pointer; }
.forgotten-current-stats { margin-top: 10px; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 6px; }
.forgotten-current-stats > span { min-width: 0; padding: 7px 8px; display: flex; align-items: center; justify-content: space-between; gap: 7px; border: 1px solid rgba(255,255,255,.055); border-radius: 8px; background: rgba(255,255,255,.022); }
.forgotten-current-stats small { min-width: 0; overflow: hidden; color: var(--text-muted); font-size: .66rem; text-overflow: ellipsis; white-space: nowrap; }
.forgotten-current-stats strong { flex: 0 0 auto; color: #34d399; font-size: .75rem; }
.forgotten-level-placeholder { grid-column: 1 / -1; margin: 0; padding: 13px; color: rgba(148,163,184,.68); font-size: .73rem; text-align: center; }
.forgotten-current-effect { margin-top: 9px; padding: 9px 10px; border-left: 2px solid rgba(245,158,11,.55); border-radius: 0 7px 7px 0; background: rgba(120,53,15,.09); }
.forgotten-current-effect strong { display: block; color: #fcd34d; font-size: .68rem; text-transform: uppercase; }
.forgotten-current-effect p { margin: 4px 0 0; color: #d8dce5; font-size: .72rem; line-height: 1.5; }
.forgotten-requirement { margin-top: 9px; display: flex; align-items: flex-start; gap: 7px; color: #c4b5fd; font-size: .68rem; line-height: 1.5; }
.forgotten-requirement i { margin-top: 1px; flex: 0 0 auto; color: #a78bfa; }
.forgotten-upgrade { margin-top: 11px; overflow: hidden; border: 1px solid rgba(52,211,153,.2); border-radius: 9px; background: rgba(6,78,59,.07); }
.forgotten-upgrade-head { padding: 9px 10px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 1px solid rgba(52,211,153,.14); }
.forgotten-upgrade-head div { flex: 0 0 auto; }
.forgotten-upgrade-head small,.forgotten-upgrade-head strong { display: block; }
.forgotten-upgrade-head small { color: #6ee7b7; font-size: .66rem; font-weight: 800; letter-spacing: .06em; }
.forgotten-upgrade-head strong { margin-top: 2px; color: #ecfdf5; font-size: .78rem; }
.forgotten-upgrade-head > span { color: #a7f3d0; font-size: .65rem; line-height: 1.45; text-align: right; }
.forgotten-upgrade-metrics { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); }
.forgotten-upgrade-metrics > span { min-width: 0; padding: 9px 10px; display: grid; align-content: start; gap: 3px; }
.forgotten-upgrade-metrics > span + span { border-left: 1px solid rgba(52,211,153,.12); }
.forgotten-upgrade-metrics small { color: var(--text-muted); font-size: .67rem; }
.forgotten-upgrade-metrics strong { overflow: hidden; color: #fff; font-size: .73rem; text-overflow: ellipsis; white-space: nowrap; }
.forgotten-upgrade-metrics em { color: rgba(167,243,208,.68); font-size: .65rem; font-style: normal; line-height: 1.4; }
.forgotten-upgrade.maxed { padding: 11px; display: flex; align-items: center; justify-content: center; gap: 7px; color: #6ee7b7; font-size: .74rem; }
.collections-panel { padding: 18px; border: 1px solid rgba(129,140,248,.3); border-radius: 14px; background: linear-gradient(145deg,rgba(30,27,75,.42),rgba(8,12,20,.94)); box-shadow: inset 0 0 34px rgba(99,102,241,.035); }
.collections-panel-heading { margin-bottom: 15px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.collections-panel-heading h3 { margin: 2px 0 4px; color: #ddd6fe; font-size: 1rem; }
.collections-panel-heading p { max-width: 650px; margin: 0; color: var(--text-muted); font-size: .8rem; line-height: 1.5; }
.collections-total { padding: 5px 10px; border: 1px solid rgba(129,140,248,.35); border-radius: 999px; background: rgba(79,70,229,.1); color: #c7d2fe; font-size: .76rem; font-weight: 800; white-space: nowrap; }
.collections-list { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 9px; }
.collections-empty { grid-column: 1 / -1; padding: 24px; border: 1px dashed rgba(129,140,248,.24); border-radius: 11px; color: var(--text-muted); font-size: .82rem; text-align: center; }
.collection-entry { min-width: 0; padding: 11px; container-type: inline-size; border: 1px solid rgba(129,140,248,.22); border-radius: 11px; background: rgba(8,11,22,.62); color: inherit; text-align: left; }
.collection-entry.is-planned:hover { border-color: rgba(165,180,252,.55); background: rgba(49,46,129,.12); }
.collection-entry.is-learned { border-color: rgba(52,211,153,.34); background: linear-gradient(145deg,rgba(6,78,59,.12),rgba(8,11,22,.68)); }
.collection-entry-head { min-width: 0; display: grid; grid-template-columns: minmax(0,1fr) 30px; align-items: center; gap: 10px; }
.collection-entry-copy { min-width: 0; }
.collection-entry-copy strong,.collection-entry-copy span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.collection-entry-copy strong { color: #eef2ff; font-size: .86rem; }
.collection-entry-copy span { margin-top: 5px; color: var(--text-muted); font-size: .72rem; }
.collection-remove { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid rgba(239,68,68,.25); border-radius: 8px; background: rgba(127,29,29,.1); color: #fca5a5; cursor: pointer; }
.collection-remove:hover { border-color: rgba(248,113,113,.6); background: rgba(127,29,29,.26); color: #fff; }
.collection-cost-details { margin-top: 10px; border-top: 1px solid rgba(129,140,248,.14); }
.collection-cost-details summary { padding: 9px 1px 6px; color: #a5b4fc; cursor: pointer; font-size: .75rem; font-weight: 750; }
.collection-component-price-list { display: grid; gap: 6px; padding-top: 2px; }
.collection-component-price-row { min-width: 0; display: grid; grid-template-columns: minmax(0,1fr) minmax(118px, 135px) minmax(110px, auto); align-items: center; gap: 7px; padding: 7px 8px; border: 1px solid rgba(255,255,255,.055); border-radius: 8px; background: rgba(0,0,0,.2); }
.collection-component-name { min-width: 0; }
.collection-component-name strong,.collection-component-name small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.collection-component-name strong { color: #e0e7ff; font-size: .75rem; }
.collection-component-name small { margin-top: 3px; color: #a5b4fc; font-size: .67rem; }
.collection-unit-price span { display: block; margin-bottom: 3px; color: var(--text-muted); font-size: .68rem; }
.collection-unit-price input { width: 100%; box-sizing: border-box; padding: 6px 7px; border: 1px solid rgba(129,140,248,.28); border-radius: 7px; outline: none; background: rgba(5,7,17,.85); color: #fff; font: inherit; font-size: .74rem; text-align: right; }
.collection-unit-price input:focus { border-color: #818cf8; box-shadow: 0 0 0 2px rgba(99,102,241,.14); }
.collection-line-total { color: #c7d2fe; font-size: .7rem; font-weight: 750; text-align: right; white-space: nowrap; }
.collection-component-missing { padding: 9px; color: var(--text-muted); font-size: .72rem; }
.collection-entry-footer { margin-top: 9px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.collection-learned-toggle { min-width: 0; padding: 7px 9px; border: 1px solid rgba(129,140,248,.34); border-radius: 8px; background: rgba(79,70,229,.1); color: #e0e7ff; cursor: pointer; text-align: left; }
.collection-learned-toggle:hover { border-color: rgba(165,180,252,.7); background: rgba(79,70,229,.22); }
.collection-learned-toggle span,.collection-learned-toggle small { display: block; }
.collection-learned-toggle span { font-size: .73rem; font-weight: 800; }
.collection-learned-toggle small { margin-top: 3px; color: var(--text-muted); font-size: .67rem; }
.collection-learned-toggle.is-active { border-color: rgba(52,211,153,.4); background: rgba(6,78,59,.18); color: #a7f3d0; cursor: default; opacity: 1; }
.collection-total-cost { flex: 0 0 auto; text-align: right; }
.collection-total-cost small,.collection-total-cost strong { display: block; }
.collection-total-cost small { margin-bottom: 2px; color: var(--text-muted); font-size: .68rem; }
.collection-total-cost strong { color: #f8e7a4; font-size: .76rem; }
.collections-add { width: 100%; min-height: 42px; margin-top: 11px; display: flex; align-items: center; justify-content: center; gap: 8px; border: 1px dashed rgba(165,180,252,.5); border-radius: 10px; background: rgba(79,70,229,.08); color: #c7d2fe; cursor: pointer; font-size: .82rem; font-weight: 800; }
.collections-add:hover { border-style: solid; background: rgba(79,70,229,.18); color: #fff; }
.collection-picker-anchor { display: none; }
.attribute-tab-card { padding: 18px; border: 1px solid rgba(212,175,55,.32); border-radius: 14px; background: linear-gradient(145deg,rgba(51,35,12,.34),rgba(8,12,20,.94)); box-shadow: inset 0 0 35px rgba(212,175,55,.025); }
.attribute-tab-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.attribute-tab-heading h3 { margin: 2px 0 3px; color: #f8e7a4; font-size: 1rem; }
.attribute-tab-heading p { margin: 0; color: var(--text-muted); font-size: .68rem; }
.attribute-tab-heading > i { width: 42px; height: 42px; display: grid; place-items: center; flex: 0 0 auto; border: 1px solid rgba(245,158,11,.35); border-radius: 12px; background: rgba(120,53,15,.2); color: #fbbf24; font-size: 1.15rem; }
.attribute-tab-grid { display: grid; grid-template-columns: minmax(210px,.7fr) minmax(0,1.3fr); gap: 12px; }
.attribute-attack-card,.attribute-defense-card { min-width: 0; padding: 14px; border: 1px solid rgba(255,255,255,.075); border-radius: 11px; background: rgba(3,7,13,.5); }
.attribute-section-label { display: block; margin-bottom: 13px; color: #d7c68e; font-size: .76rem; font-weight: 800; letter-spacing: .045em; text-transform: uppercase; }
.attribute-attack-value { min-height: 82px; display: flex; align-items: center; gap: 11px; color: var(--primary-gold); font-size: 1.06rem; font-weight: 800; }
.attribute-element-icon { width: 38px; height: 38px; flex: 0 0 auto; object-fit: contain; filter: drop-shadow(0 0 8px rgba(251,191,36,.28)); }
.attribute-element-name { color: #f8e7a4; font-size: .94rem; font-weight: 800; }
.attribute-attack-number { margin-left: auto; color: #fff; font-size: 1.18rem; font-weight: 900; }
.attribute-attack-empty { color: var(--text-muted); font-size: .86rem; font-weight: 650; }
.attribute-defense-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; }
.attribute-defense-grid > div { min-width: 0; padding: 8px 9px; display: flex; align-items: center; justify-content: space-between; gap: 8px; border: 1px solid rgba(255,255,255,.055); border-radius: 8px; background: rgba(255,255,255,.022); }
.attribute-defense-grid span { min-width: 0; display: flex; align-items: center; gap: 7px; color: var(--text-sub); font-size: .7rem; }
.attribute-defense-grid img { width: 19px; height: 19px; object-fit: contain; }
.attribute-defense-grid strong { color: #34d399; font-size: .76rem; }
.enhancement-user-settings { margin-bottom: 12px; padding: 13px 14px; border: 1px solid rgba(96,165,250,.28); border-radius: 12px; background: linear-gradient(145deg,rgba(20,48,82,.38),rgba(8,12,20,.82)); }
.user-calculation-toggle { display: flex; align-items: center; gap: 10px; color: #dbeafe; cursor: pointer; }
.user-calculation-toggle input { width: 17px; height: 17px; accent-color: #60a5fa; }
.user-calculation-toggle strong,.user-calculation-toggle small { display: block; }
.user-calculation-toggle strong { font-size: .74rem; }
.user-calculation-toggle small { margin-top: 3px; color: var(--text-muted); font-size: .62rem; line-height: 1.4; }
.manual-enchant-slot-card { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 10px; padding: 9px 10px; border: 1px solid rgba(167,139,250,.28); border-radius: 10px; background: rgba(91,61,150,.08); }
.manual-enchant-slot-card > div strong,.manual-enchant-slot-card > div span { display: block; }
.manual-enchant-slot-card > div strong { color: #c4b5fd; font-size: .72rem; }
.manual-enchant-slot-card > div span { margin-top: 3px; color: var(--text-muted); font-size: .7rem; }
.manual-enchant-slot { display: flex; align-items: center; gap: 6px; min-width: 128px; padding: 7px 10px; border: 1px solid rgba(167,139,250,.5); border-radius: 8px; background: linear-gradient(180deg,rgba(91,61,150,.3),rgba(10,11,17,.9)); color: #ddd6fe; cursor: pointer; font-size: .68rem; font-weight: 700; }
.manual-enchant-slot.configured { border-color: #a78bfa; box-shadow: 0 0 12px rgba(139,92,246,.15); }
.manual-enchant-dialog { width: min(620px,calc(100vw - 24px)); }
.manual-enchant-help { margin: 0 0 12px; color: var(--text-muted); font-size: .76rem; line-height: 1.5; }
.manual-enchant-name { display: flex; flex-direction: column; gap: 5px; color: var(--text-sub); font-size: .7rem; }
.manual-enchant-preset-field { margin-bottom: 9px; }
.manual-enchant-preset-field select { width: 100%; }
.manual-enchant-bonus-list { display: flex; flex-direction: column; gap: 7px; margin: 12px 0; }
.equipment-enchant-panel { margin-top: 14px; padding: 14px; border: 1px solid rgba(167,139,250,.3); border-radius: 14px; background: linear-gradient(145deg,rgba(32,22,55,.72),rgba(9,12,20,.92)); }
.equipment-enchant-panel .soul-crystal-panel-heading h3 { color: #d8b4fe; }
.equipment-enchant-slots { display: grid; gap: 10px; }
.equipment-enchant-empty { padding: 18px; border: 1px dashed rgba(167,139,250,.28); border-radius: 10px; color: var(--text-muted); font-size: .72rem; text-align: center; }
.equipment-enchant-group { min-width: 0; padding: 10px; border: 1px solid rgba(255,255,255,.06); border-radius: 11px; background: rgba(0,0,0,.18); }
.equipment-enchant-group h4 { margin: 0 0 8px; color: #c4b5fd; font-size: .72rem; }
.equipment-enchant-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
.equipment-enchant-item { min-width: 0; padding: 8px; border: 1px solid var(--border-subtle); border-radius: 9px; background: rgba(255,255,255,.025); }
.equipment-enchant-unavailable p { margin: 4px 0 0; color: #fbbf24; font-size: .6rem; line-height: 1.45; }
.equipment-enchant-item-head { display: grid; grid-template-columns: 34px minmax(0,1fr); align-items: center; gap: 7px; margin-bottom: 7px; }
.equipment-enchant-item-head img { width: 34px; height: 34px; border-radius: 7px; object-fit: cover; }
.equipment-enchant-item-head strong,.equipment-enchant-item-name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.equipment-enchant-item-head strong { color: #fff; font-size: .68rem; }
.equipment-enchant-item-head strong em { margin-left: 4px; padding: 1px 5px; border: 1px solid rgba(196,181,253,.35); border-radius: 999px; color: #c4b5fd; font-size: .5rem; font-style: normal; font-weight: 700; }
.equipment-enchant-item-name { margin-top: 2px; color: var(--text-muted); font-size: .58rem; }
.equipment-enchant-buttons { display: grid; gap: 5px; }
.equipment-enchant-button { min-width: 0; padding: 7px; display: grid; grid-template-columns: 16px minmax(0,1fr) auto; align-items: center; gap: 7px; border: 1px solid rgba(167,139,250,.22); border-radius: 7px; background: rgba(91,61,150,.08); color: var(--text-sub); cursor: pointer; text-align: left; }
.equipment-enchant-button:hover,.equipment-enchant-button.configured { border-color: rgba(196,181,253,.55); background: rgba(91,61,150,.2); }
.equipment-enchant-button i { color: #a78bfa; }
.equipment-enchant-button-copy { min-width: 0; display: grid; gap: 3px; }
.equipment-enchant-button-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.equipment-enchant-button-copy small { white-space: pre-line; overflow-wrap: anywhere; }
.equipment-enchant-button-copy strong { color: #eeeaff; font-size: .61rem; }
.equipment-enchant-button-copy small { color: #b8b0ca; font-size: .54rem; }
.equipment-enchant-button>em { min-width: 18px; height: 18px; display: grid; place-items: center; border: 1px solid rgba(196,181,253,.35); border-radius: 5px; color: #d8ccff; font-size: .52rem; font-style: normal; font-weight: 800; }
.manual-enchant-bonus-row { display: grid; gap: 7px; padding: 8px; border: 1px solid rgba(167,139,250,.16); border-radius: 9px; background: rgba(91,61,150,.05); }
.manual-enchant-bonus-row select:disabled,.manual-enchant-bonus-row input:disabled,#manual-enchant-name:disabled { opacity: .86; color: #ddd6fe; cursor: default; }
.manual-enchant-row-controls { display: grid; grid-template-columns: minmax(0,1fr) 110px 34px; gap: 7px; align-items: center; }
.manual-enchant-bonus-row select,.manual-enchant-bonus-row input { width: 100%; }
.manual-enchant-base-stats { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 5px; }
.manual-enchant-base-stats.hidden { display: none; }
.manual-enchant-base-stats label { min-width: 0; padding: 5px; display: flex; align-items: center; gap: 4px; border: 1px solid rgba(255,255,255,.08); border-radius: 6px; color: var(--text-sub); font-size: .6rem; cursor: pointer; }
.manual-enchant-base-stats input { width: auto; accent-color: #a78bfa; }
.manual-enchant-remove { width: 34px; height: 34px; border: 1px solid rgba(239,68,68,.35); border-radius: 7px; background: rgba(127,29,29,.14); color: #fca5a5; cursor: pointer; }
.manual-enchant-roll-label { color: #ddd6fe; font-size: .7rem; }
.manual-enchant-roll-controls { display: grid; grid-template-columns: minmax(0,1fr) 112px; gap: 7px; align-items: center; }
.manual-enchant-roll-value { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 5px; color: #c4b5fd; font-size: .68rem; }
.manual-enchant-roll-value.hidden { display: none; }
.manual-enchant-roll-row > small { color: var(--text-muted); font-size: .6rem; }
@media (max-width: 1150px) { .soul-crystal-groups { grid-template-columns: repeat(3,minmax(0,1fr)); } }
@media (max-width: 760px) { .soul-crystal-groups { grid-template-columns: 1fr 1fr; } }
@media (max-width: 1050px) { .equipment-enchant-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media (max-width: 650px) { .equipment-enchant-grid { grid-template-columns: 1fr; } .manual-enchant-base-stats { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media (max-width: 1300px) { .collections-list { grid-template-columns: repeat(3,minmax(0,1fr)); } }
@media (max-width: 950px) { .collections-list { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media (max-width: 760px) { .character-system-tabs { grid-template-columns: repeat(2,minmax(0,1fr)); } .attribute-tab-grid,.forgotten-power-grid { grid-template-columns: 1fr; } .forgotten-power-heading { align-items: stretch; flex-direction: column; } .forgotten-power-controls { justify-content: space-between; } .forgotten-upgrade-metrics { grid-template-columns: 1fr; } .forgotten-upgrade-metrics > span + span { border-left: 0; border-top: 1px solid rgba(52,211,153,.12); } }
@media (max-width: 560px) { .collections-list { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .collection-component-price-row { grid-template-columns: minmax(0,1fr) 104px; } .collection-line-total { grid-column: 1 / -1; } .collection-entry-footer { align-items: flex-start; flex-direction: column; } .collection-total-cost { text-align: left; } }

@container (max-width: 340px) {
    .collection-component-price-row { grid-template-columns: minmax(0,1fr) 92px; }
    .collection-line-total { grid-column: 1 / -1; }
    .collection-entry-footer { align-items: flex-start; flex-direction: column; }
    .collection-total-cost { text-align: left; }
}
@media (max-width: 650px) { .character-system-tab { padding: 9px 5px; font-size: .61rem; } .character-system-tab i { display: none; } .attribute-defense-grid { grid-template-columns: 1fr; } }

.doll-slot .slot-unequip-btn,
.special-parent-slot .slot-unequip-btn {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 20px;
    height: 20px;
    padding: 0;
    background: transparent;
    color: #ffffff;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
    cursor: pointer;
    z-index: 20;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    box-shadow: none;
    border: 0;
}

.doll-slot.equipped:hover .slot-unequip-btn,
.special-parent-slot.equipped:hover .slot-unequip-btn {
    opacity: 1;
    pointer-events: auto;
}

.slot-unequip-btn:hover {
    transform: scale(1.25);
    background: transparent;
}

/* FOUR ITEMS THAT OPEN NESTED EQUIPMENT PANELS */
.equipment-special-access {
    width: 100%;
    margin-top: 12px;
    padding: 9px 8px 10px;
    border: 1px solid rgba(212,175,55,.22);
    border-radius: 11px;
    background: linear-gradient(180deg,rgba(212,175,55,.055),rgba(7,9,14,.42));
}

.special-instruction-text {
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    color: var(--text-muted);
    font-size: .55rem;
    white-space: nowrap;
}
.special-instruction-text strong { color: var(--gold-light); font-size: .62rem; }

.special-tabs-row {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.special-parent-slot {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    padding: 0;
    background: rgba(24, 29, 44, 0.35);
    backdrop-filter: blur(6px);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    -webkit-user-select: none;
}

.special-submenus-container {
    position: fixed;
    inset: 0;
    z-index: 3000;
    pointer-events: none;
}
.l2-equipment-card > .soul-crystal-panel { order: 3; }

.special-parent-slot img {
    pointer-events: none;
    -webkit-user-drag: none;
    user-select: none;
    filter: grayscale(100%) brightness(0.85);
    transition: filter 0.2s ease, transform 0.2s ease;
}

.special-parent-slot:hover img,
.special-parent-slot.equipped img,
.special-parent-slot.active img {
    filter: grayscale(0%) brightness(1);
}

.special-submenu-popover {
    position: fixed;
    display: none;
    grid-template-columns: repeat(var(--special-slot-columns, 6), 44px);
    align-items: center;
    justify-content: start;
    gap: 8px;
    width: max-content;
    max-width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
    margin: 0;
    padding: 10px;
    overflow: visible;
    background: rgba(8, 11, 18, 0.98);
    backdrop-filter: blur(14px);
    border-radius: 11px;
    border: 1px solid var(--border-color);
    box-shadow: 0 16px 38px rgba(0, 0, 0, 0.82), 0 0 0 1px rgba(212, 175, 55, 0.08) inset;
    pointer-events: auto;
}

.special-submenu-popover.active { display: grid; }
.special-submenu-popover > .doll-slot { width: 44px; height: 44px; }
#menu-brooch > .doll-slot.jewel-slot-inactive,
#menu-brooch > .doll-slot.jewel-slot-inactive:hover {
    opacity: .55;
    filter: brightness(.65) saturate(.6);
    box-shadow: none;
    transform: none;
    cursor: not-allowed;
}
.doll-slot.special-child-inactive,
.doll-slot.special-child-inactive:hover {
    opacity: .55;
    filter: brightness(.65) saturate(.6);
    box-shadow: none;
    transform: none;
    cursor: not-allowed;
}
.special-submenu-empty {
    grid-column: 1 / -1;
    max-width: 220px;
    padding: 8px 10px;
    color: var(--text-muted);
    font-size: .66rem;
    line-height: 1.45;
    text-align: center;
}
.special-submenu-empty[hidden] { display: none; }

.special-popover-close {
    position: absolute;
    top: -8px;
    right: -8px;
    z-index: 21;
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(212, 175, 55, .6);
    border-radius: 50%;
    background: #090c13;
    color: var(--gold-light);
    box-shadow: 0 5px 14px rgba(0, 0, 0, .75);
    cursor: pointer;
    font: 700 17px/1 Arial, sans-serif;
}
.special-popover-close:hover { border-color: var(--primary-gold); color: #fff; }

.artifact-blocks-popover {
    width: min(356px, calc(100vw - 16px));
    padding: 10px !important;
    background: rgba(16, 20, 30, 0.95) !important;
    border: 1px solid var(--primary-gold) !important;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
}
.artifact-blocks-popover.active { display: block; }

.artifact-blocks-wrapper {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    justify-content: stretch;
    align-items: stretch;
    gap: 7px;
    width: 100%;
}

.artifact-block-card {
    min-width: 0;
    box-sizing: border-box;
    background: rgba(24, 30, 46, 0.6);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    padding: 7px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    transition: all 0.2s ease;
}

.artifact-block-card:hover {
    border-color: var(--primary-gold);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.25);
}

.block-header {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary-gold);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
    border-bottom: 1px solid rgba(212, 175, 55, 0.25);
    padding-bottom: 6px;
    width: 100%;
}

.block-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 100%;
}

.artifact-block-card .row-3-slots {
    display: grid;
    grid-template-columns: repeat(2, 38px);
    grid-template-rows: repeat(2, 38px);
    justify-content: center;
    gap: 5px;
}

.artifact-block-card .row-3-slots .doll-slot:first-child {
    grid-column: 1 / -1;
    justify-self: center;
}

.artifact-block-card .row-4-slots {
    display: grid;
    grid-template-columns: repeat(2, 28px);
    grid-template-rows: repeat(2, 28px);
    justify-content: center;
    gap: 5px;
}

.row-3-slots .doll-slot {
    width: 38px;
    height: 38px;
    border: 1px solid var(--primary-gold);
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.3);
}

.row-4-slots .doll-slot {
    width: 28px;
    height: 28px;
    border-color: rgba(212, 175, 55, 0.6);
}

/* Exact in-game artifact balance grid dimensions. Kept fully scoped so the
   inventory and other doll slots retain their own sizing rules. */
.artifact-book-board .artifact-block-card .row-4-slots {
    display: grid;
    grid-template-columns: repeat(2, 45px);
    grid-template-rows: repeat(2, 45px);
    justify-content: center;
    gap: 5px;
}

.artifact-book-board .row-4-slots .doll-slot {
    width: 45px;
    height: 45px;
    border-color: rgba(155, 124, 61, .38);
    border-radius: 10px;
    background: rgba(4, 5, 5, .62);
}

@media (max-width: 520px) {
    .artifact-blocks-popover { width: calc(100vw - 16px); }
    .artifact-block-card .row-3-slots {
        grid-template-columns: repeat(2, 25px);
        grid-template-rows: repeat(2, 25px);
        gap: 3px;
    }
    .artifact-block-card .row-4-slots {
        grid-template-columns: repeat(2, 18px);
        grid-template-rows: repeat(2, 18px);
        gap: 3px;
    }
    .row-3-slots .doll-slot { width: 25px; height: 25px; }
    .row-4-slots .doll-slot { width: 18px; height: 18px; }
}

/* COMPOSITE ITEM ICON SYSTEM (Dragon Weapon Auras & Rare Item Effect Overlays) */
.item-icon-composite {
    position: relative;
    isolation: isolate;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 4px;
}

.item-icon-composite .icon-bg-aura {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
    pointer-events: none;
    animation: dragonAuraGlow 3s infinite alternate ease-in-out;
}

.item-icon-composite .icon-background-frame {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
    pointer-events: none;
}

.item-icon-composite .icon-base-img {
    position: relative;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 2;
    pointer-events: none;
}

.item-icon-composite .icon-frame-overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 3;
    pointer-events: none;
}

/* A custom frame configured as "front" is the final visual layer. Keep the
   ordering explicit because slot/card rules also target every nested <img>. */
.item-icon-composite .icon-foreground-frame {
    position: absolute !important;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    z-index: 8 !important;
    object-fit: cover !important;
    pointer-events: none;
}

.item-icon-composite .icon-craft-frame {
    position: absolute !important;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    z-index: 3 !important;
    object-fit: cover !important;
    pointer-events: none;
}

.item-icon-composite .item-icon-secondary-badge {
    z-index: 11;
}

@keyframes dragonAuraGlow {
    0% { opacity: 0.75; transform: scale(1); filter: brightness(1); }
    100% { opacity: 1; transform: scale(1.05); filter: brightness(1.2); }
}

/* QUICK SLOTS BAR */
.quick-slots-section {
    background: rgba(19, 23, 34, 0.3);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 14px 18px;
    margin-bottom: 24px;
}

.quick-slots-title {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.quick-slots-grid {
    display: flex;
    gap: 8px;
}

.quick-slot {
    width: 44px;
    height: 44px;
    background: rgba(10, 12, 19, 0.5);
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-gold);
    font-size: 1.1rem;
}

/* POPULAR BUILDS SECTION */
.popular-builds-section {
    background: rgba(19, 23, 34, 0.3);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 18px;
}

.section-title {
    font-family: var(--project-body-font, 'Geoform'), cursive, sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 12px;
}

.filter-tabs-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
}

.tab-btn {
    background: rgba(24, 29, 44, 0.3);
    border: 1px solid var(--border-subtle);
    color: var(--text-sub);
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
}

.tab-btn.active {
    background: var(--gold-dim);
    color: var(--primary-gold);
    border-color: var(--primary-gold);
}

.popular-builds-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.popular-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(24, 29, 44, 0.3);
    backdrop-filter: blur(6px);
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid var(--border-subtle);
}

.popular-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.popular-details .popular-name { font-size: 0.85rem; font-weight: 700; color: #fff; }
.popular-details .popular-sub { font-size: 0.72rem; color: var(--text-muted); }

/* RIGHT SIDEBAR: UNIFIED DYNAMIC "ПРИРОСТ ХАРАКТЕРИСТИК" */
.right-stats-panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.card-panel {
    background: rgba(19, 23, 34, 0.3);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 18px;
}

.card-panel.gold-border { border-color: var(--border-color); }
.card-title.gold-text { color: var(--primary-gold); }

.card-title {
    font-family: var(--project-body-font, 'Geoform'), cursive, sans-serif;
    font-size: 0.88rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 12px;
}

.calculation-card-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.calculation-card-title > span:first-child { min-width: 0; }
.calculation-card-title { position:relative; }.calculation-breakdown-trigger { position:absolute; right:8px; top:50%; transform:translateY(-50%); min-height:24px; padding:3px 7px; border:1px solid rgba(212,175,55,.42); border-radius:5px; background:rgba(212,175,55,.09); color:#f5dc9a; font:800 .58rem var(--project-body-font,'Geoform'),sans-serif; cursor:pointer; letter-spacing:.03em; }.calculation-breakdown-trigger:hover { border-color:rgba(255,224,138,.88); background:rgba(212,175,55,.18); }
.calculation-status-pill {
    flex: 0 0 auto;
    padding: 4px 7px;
    border: 1px solid rgba(212,175,55,.28);
    border-radius: 999px;
    background: rgba(212,175,55,.1);
    color: var(--gold-light);
    font: 700 .56rem var(--project-body-font, 'Geoform'),sans-serif;
    white-space: nowrap;
}
html[data-calculation-source="pending"] .calculation-status-pill,
html[data-calculation-source="cached"] .calculation-status-pill { animation: calculation-status-pulse 1s ease-in-out infinite alternate; }
html[data-calculation-source="stale"] .calculation-status-pill { border-color: rgba(239,68,68,.35); background: rgba(239,68,68,.1); color: #fca5a5; }
@keyframes calculation-status-pulse { from { opacity: .58; } to { opacity: 1; } }

.stats-key-value-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.stat-kv-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.08);
    font-size: 0.82rem;
}

.stat-kv-row .k {
    color: var(--text-sub);
    display: flex;
    align-items: center;
    gap: 8px;
}

.stat-kv-row .v {
    color: var(--text-muted);
    font-weight: 700;
}

.stat-kv-row .v.gain-green {
    color: var(--green-accent);
    text-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}
.base-stat-value { display: inline-flex; align-items:baseline; justify-content:flex-end; gap:4px; font-variant-numeric:tabular-nums; white-space:nowrap; }
.base-stat-value > b { color:#f8fafc; font-weight:800; font-size:.84rem; }
.base-stat-growth { font-style:normal; font-size:.73rem; font-weight:800; transition:color .16s ease; }
.base-stat-growth.positive { color:#34d399; text-shadow:0 0 9px rgba(16,185,129,.32); }
.base-stat-growth.negative { color:#fb7185; text-shadow:0 0 9px rgba(244,63,94,.25); }
.base-stat-growth.neutral { color:var(--text-muted); text-shadow:none; }

/* Compact base attributes: keep long pairs such as "Великолепие +150"
   together inside the fixed-width characteristics panel. */
#base-stats-summary .base-stats-compact-grid {
    grid-template-columns: minmax(0, .72fr) minmax(0, .72fr) minmax(125px, 1.56fr) !important;
    column-gap: 6px !important;
}
#base-stats-summary .stat-kv-row {
    min-width: 0;
    justify-content: flex-start !important;
    gap: 4px;
}
#base-stats-summary .stat-kv-row .k,
#base-stats-summary .stat-kv-row .v {
    flex: 0 0 auto;
    white-space: nowrap;
}
.summary-stats-empty { padding: 10px 4px; color: var(--text-muted); font-size: .7rem; text-align: center; }
.summary-stat-mode { width: 100%; margin-bottom: 10px; display: block; }
.summary-stat-mode-badge,
.summary-stat-mode-select-wrap {
    width: 100%;
    box-sizing: border-box;
    min-height: 30px;
    padding: 6px 10px;
    border: 1px solid rgba(212,175,55,.34);
    border-radius: 999px;
    background: linear-gradient(135deg,rgba(212,175,55,.16),rgba(92,65,11,.18));
    color: var(--gold-light);
    font: 700 .65rem var(--project-body-font, 'Geoform'),sans-serif;
    letter-spacing: .02em;
    text-align: center;
}
.summary-stat-mode-badge { display: flex; align-items: center; justify-content: center; }
.summary-stat-mode-select-wrap { display: flex; align-items: center; justify-content: center; }
.summary-stat-mode-select-wrap[hidden],
.summary-stat-mode-badge[hidden] { display: none; }
.summary-stat-mode-select-wrap select {
    width: 100%;
    padding: 0 20px;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--gold-light);
    font: inherit;
    text-align: center;
    text-align-last: center;
    cursor: pointer;
}
.summary-stat-mode-select-wrap select option { background: #0b0d12; color: #f6e7b0; }
.summary-stat-panel { display: none; }
.summary-stat-panel.active { display: block; }
.summary-stat-section { margin-top: 7px; padding: 5px 0 2px; color: #b9a7ef; font: 700 .65rem var(--project-body-font, 'Geoform'),sans-serif; letter-spacing: .02em; }
.summary-stat-section:first-child { margin-top: 0; }
.weapon-bonus-entry { width: 100%; margin: 0 0 12px; padding: 10px 13px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 1px solid rgba(103,211,152,.62); border-radius: 9px 3px 9px 3px; background: linear-gradient(110deg,rgba(20,75,52,.9),rgba(14,45,42,.9)); box-shadow: inset 0 1px rgba(184,255,216,.1), 0 4px 12px rgba(3,22,14,.26); color: #d4ffe6; font: 700 .75rem var(--project-body-font,'Geoform'),sans-serif; text-align: left; cursor: pointer; transition: border-color .18s ease, background .18s ease, transform .18s ease; }
.weapon-bonus-entry:hover, .weapon-bonus-entry:focus-visible { border-color: rgba(162,244,193,.9); background: linear-gradient(110deg,rgba(31,105,70,.96),rgba(18,65,52,.96)); transform: translateY(-1px); outline: none; }
.weapon-bonus-entry span:last-child { font-size: 1.2rem; line-height: 1; }
#weapon-bonus-modal { z-index: 12500; }
.weapon-bonus-dialog { width: min(480px, calc(100vw - 24px)); }
.weapon-bonus-body { display: grid; gap: 14px; padding: 18px; }
.weapon-bonus-notices { height: 64px; box-sizing: border-box; overflow-y: auto; display: flex; flex-direction: column; justify-content: flex-start; gap: 3px; }
.weapon-bonus-hint { margin: 0; color: var(--text-sub); font-size: .78rem; line-height: 1.45; }
.weapon-bonus-hint[hidden] { display: none; }
.weapon-bonus-inputs { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.weapon-bonus-input-column { display: grid; align-content: start; gap: 10px; min-width: 0; padding: 12px; border: 1px solid rgba(155,124,61,.28); border-radius: 3px; background: rgba(4,5,5,.42); }
.weapon-bonus-input-column > strong { color: #f5dda9; font-size: .79rem; text-align: center; }
.weapon-bonus-inputs label { display: grid; gap: 7px; min-width: 0; color: #d8bf91; font-size: .75rem; font-weight: 700; }
.weapon-bonus-inputs input { min-width: 0; width: 100%; box-sizing: border-box; font-variant-numeric: tabular-nums; }
.weapon-bonus-message { min-height: 0; margin: 0; color: #f6bd83; font-size: .69rem; line-height: 1.35; }
.weapon-bonus-message:empty { display: none; }
.weapon-bonus-results { display: grid; gap: 7px; padding-top: 12px; border-top: 1px solid var(--border-subtle); }
.weapon-bonus-results > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 11px; border: 1px solid rgba(155,124,61,.28); border-radius: 3px; background: rgba(4,5,5,.48); color: #e8e1d2; font-size: .78rem; }
.weapon-bonus-results output { color: #70e0aa; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.comp-delta-relative { margin-left: 5px; font-size: .9em; font-weight: 700; opacity: .9; }
@media (max-width: 380px) { .weapon-bonus-inputs { grid-template-columns: 1fr; } }

.trigger-stat-block { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--border-subtle); }
.trigger-stat-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--primary-gold); font-size: .74rem; font-weight: 700; }
.trigger-stat-title strong { min-width: 24px; padding: 3px 6px; border-radius: 6px; background: var(--gold-dim); text-align: center; }
.trigger-stat-list { margin-top: 8px; display: grid; gap: 6px; }
.trigger-empty { padding: 8px; color: var(--text-muted); font-size: .66rem; text-align: center; }
.trigger-stat-item { padding: 8px; border: 1px solid var(--border-subtle); border-radius: 8px; background: rgba(0,0,0,.3); }
.trigger-stat-item-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 7px; }
.trigger-stat-item-head strong { color: var(--gold-light); font-size: .66rem; }
.trigger-stat-item-head > div { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 3px; }
.trigger-category { padding: 2px 4px; border: 1px solid; border-radius: 4px; font-size: .48rem; font-weight: 700; }
.trigger-stat-item p { margin: 5px 0 0; color: var(--text-sub); font-size: .59rem; line-height: 1.45; }

/* ACTIVE EFFECTS LIST */
.active-effects-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 10px;
}

.effect-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.8rem;
}

.green-icon { color: var(--green-accent); font-size: 1.1rem; }
.gold-icon { color: var(--primary-gold); font-size: 1.1rem; }

.eff-title { font-weight: 700; color: #fff; }
.eff-sub { font-size: 0.72rem; color: var(--text-sub); }

/* SHARE BUILD INPUT GROUP */
.share-input-group {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.input-dark {
    background: rgba(10, 12, 19, 0.5);
    border: 1px solid var(--border-subtle);
    color: #ffffff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.82rem;
    outline: none;
}

.input-dark.full { width: 100%; }

.btn-copy-link {
    background: rgba(24, 29, 44, 0.3);
    border: 1px solid var(--border-subtle);
    color: var(--primary-gold);
    padding: 0 12px;
    border-radius: 6px;
    cursor: pointer;
}

.share-actions {
    display: flex;
    gap: 10px;
}

.btn-share-publish {
    flex: 1;
    background: rgba(24, 29, 44, 0.3);
    border: 1px solid var(--border-color);
    color: var(--primary-gold);
    font-weight: 700;
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.78rem;
}

.btn-share-export {
    flex: 1;
    background: transparent;
    border: 1px solid var(--border-subtle);
    color: var(--text-sub);
    font-weight: 600;
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.78rem;
}

/* BUDGET REPLACEMENT GLOW HIGHLIGHTS & EFFICIENCY RANKS */
.doll-slot.budget-rank-1, .special-parent-slot.budget-rank-1 {
    overflow: visible;
    --budget-rank-color: var(--rating-first-color, #34d399);
    --budget-rank-glow-soft: color-mix(in srgb, var(--budget-rank-color) 72%, transparent);
    --budget-rank-glow-strong: var(--budget-rank-color);
}

.doll-slot.budget-rank-2, .special-parent-slot.budget-rank-2 {
    overflow: visible;
    --budget-rank-color: var(--rating-second-color, #f59e0b);
    --budget-rank-glow-soft: color-mix(in srgb, var(--budget-rank-color) 72%, transparent);
    --budget-rank-glow-strong: var(--budget-rank-color);
}

.doll-slot.budget-rank-3, .special-parent-slot.budget-rank-3 {
    overflow: visible;
    --budget-rank-color: var(--rating-third-color, #ef4444);
    --budget-rank-glow-soft: color-mix(in srgb, var(--budget-rank-color) 72%, transparent);
    --budget-rank-glow-strong: var(--budget-rank-color);
}

/* Only the three visible rating places are highlighted. */
.doll-slot.budget-rank-1, .special-parent-slot.budget-rank-1,
.doll-slot.budget-rank-2, .special-parent-slot.budget-rank-2,
.doll-slot.budget-rank-3, .special-parent-slot.budget-rank-3 {
    overflow: visible;
    /* Shadows are rasterized once on the child layers, not on every frame
       of the slot itself (up to 320 paints/sec on high-refresh displays). */
    animation: none !important;
    box-shadow: none !important;
}

.budget-rank-glow {
    display: none;
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    pointer-events: none;
    z-index: 1;
}

.doll-slot:is(.budget-rank-1, .budget-rank-2, .budget-rank-3) > .budget-rank-glow,
.special-parent-slot:is(.budget-rank-1, .budget-rank-2, .budget-rank-3) > .budget-rank-glow {
    display: block;
}

.budget-rank-glow::before,
.budget-rank-glow::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    will-change: opacity;
}

.budget-rank-glow::before {
    box-shadow: 0 0 14px var(--budget-rank-glow-soft);
    animation: rank-glow-soft 2s infinite ease-in-out;
}

.budget-rank-glow::after {
    box-shadow: 0 0 26px var(--budget-rank-glow-strong);
    animation: rank-glow-strong 2s infinite ease-in-out;
}

.doll-slot.budget-affordable, .special-parent-slot.budget-affordable {
    overflow: visible;
    outline: 1px solid rgba(148,163,184,.65);
    outline-offset: 2px;
    box-shadow: 0 0 8px rgba(148,163,184,.2) !important;
}

@keyframes rank-glow-soft {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

@keyframes rank-glow-strong {
    0%, 100% { opacity: 0; }
    50% { opacity: 1; }
}

/* RANK BADGES FOR EFFICIENCY */
.rank-badge {
    position: absolute;
    top: -7px;
    left: -7px;
    display: grid;
    place-items: center;
    width: 20px;
    height: 20px;
    box-sizing: border-box;
    font-size: 15px;
    line-height: 1;
    font-weight: 900;
    padding: 0 0 2px;
    border-radius: 6px;
    color: #ffffff;
    z-index: 30;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.8);
}

.doll-slot.sm .rank-badge,
.special-parent-slot .rank-badge {
    top: -6px;
    left: -6px;
    width: 17px;
    height: 17px;
    border-radius: 5px;
    font-size: 12px;
    padding-bottom: 1px;
}

.doll-slot.mini,
.special-inline-panel .doll-slot,
.artifact-book-board .doll-slot {
    --budget-frame-offset: 3px;
}

.doll-slot.mini .rank-badge,
.special-inline-panel .doll-slot .rank-badge,
.artifact-book-board .doll-slot .rank-badge {
    top: -4px;
    left: -4px;
    width: 14px;
    height: 14px;
    border-width: 1px;
    border-radius: 4px;
    font-size: 10px;
    padding-bottom: 1px;
}

.rank-badge.rank-1 {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    border: 1px solid #34d399;
}

.rank-badge.rank-2 {
    background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%);
    border: 1px solid #fbbf24;
}

.rank-badge.rank-3 {
    background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
    border: 1px solid #f87171;
}

.rank-badge.affordable {
    background: linear-gradient(135deg, #475569 0%, #64748b 100%);
    border: 1px solid #94a3b8;
}

/* Equipment tooltips and doll visuals are shared with the admin view in equipment-shared.css. */
.weapon-base-parameters { margin-bottom: 8px; padding: 11px 13px; border: 1px solid rgba(212,175,55,.42); border-radius: 10px; background: linear-gradient(145deg,rgba(212,175,55,.09),rgba(0,0,0,.48)); }
.weapon-base-parameters-title { margin-bottom: 8px; padding-bottom: 6px; display: flex; align-items: center; gap: 7px; border-bottom: 1px solid rgba(255,255,255,.07); color: var(--gold-light); font-size: .72rem; font-weight: 750; }
.weapon-base-parameter-row { min-height: 27px; display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--text-sub); font-size: .76rem; }
.weapon-base-parameter-row strong { color: #fff; font-size: .84rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.weapon-base-parameter-row small { margin-left: 4px; color: #fde68a; font-size: .68rem; font-weight: 750; }

/* MODALS ENGINE (EXPANDED FOR FULL CONTENT VISIBILITY) */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 4000;
    overflow-x: hidden !important;
}

.modal-backdrop.active { display: flex; }

.modal-box {
    background: var(--bg-surface);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    overflow-x: hidden !important;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.modal-box.large { width: 920px; max-width: 94vw; max-height: 88vh; }
.modal-box.medium { width: 560px; max-width: 90vw; max-height: 82vh; }
.modal-box.small { width: 400px; max-width: 88vw; }

.modal-header {
    padding: 12px 18px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title { font-family: var(--project-body-font, 'Geoform'), cursive, sans-serif; font-size: 0.98rem; font-weight: 700; color: #fff; }
.modal-close { background: none; border: none; color: var(--text-sub); font-size: 1.4rem; cursor: pointer; }

.modal-body {
    padding: 14px 18px;
    overflow-y: auto;
    overflow-x: hidden !important;
    box-sizing: border-box;
    width: 100%;
}

.modal-footer {
    padding: 10px 18px;
    border-top: 1px solid var(--border-subtle);
    background: rgba(10, 12, 19, 0.4);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

/* ADMIN MODAL EDITOR (COMPACT & ERGONOMIC) */
.modal-editor {
    background: #0d111a;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    width: 780px;
    max-width: 90vw;
    max-height: 84vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.95);
    overflow: hidden;
    overflow-x: hidden !important;
}

.modal-editor-header {
    padding: 10px 16px;
    background: rgba(15, 23, 42, 0.9);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-editor-header h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--primary-gold);
    margin: 0;
}

.modal-editor-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 6px 12px;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid var(--border-subtle);
    overflow-x: hidden !important;
}

.editor-tab-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid transparent;
    color: var(--text-sub);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.76rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.editor-tab-btn.active, .editor-tab-btn:hover {
    background: rgba(212, 175, 55, 0.15);
    border-color: var(--primary-gold);
    color: var(--primary-gold);
}

.modal-editor-body {
    padding: 12px 16px;
    overflow-y: auto;
    overflow-x: hidden !important;
    flex: 1;
    box-sizing: border-box;
    width: 100%;
}

.modal-editor-body form .form-input,
.modal-editor-body form .form-select {
    padding: 5px 8px !important;
    font-size: 0.8rem !important;
    height: 32px !important;
}

.modal-editor-body form label {
    font-size: 0.75rem !important;
    margin-bottom: 3px !important;
}

.comparison-dialog,
.comparison-dialog *,
.comparison-dialog button,
.comparison-dialog input,
.comparison-dialog select,
.comparison-dialog textarea {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

.comparison-dialog {
    width: min(1320px, calc(100vw - 32px)) !important;
    max-height: calc(100vh - 32px) !important;
    border: 1px solid rgba(212, 175, 55, .28);
    background: linear-gradient(155deg, rgba(19, 23, 34, .99), rgba(8, 10, 16, .99));
    box-shadow: 0 28px 90px rgba(0, 0, 0, .76);
}

#comparison-modal {
    align-items: center;
    padding: 16px;
}

.comparison-parent-layer {
    z-index: 4000;
    padding: 16px;
    background: rgba(0, 0, 0, .62);
    backdrop-filter: blur(3px);
    pointer-events: none;
}
.comparison-parent-layer .comparison-dialog {
    opacity: .72;
    transform: translate(-10px, -8px) scale(.985);
    filter: saturate(.72) brightness(.74);
}
#comparison-modal.comparison-nested-child {
    z-index: 4002;
    background: rgba(0, 0, 0, .48);
    backdrop-filter: blur(2px);
}
#comparison-modal.comparison-nested-child .comparison-dialog {
    transform: translate(10px, 8px);
    box-shadow: 0 34px 110px rgba(0, 0, 0, .9), 0 0 0 1px rgba(212, 175, 55, .16);
}

/* Leaf pickers opened from a nested Soul Crystal comparison must stay above
   both the frozen parent snapshot and the active comparison dialog. */
#search-modal.active,
#manual-enchant-modal.active,
#enchantment-stone-modal.active,
#message-modal.active {
    z-index: 4010;
}

.comparison-dialog .comparison-header {
    min-height: 74px;
    padding: 15px 20px;
    align-items: center;
    background: rgba(6, 8, 13, .72);
}

.comparison-heading { min-width: 0; }
.comparison-dialog .modal-title {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    font-size: 18px;
    font-weight: 650;
    letter-spacing: 0;
    line-height: 1.25;
}
.comparison-dialog .modal-title strong { color: var(--gold-light); font-weight: 650; }
.comparison-heading p { margin-top: 4px; color: var(--text-muted); font-size: 12px; line-height: 1.4; }
.comparison-dialog .modal-close {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    color: #cbd5e1;
    font-size: 24px;
    line-height: 1;
}
.comparison-dialog .modal-close:hover { background: rgba(255,255,255,.07); color: #fff; }
.comparison-dialog .modal-body { padding: 16px; }

.comparison-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 350px);
    gap: 16px;
    align-items: start;
}
.comparison-items-pane { min-width: 0; }
.comp-columns-grid {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    align-items: stretch;
}

.comp-col {
    width: 100%;
    min-width: 0;
    padding: 14px;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 10px;
    background: linear-gradient(145deg, rgba(30, 36, 43, .96), rgba(10, 15, 19, .96));
    box-shadow: inset 0 1px 0 rgba(255,255,255,.045), inset 0 -12px 24px rgba(0,0,0,.13);
    overflow: hidden;
}
.comp-col.highlight {
    border-color: rgba(212,175,55,.4);
    background: linear-gradient(145deg, rgba(42, 39, 29, .96), rgba(15, 22, 20, .96));
    box-shadow: inset 0 1px 0 rgba(255,229,169,.07), inset 0 -12px 24px rgba(0,0,0,.16);
}
.comp-col-header {
    min-height: 40px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}
.comp-col-heading { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.comp-col-heading strong { color: #f8fafc; font-size: 14px; font-weight: 650; line-height: 1.25; }
.comp-col-heading small { color: var(--text-muted); font-size: 11px; line-height: 1.3; }
.comp-header-actions { display: flex; flex: 0 0 auto; gap: 6px; }

.btn-pick-item {
    min-height: 34px;
    padding: 6px 11px;
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 7px;
    background: rgba(255,255,255,.04);
    color: #e2e8f0;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    text-transform: none;
    cursor: pointer;
    transition: border-color .16s ease, background .16s ease, color .16s ease;
}
.btn-pick-item.gold { border-color: rgba(212,175,55,.62); color: var(--gold-light); }
.btn-pick-item.danger { border-color: rgba(239,68,68,.36); background: rgba(239,68,68,.07); color: #fca5a5; }
.btn-pick-item.muted { color: #aeb9c8; }
.btn-pick-item:hover { border-color: rgba(255,255,255,.3); background: rgba(255,255,255,.08); color: #fff; }

.comp-item-preview {
    min-height: 82px;
    margin-bottom: 14px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 9px;
    background: rgba(0,0,0,.24);
}
.comp-item-picker { cursor: pointer; transition: border-color .16s ease, background .16s ease; }
.comp-item-picker:hover { border-color: rgba(212,175,55,.5); background: rgba(212,175,55,.055); }
.comp-item-picker:focus-visible { outline: 2px solid var(--primary-gold); outline-offset: 2px; }
.comp-item-icon {
    position: relative;
    width: 56px;
    height: 56px;
    flex: 0 0 56px;
    overflow: hidden;
    border: 1px solid rgba(212,175,55,.28);
    border-radius: 8px;
    background: #05070b;
}
.comp-candidate-tabs {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    margin: -2px 0 10px;
    padding: 0 7px;
    border-bottom: 1px solid rgba(212,175,55,.28);
    overflow-x: auto;
    scrollbar-width: none;
}
.comp-candidate-tabs::-webkit-scrollbar { display: none; }
.comp-candidate-tab {
    appearance: none;
    position: relative;
    min-height: 29px;
    margin: 0 0 -1px;
    padding: 5px 11px 6px;
    border: 1px solid rgba(152,129,78,.34);
    border-bottom-color: rgba(212,175,55,.28);
    border-radius: 8px 8px 0 0;
    background: linear-gradient(180deg, rgba(53,48,38,.62), rgba(13,15,20,.9));
    color: #9ca3af;
    font: 700 .66rem/1.1 var(--project-body-font, 'Geoform'), sans-serif;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: inset 0 1px rgba(255,255,255,.035);
    transition: color .16s ease, border-color .16s ease, background .16s ease;
}
.comp-candidate-tab:hover {
    border-color: rgba(212,175,55,.5);
    color: #e8d39a;
}
.comp-candidate-tab.active {
    z-index: 2;
    border-color: rgba(212,175,55,.72);
    border-bottom-color: #1d1c18;
    background: linear-gradient(180deg, rgba(102,81,36,.48), #1d1c18 82%);
    color: var(--gold-light);
    box-shadow: inset 0 2px rgba(255,229,147,.1), 0 -3px 9px rgba(0,0,0,.2);
}
.comp-candidate-tab[aria-selected="true"]::after {
    content: '';
    position: absolute;
    left: 8px;
    right: 8px;
    top: 0;
    height: 2px;
    border-radius: 2px;
    background: var(--primary-gold);
}
.comp-item-icon > img,
.comp-item-icon > .item-icon-composite,
.comp-item-icon .item-icon-composite > img {
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 7px;
    background: transparent;
    object-fit: cover;
}
.comp-item-icon .item-icon-composite > img { border-radius: 0; }
.comparison-dialog .item-title { color: #fff; font-size: 15px; font-weight: 650; line-height: 1.35; }
.comparison-dialog .item-sub { margin-top: 3px; color: var(--text-muted); font-size: 12px; line-height: 1.4; }

.comp-controls {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 10px;
}
.comp-progress-controls {
    display: grid;
    grid-template-columns: minmax(66px, 78px) minmax(0, 1fr);
    align-items: stretch;
    gap: 10px;
    margin-bottom: 10px;
}
.comp-progress-controls.has-secondary-progress {
    grid-template-columns: minmax(66px, 78px) minmax(66px, 78px) minmax(0, 1fr);
}
.comp-progress-controls.has-extra-progress {
    grid-template-columns: repeat(3, minmax(56px, 68px)) minmax(0, 1fr);
}
.comp-progress-controls.no-progress { grid-template-columns: minmax(0, 1fr); }
.comp-progress-controls .comp-enchant-field,
.comp-progress-controls .comp-level-field {
    min-width: 0;
}
.comp-progress-controls .comp-price-field {
    min-width: 0;
}
.comp-progress-controls .comp-price-field .money-input {
    min-width: 0;
    text-align: right;
    font-variant-numeric: tabular-nums;
}
.comparison-dialog .comp-progress-controls .control-field label {
    min-height: 1.3em;
    font-size: 10px;
    white-space: nowrap;
}
.control-field { min-width: 0; display: flex; flex-direction: column; align-items: stretch; gap: 6px; }
.control-field[hidden] { display: none !important; }
.comparison-dialog .control-field label { color: #aeb9c8; font-size: 12px; font-weight: 600; line-height: 1.3; }
.comparison-dialog .control-field .select-dark,
.comparison-dialog .control-field .input-dark {
    width: 100%;
    min-width: 0;
    min-height: 38px;
    padding-top: 7px;
    padding-bottom: 7px;
    border-radius: 7px;
    font-size: 13px;
}
.armor-enchant-sync {
    position: relative;
    margin: -1px 0 10px;
    padding: 9px 10px;
    display: flex;
    align-items: center;
    gap: 9px;
    border: 1px solid rgba(212,175,55,.2);
    border-radius: 8px;
    background: rgba(212,175,55,.045);
    cursor: pointer;
}
.armor-enchant-sync[hidden] { display: none !important; }
.armor-enchant-sync > input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}
.armor-enchant-sync-control {
    position: relative;
    width: 34px;
    height: 19px;
    flex: 0 0 34px;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 999px;
    background: rgba(255,255,255,.09);
    transition: background .16s ease, border-color .16s ease;
}
.armor-enchant-sync-control > span {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: #aeb9c8;
    transition: transform .16s ease, background .16s ease;
}
.armor-enchant-sync > input:checked + .armor-enchant-sync-control {
    border-color: rgba(212,175,55,.75);
    background: rgba(212,175,55,.25);
}
.armor-enchant-sync > input:checked + .armor-enchant-sync-control > span {
    transform: translateX(15px);
    background: var(--gold-light);
}
.armor-enchant-sync > input:focus-visible + .armor-enchant-sync-control {
    outline: 2px solid var(--primary-gold);
    outline-offset: 2px;
}
.armor-enchant-sync-copy { min-width: 0; display: grid; gap: 1px; }
.armor-enchant-sync-copy strong { color: #e8edf5; font-size: 12px; line-height: 1.3; }
.armor-enchant-sync-copy small { color: #8995a7; font-size: 10px; line-height: 1.3; }
.craft-effect-controls {
    margin-top: 2px;
    padding: 10px;
    grid-template-columns: 1fr;
    border: 1px solid rgba(212,175,55,.22);
    border-radius: 8px;
    border-color: color-mix(in srgb, var(--craft-effect-color, #e8cb71) 35%, transparent);
    background: var(--craft-effect-background, #282214);
}
.craft-effect-controls .control-field label { color: var(--craft-effect-color, #e8cb71); }
.craft-effect-hint { display:block; margin-top:5px; color:#8f9aae; font-size:11px; line-height:1.35; }
.craft-effect-hint.has-conflict { color:#f0b765; }
.comp-armor-elements {
    margin: 2px 0 10px;
    padding: 10px;
    flex-direction: column;
    gap: 8px;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 8px;
    background: rgba(0,0,0,.2);
}
.comp-element-heading { color: #cbd5e1; font-size: 12px; font-weight: 650; }
.armor-element-row { display: grid; grid-template-columns: minmax(160px, 1.55fr) minmax(76px, .45fr); gap: 8px; }
.armor-element-row .select-dark { width: 100%; min-width: 160px; padding-right: 30px; }
.armor-element-row .input-dark { width: 100%; min-width: 76px; }
.comparison-dialog .armor-element-row .select-dark,
.comparison-dialog .armor-element-row .input-dark { min-height: 38px; border-radius: 7px; font-size: 13px; }
.selected-craft-effect-summary {
    margin-bottom: 9px;
    padding: 9px 10px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    border: 1px solid rgba(212,175,55,.3);
    border-radius: 7px;
    border-color: color-mix(in srgb, var(--craft-effect-color, #e8cb71) 32%, transparent);
    background: var(--craft-effect-background, #282214);
}
.selected-craft-effect-summary strong { color: var(--craft-effect-color, #e8cb71); font-size: 13px; }
.selected-craft-effect-summary span { color: var(--craft-effect-text, #f7e8b4); font-size: 12px; }

.item-full-stats {
    flex: 0 0 clamp(160px, 22vh, 300px);
    min-height: 0;
    margin-top: 8px;
    padding-right: 5px;
    overflow-y: auto;
    scrollbar-gutter: stable;
}
.item-full-stats::-webkit-scrollbar,
.comp-result-stats-scroll::-webkit-scrollbar { width: 5px; }
.item-full-stats::-webkit-scrollbar-track,
.comp-result-stats-scroll::-webkit-scrollbar-track { background: rgba(0,0,0,.2); border-radius: 4px; }
.item-full-stats::-webkit-scrollbar-thumb,
.comp-result-stats-scroll::-webkit-scrollbar-thumb { background: rgba(212,175,55,.65); border-radius: 4px; }
.comparison-dialog .weapon-base-parameters {
    margin-bottom: 8px;
    padding: 10px 11px;
    border: 1px solid rgba(255,255,255,.09);
    border-radius: 8px;
    background: rgba(0,0,0,.2);
}
.comparison-dialog .weapon-base-parameters-title {
    margin-bottom: 7px;
    padding-bottom: 6px;
    border-bottom-color: rgba(255,255,255,.07);
    color: #dbe3ee;
    font-size: 12px;
    font-weight: 650;
}
.comparison-dialog .weapon-base-parameter-row { min-height: 28px; color: #b8c3d1; font-size: 12px; }
.comparison-dialog .weapon-base-parameter-row strong { font-size: 13px; }
.comparison-dialog .weapon-base-parameter-row small { color: #d8c580; font-size: 11px; }
.item-detail-section {
    margin-bottom: 8px;
    padding: 10px 11px;
    border: 1px solid rgba(255,255,255,.09);
    border-radius: 8px;
    background: rgba(0,0,0,.2);
    font-size: 12px;
}
.item-relation-note { display:grid; gap:7px; margin:0 0 11px; padding:10px 12px; border-left:3px solid var(--conditional-effect-color); background:var(--relation-effect-background, #332d1c); color:var(--relation-effect-text, #f6e7a8); font-size:.76rem; line-height:1.45; }
.item-relation-note strong { color:var(--conditional-effect-color); font-size:.82rem; }.item-relation-note>div { display:grid; gap:3px; }.item-relation-note span { white-space:pre-line; }.item-relation-note b { color:var(--conditional-effect-color); font-size:.78rem; font-weight:750; white-space:pre-line; }

/* Authoritative calculation breakdown (xE120). */
.calculation-breakdown-dialog { --modal-max-width:1040px; width:min(1040px,calc(100vw - 28px)); }.calculation-breakdown-dialog .modal-header p { max-width:720px; margin:5px 0 0; color:var(--text-muted); font-size:.72rem; line-height:1.45; }.calculation-breakdown-body { display:grid; gap:12px; min-height:0; }.calculation-breakdown-tabs { display:flex; gap:7px; padding-bottom:10px; border-bottom:1px solid rgba(255,255,255,.08); }.calculation-breakdown-tabs button { min-height:30px; padding:5px 10px; border:1px solid rgba(177,200,212,.2); border-radius:6px; background:rgba(255,255,255,.025); color:var(--text-muted); cursor:pointer; font:800 .67rem var(--project-body-font,'Geoform'),sans-serif; }.calculation-breakdown-tabs button.active { border-color:rgba(212,175,55,.62); background:rgba(212,175,55,.12); color:#f8e3a4; }.calculation-breakdown-status { margin:0; color:var(--text-muted); font-size:.72rem; }.calculation-breakdown-list { display:grid; gap:8px; max-height:min(62vh,640px); overflow:auto; padding-right:3px; }.calculation-breakdown-entry { border:1px solid rgba(177,200,212,.16); border-radius:8px; background:rgba(3,7,11,.45); }.calculation-breakdown-entry>summary { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:10px 11px; cursor:pointer; list-style:none; }.calculation-breakdown-entry>summary::-webkit-details-marker { display:none; }.calculation-breakdown-entry>summary strong { min-width:0; overflow:hidden; color:#eef5f6; font-size:.76rem; text-overflow:ellipsis; white-space:nowrap; }.calculation-breakdown-entry>summary small { flex:0 0 auto; color:#8da3b1; font-size:.62rem; }.calculation-breakdown-entry[open]>summary { border-bottom:1px solid rgba(177,200,212,.11); }.calculation-breakdown-sources { display:grid; gap:7px; padding:9px 11px 11px; }.calculation-breakdown-source { padding:8px 9px; border-left:2px solid rgba(128,173,219,.5); border-radius:4px; background:rgba(128,173,219,.055); }.calculation-breakdown-source header { display:flex; align-items:center; justify-content:space-between; gap:8px; color:#b9d5ed; font-size:.68rem; font-weight:800; }.calculation-breakdown-stat-chips { display:flex; flex-wrap:wrap; gap:5px; margin-top:7px; }.calculation-breakdown-stat-chips span { padding:3px 5px; border-radius:4px; background:rgba(0,0,0,.26); color:#c8d9df; font-size:.63rem; }.calculation-breakdown-stat-chips b { margin-left:3px; color:#70e0ae; font-weight:800; }.calculation-breakdown-stat-chips b.negative { color:#f59a9a; }.calculation-breakdown-changes { display:grid; gap:3px; margin:7px 0 0; color:#aabdc4; font-size:.64rem; line-height:1.4; white-space:pre-line; }.calculation-breakdown-final { border-color:color-mix(in srgb,var(--primary-gold) 54%,transparent); background:color-mix(in srgb,var(--primary-gold) 8%,transparent); }.calculation-breakdown-final>summary strong { color:#ffe5a1; }.calculation-breakdown-empty { padding:24px 14px; border:1px dashed rgba(177,200,212,.18); border-radius:8px; color:var(--text-muted); text-align:center; font-size:.75rem; }
@media(max-width:620px) { .calculation-breakdown-tabs { display:grid; grid-template-columns:1fr 1fr; }.calculation-breakdown-entry>summary { align-items:flex-start; flex-direction:column; gap:3px; }.calculation-breakdown-list { max-height:56vh; }.calculation-breakdown-trigger { right:5px; } }
.item-detail-section-title {
    margin-bottom: 7px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255,255,255,.07);
    color: #dbe3ee;
    font-size: 12px;
    font-weight: 650;
}
.item-detail-subtitle { margin-top: 10px; }
.item-detail-lines { display: flex; flex-direction: column; gap: 5px; color: #e2e8f0; line-height: 1.45; }
.item-detail-line { display: flex; align-items: flex-start; gap: 7px; }
.item-detail-marker { color: #d8bd67; font-weight: 700; }
.set-effect-section { margin-top: 6px; }

.comparison-result-panel {
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    max-height: calc(100dvh - 212px);
    min-width: 0;
    border: 1px solid rgba(255,255,255,.11);
    border-radius: 10px;
    background: linear-gradient(160deg, rgba(24, 32, 36, .98), rgba(6, 11, 15, .98));
    overflow: hidden;
}
.comparison-result-panel.full-set-result { position: static; }
.comparison-result-panel > .comparison-result-heading,
.comparison-result-panel > .comparison-result-tabs { flex:0 0 auto; }
.comparison-result-heading {
    padding: 14px 15px 12px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    border-bottom: 1px solid rgba(255,255,255,.08);
    background: rgba(255,255,255,.025);
}
.comparison-result-heading strong { color: #f8fafc; font-size: 15px; font-weight: 650; }
.comparison-result-heading span { color: var(--text-muted); font-size: 11px; line-height: 1.4; }
.comparison-result-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    padding: 9px 11px;
    border-bottom: 1px solid rgba(255,255,255,.08);
    background: rgba(0,0,0,.14);
}
.comparison-result-tabs[hidden],
.comparison-result-tab[hidden] { display: none; }
.comparison-result-tabs.single { grid-template-columns: 1fr; }
.comparison-result-tab {
    min-height: 31px;
    padding: 6px 8px;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 6px;
    background: rgba(255,255,255,.035);
    color: #aab5c4;
    font: 600 11px/1.2 inherit;
    cursor: pointer;
}
.comparison-result-tab:hover { color: #edf3fb; border-color: rgba(212,175,55,.42); }
.comparison-result-tab.active { border-color: rgba(212,175,55,.7); background: rgba(212,175,55,.13); color: #f2d783; }
.comparison-dialog :is(button, input, select, textarea):focus-visible {
    outline: 2px solid #f2d783;
    outline-offset: 2px;
}
.comparison-result-content { min-height:0;overflow-y:auto;scrollbar-width:thin;scrollbar-color:rgba(141,175,154,.55) transparent; }
.comparison-result-content::-webkit-scrollbar { width:5px; }
.comparison-result-content::-webkit-scrollbar-thumb { background:rgba(141,175,154,.55);border-radius:3px; }
.comp-result-empty {
    min-height: 350px;
    padding: 34px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--text-muted);
    text-align: center;
}
.comp-result-empty strong { color: #e2e8f0; font-size: 14px; font-weight: 600; }
.comp-result-empty span { max-width: 250px; font-size: 12px; line-height: 1.55; }
.comp-result-calculating {
    min-height: 350px;
    padding: 24px;
    display: grid;
    place-items: center;
    color: var(--text-muted);
    font-size: 13px;
    text-align: center;
}
.comparison-characteristics-loader { align-content:center; justify-items:center; gap:9px; color:#dfe8f2; }
.comparison-characteristics-loader strong { color:#f4d996; font:750 .82rem var(--project-body-font,'Geoform'),sans-serif; }
.comparison-loader-percent { min-width:46px; padding:3px 8px; border:1px solid rgba(212,175,55,.28); border-radius:999px; background:rgba(212,175,55,.08); color:#d7e0e9; font:700 .72rem var(--project-body-font,'Geoform'),sans-serif; }
.comp-result-overview { padding: 14px; border-bottom: 1px solid rgba(255,255,255,.08); }
.comp-result-direction {
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid rgba(212,175,55,.22);
    border-radius: 8px;
    background: rgba(212,175,55,.055);
}
.comp-result-direction span { min-width: 0; color: #dbe3ee; font-size: 13px; line-height: 1.35; }
.comp-result-direction strong { flex: 0 0 auto; font-size: 18px; font-weight: 700; white-space: nowrap; }
.comp-result-direction-note { margin: 8px 1px 0; color: #aeb9c8; font-size: 11px; line-height: 1.4; }
.comp-result-stack { display:grid;gap:9px;padding:12px;min-width:0; }
.comparison-result-content .comp-result-card { min-width:0;margin:0;padding:11px;border:1px solid rgba(162,184,179,.2);border-radius:3px;background:linear-gradient(145deg,rgba(33,44,45,.92),rgba(10,17,20,.96));box-shadow:inset 0 1px 0 rgba(255,255,255,.055),0 3px 10px rgba(0,0,0,.14);font-size:12px; }
.comparison-result-content .comp-result-card-title { margin:0 0 9px;padding:0 0 7px;border-bottom:1px solid rgba(255,255,255,.075);color:#ecf3ed;font-size:12px;font-weight:650;line-height:1.35; }
.comparison-result-content .comp-growth-block { border-color:rgba(155,189,125,.32);background:linear-gradient(135deg,rgba(58,68,40,.45),rgba(15,30,27,.96) 65%,rgba(8,17,18,.98)); }
.comp-growth-entry { display:grid;gap:4px;min-width:0;padding:7px 0; }
.comp-growth-entry + .comp-growth-entry { border-top:1px solid rgba(193,220,201,.11); }
.comp-growth-heading { display:flex;align-items:baseline;justify-content:space-between;gap:8px;min-width:0; }
.comp-growth-heading > span { min-width:0;color:#e4ece5;line-height:1.4; }
.comp-growth-heading > strong { flex:0 0 auto;font-size:13px;line-height:1.4; }
.comp-growth-price { display:flex;flex-wrap:wrap;justify-content:space-between;gap:3px 8px;min-width:0;font-size:11px;line-height:1.5; }
.comp-growth-price > span:first-child { color:#a0b3ab; }
.comp-growth-price > strong { min-width:0;max-width:100%;color:#e3e9e5;font-size:11px;font-weight:550;overflow-wrap:break-word; }
.comp-growth-price-difference { display:flex;justify-content:space-between;flex-wrap:wrap;gap:4px 8px;margin-top:8px;padding-top:8px;border-top:1px solid rgba(255,255,255,.075);font-size:10px;color:#9eada8; }
.comp-growth-entry[data-growth-kind=crystal] .comp-growth-heading > span { color:#a9cced; }
.comparison-result-content .comp-soul-changes { border-color:rgba(117,166,205,.29);background:linear-gradient(140deg,rgba(34,50,68,.92),rgba(9,18,25,.98)); }
.comparison-result-content .comp-soul-changes .comp-result-card-title { color:#b9d8f2; }
.comp-soul-detail { padding-top:8px; }
.comp-soul-detail + .comp-soul-detail { margin-top:7px; border-top:1px solid rgba(147,197,253,.15); }
.comp-soul-detail > b { display:block; margin-bottom:5px; color:#d7e9ff; font-size:11px; }
.comp-soul-item-name { display:block;margin-bottom:6px;color:#a0b2c0;font-size:10px;line-height:1.4;overflow-wrap:break-word; }
.comp-soul-detail .comp-delta-grid { gap:4px; }
.comp-soul-detail .comp-delta-stat { padding:3px 0;border:0;background:none; }
.comp-soul-detail .comp-delta-label,.comp-soul-detail .comp-delta-value { font-size:11px; }
.weapon-crystal-install-modal .modal-box { width:min(520px,calc(100vw - 24px)); padding:20px; }
.weapon-crystal-install-actions { display:flex; flex-wrap:wrap; gap:8px; margin-top:16px; }
.weapon-crystal-install-actions > button { flex:1 1 190px; font-size:12px; }
.comparison-result-content .comp-gain-components { background:linear-gradient(145deg,rgba(48,43,32,.9),rgba(15,20,21,.98));border-color:rgba(198,173,115,.24); }
.comp-gain-component { display:flex;justify-content:space-between;gap:8px;padding:4px 0;font-size:11px;line-height:1.45; }
.comp-gain-component > span { min-width:0;color:#cbd4d0; }
.comp-gain-component > strong { flex-shrink:0;font-size:11px; }
.comp-result-card-note { margin:0;color:#a9b8b2;font-size:11px;line-height:1.5; }
.comparison-result-content .comp-item-changes { padding:0;background:linear-gradient(140deg,rgba(31,37,41,.92),rgba(9,15,19,.98)); }
.comp-item-changes > summary { display:flex;align-items:center;gap:8px;padding:11px;list-style:none;color:#d9e5df;cursor:pointer;font-size:12px;font-weight:600; }
.comp-item-changes > summary::-webkit-details-marker { display:none; }
.comp-item-changes > summary > small { margin-left:auto;color:#92a39b;font-size:10px;font-weight:500; }
.comp-item-changes[open] > summary { border-bottom:1px solid rgba(255,255,255,.075); }
.comp-changes-chevron { color:#a9c5b3;font-size:17px;line-height:1; }
.comp-item-changes[open] .comp-changes-chevron { transform:rotate(180deg); }
.comp-item-changes > .comp-result-stats-scroll { padding:10px; }
.comp-item-changes .comp-set-changes { margin-top:8px;padding:8px 0;border-bottom:0; }
.comparison-result-content .positive { color: #34d399; }
.comparison-result-content .negative { color: #fb7185; }
.comparison-result-content .muted { color: var(--text-muted); }
.comparison-result-content .neutral { color: #d8c580; }
.comp-result-costs { margin-top: 12px; display: grid; gap: 9px; }
.comp-result-costs > div { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); align-items: baseline; gap: 10px; }
.comp-result-costs > div > span { color: var(--text-muted); font-size: 11px; }
.comp-result-costs > div > strong { min-width: 0; color: #e2e8f0; font-size: 12px; font-weight: 600; line-height: 1.4; text-align: right; }
.comp-result-roi-prompt { border-top: 1px solid rgba(255,255,255,.06); padding-top: 9px; }
.comp-result-roi-prompt > div { grid-template-columns: minmax(0, .7fr) minmax(0, 1.3fr); }
.comp-result-stats-section { padding: 13px 14px 14px; }
.comp-result-section-title { margin-bottom: 7px; color: #e2e8f0; font-size: 12px; font-weight: 650; }
.comp-result-stats-scroll { max-height: none; padding-right: 4px; overflow-y: visible; }
.full-set-comparison .comp-result-stats-scroll { max-height: none; overflow: visible; }
.comp-set-changes { padding: 13px 14px 7px; border-bottom: 1px solid rgba(255,255,255,.08); color: #d8c580; font-size: 11px; line-height: 1.4; }
.comp-set-changes > strong { display: block; margin-bottom: 7px; color: #f2d783; }
.comp-set-change { display: grid; gap: 5px; margin-bottom: 8px; }
.comp-set-change > b { color: #e8edf6; font-weight: 650; }
.comp-set-changes span { display: block; padding: 8px 10px; border: 1px solid rgba(212,175,55,.22); border-radius: 7px; background: rgba(212,175,55,.06); }
.comp-set-changes summary { color:#f2d783; font-weight:700; cursor:pointer; padding:2px 0 8px; }
.comp-set-changes summary::marker { color:#d4af37; }
.comp-set-changes[open] summary { margin-bottom:4px; }
.comp-set-changes .comp-set-change { padding-top:3px; }
.combat-context-row { display:flex; align-items:center; justify-content:space-between; gap:8px; flex-wrap:wrap; margin:-3px 0 12px; }
.combat-context-picker { display:inline-flex; align-items:center; gap:4px; color:#d8c580; font-size:.72rem; }
.combat-context-picker button { min-height:25px; padding:2px 9px; border:1px solid rgba(212,175,55,.25); border-radius:3px; background:rgba(4,7,12,.55); color:#b7c2d2; cursor:pointer; font:700 .7rem var(--project-body-font,'Geoform'),sans-serif; }
.combat-context-picker button.active { border-color:#d4af37; background:rgba(212,175,55,.17); color:#ffe2a0; }
.combat-modifiers-summary { color:#9cdab9; font-size:.68rem; white-space:nowrap; }
.comp-delta-grid { display: grid; grid-template-columns: 1fr; }
.comp-delta-stat {
    min-width: 0;
    min-height: 31px;
    padding: 6px 2px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: baseline;
    gap: 9px;
    border-bottom: 1px solid rgba(255,255,255,.06);
    font-size: 12px;
    line-height: 1.35;
}
.comp-delta-label { min-width: 0; color: #cbd5e1; overflow-wrap: anywhere; }
.comp-delta-value { font-size: 12px; font-weight: 700; white-space: nowrap; }
.comp-delta-value.positive,
.comp-delta-text-change .positive { color: #34d399; }
.comp-delta-value.negative,
.comp-delta-text-change .negative { color: #fb7185; }
.comp-delta-value.neutral { color: var(--gold-light); }
.comp-delta-special { grid-column: auto; }
.comp-delta-empty { padding: 18px 4px; color: var(--text-muted); font-size: 12px; text-align: center; }
.comp-delta-text-change {
    padding: 8px 2px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    border-bottom: 1px solid rgba(255,255,255,.07);
    font-size: 12px;
    line-height: 1.4;
}
.comp-delta-text-change strong { color: #fff; }

.comparison-dialog .modal-footer {
    position: relative;
    z-index: 1;
    min-height: 66px;
    padding: 12px 16px;
    gap: 9px;
    background: rgba(6,8,13,.92);
}
.comparison-dialog .modal-footer button {
    min-height: 40px;
    padding: 9px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 650;
    letter-spacing: 0;
    line-height: 1;
    text-transform: none;
}
.comparison-dialog button:disabled { opacity: .42; cursor: not-allowed; filter: saturate(.55); }
.comparison-dialog button:disabled:hover { transform: none; }
.comparison-close-action { margin-right: auto; }
.comparison-remove-action { border-color: rgba(239,68,68,.36) !important; background: rgba(239,68,68,.07) !important; color: #fca5a5 !important; }
.comparison-apply-action { min-width: 170px; }

@media (max-width: 1080px) {
    .comparison-workspace { grid-template-columns: 1fr; }
    .comparison-result-panel { position: static; }
    .comparison-result-content { min-height: 0; }
    .comp-result-empty { min-height: 180px; }
    .comp-result-calculating { min-height: 180px; }
    .comp-delta-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 18px; }
}

@media (max-width: 720px) {
    #comparison-modal { padding: 8px; }
    .comparison-dialog { width: calc(100vw - 16px) !important; max-height: calc(100vh - 16px) !important; }
    .comparison-heading p { display: none; }
    .comparison-dialog .comparison-header { min-height: 58px; padding: 11px 13px; }
    .comparison-dialog .modal-title { font-size: 16px; }
    .comparison-dialog .modal-body { padding: 10px; }
    .comp-columns-grid { grid-template-columns: 1fr; }
    .comparison-dialog .modal-footer { flex-wrap: wrap; }
    .comparison-dialog .modal-footer button { flex: 1 1 135px; }
    .comparison-close-action { margin-right: 0; }
    .comp-delta-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .comparison-dialog .comp-progress-controls .control-field label { font-size: 9px; letter-spacing: -.025em; }
    .comp-col { padding: 11px; }
    .comp-col-header { align-items: flex-start; }
    .comp-header-actions { flex-wrap: wrap; justify-content: flex-end; }
    .comp-controls { grid-template-columns: 1fr; }
    .comp-controls.comp-progress-controls { grid-template-columns: 72px minmax(0, 1fr); gap: 6px; }
    .comp-controls.comp-progress-controls.has-secondary-progress { grid-template-columns: 72px 72px minmax(0, 1fr); }
    .comp-controls.comp-progress-controls.has-extra-progress { grid-template-columns: repeat(3, 56px) minmax(0, 1fr); }
    .comp-controls.comp-progress-controls.no-progress { grid-template-columns: minmax(0, 1fr); }
    .comp-item-attachments section>div { grid-template-columns: 1fr !important; }
    .armor-element-row { grid-template-columns: minmax(145px, 1.45fr) minmax(70px, .55fr); }
    .comparison-dialog .modal-footer button { flex-basis: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    .comparison-dialog *, .comparison-dialog *::before, .comparison-dialog *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
    }
}

.btn-swap-action {
    background: linear-gradient(135deg, #d4af37 0%, #b48811 100%);
    color: #000;
    border: none;
    padding: 12px 16px;
    border-radius: 10px;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.search-modal-controls {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.checkbox-label { display: flex; align-items: center; gap: 6px; font-size: 0.8rem; color: var(--text-sub); }

.search-results-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 400px;
    overflow-y: auto;
}

.search-item-row {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(24, 29, 44, 0.3);
    padding: 10px 14px;
    border-radius: 8px;
    cursor: pointer;
}

.search-item-row:hover { background: rgba(33, 40, 60, 0.5); }
.search-item-row img { width: 36px; height: 36px; border-radius: 6px; }
.search-item-row .name { font-weight: 700; color: #fff; font-size: 0.85rem; flex: 1; }
.badge-ench { font-size: 0.7rem; color: var(--primary-gold); font-weight: 700; }

/* ITEM PICKER — focused, readable slot selection experience */
.item-picker-backdrop {
    padding: 24px;
    /* A live full-screen blur over WebGL made scrolling recomposite the
       complete 3D frame for every row. The picker is intentionally opaque,
       so disabling that filter changes no readable content and restores the
       browser's fast scrolling path. */
    background: rgba(4, 6, 11, .975);
    backdrop-filter: none;
}

.item-picker-dialog {
    width: min(980px, 96vw);
    height: min(760px, 92vh);
    max-height: 92vh;
    background:
        radial-gradient(circle at 12% 0%, rgba(212, 175, 55, .11), transparent 28%),
        rgba(10, 12, 19, .94);
    border: 1px solid rgba(212, 175, 55, .34);
    border-radius: 18px;
    box-shadow: 0 30px 90px rgba(0, 0, 0, .72), inset 0 1px 0 rgba(255, 255, 255, .04);
    backdrop-filter: none;
}

.item-picker-header {
    min-height: 92px;
    padding: 18px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    border-bottom: 1px solid rgba(212, 175, 55, .2);
    background: rgba(19, 23, 34, .52);
}

.item-picker-heading { display: flex; align-items: center; gap: 14px; min-width: 0; }
.item-picker-heading > div:last-child { min-width: 0; }

.item-picker-slot-preview {
    position: relative;
    width: 56px;
    height: 56px;
    flex: 0 0 56px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 1px solid rgba(212, 175, 55, .48);
    border-radius: 12px;
    background: rgba(10, 12, 19, .78);
    color: var(--primary-gold);
    box-shadow: 0 0 24px rgba(212, 175, 55, .1);
}

.item-picker-slot-preview img,
.item-picker-slot-preview .item-icon-composite { width: 100%; height: 100%; object-fit: cover; }
.item-picker-slot-preview.hidden { display: none; }
.item-picker-eyebrow { margin-bottom: 5px; color: var(--primary-gold); font-size: .62rem; font-weight: 700; letter-spacing: .14em; }
.item-picker-header .modal-title { overflow: hidden; font-size: 1rem; text-overflow: ellipsis; white-space: nowrap; }
.item-picker-header .modal-title strong { color: var(--gold-light); }
.item-picker-slot-hint { margin-top: 5px; color: var(--text-muted); font-size: .7rem; }

.item-picker-close {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    display: grid;
    place-items: center;
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    background: rgba(255, 255, 255, .025);
    font-size: 1rem;
    transition: .18s ease;
}
.item-picker-close:hover { border-color: rgba(239, 68, 68, .55); background: rgba(239, 68, 68, .1); color: #fca5a5; }

.item-picker-body {
    min-height: 0;
    padding: 18px 22px 22px;
    display: flex;
    flex: 1;
    flex-direction: column;
    overflow: hidden;
}

.item-picker-toolbar,
.item-picker-categories,
.item-picker-subcategories,
.item-picker-results-head { position: relative; z-index: 2; flex: 0 0 auto; }
.item-picker-subcategories { max-height: 116px; overflow-y: auto; }

.item-picker-toolbar { display: grid; grid-template-columns: minmax(280px, 1fr); gap: 12px; }
.item-picker-search {
    height: 48px;
    padding: 0 13px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--border-subtle);
    border-radius: 11px;
    background: rgba(4, 6, 11, .58);
    transition: .18s ease;
}
.item-picker-search:focus-within { border-color: rgba(212, 175, 55, .7); box-shadow: 0 0 0 3px rgba(212, 175, 55, .08); }
.item-picker-search > i { color: var(--primary-gold); }
.item-picker-search input { width: 100%; border: 0; outline: 0; background: transparent; color: #fff; font-size: .82rem; }
.item-picker-search input::-webkit-search-cancel-button { filter: invert(1); opacity: .45; }
.item-picker-search-key { padding: 3px 6px; border: 1px solid var(--border-subtle); border-radius: 5px; color: var(--text-muted); font-size: .55rem; }

.item-picker-toggle {
    min-width: 230px;
    height: 48px;
    padding: 0 13px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--border-subtle);
    border-radius: 11px;
    background: rgba(24, 29, 44, .36);
    cursor: pointer;
}
.item-picker-toggle > input { position: absolute; opacity: 0; pointer-events: none; }
.item-picker-toggle-track { width: 34px; height: 19px; flex: 0 0 34px; padding: 2px; border-radius: 999px; background: #3a4250; transition: .18s ease; }
.item-picker-toggle-track > span { display: block; width: 15px; height: 15px; border-radius: 50%; background: #cbd5e1; transition: .18s ease; }
.item-picker-toggle input:checked + .item-picker-toggle-track { background: var(--primary-gold); }
.item-picker-toggle input:checked + .item-picker-toggle-track > span { transform: translateX(15px); background: #111827; }
.item-picker-toggle strong, .item-picker-toggle small { display: block; }
.item-picker-toggle strong { color: var(--text-sub); font-size: .69rem; }
.item-picker-toggle small { margin-top: 2px; color: var(--text-muted); font-size: .55rem; }

.item-picker-categories { margin-top: 14px; display: flex; gap: 7px; overflow-x: auto; scrollbar-width: none; }
.item-picker-categories::-webkit-scrollbar { display: none; }
.item-picker-categories .tab-btn { min-height: 36px; padding: 0 12px; display: inline-flex; flex: 0 0 auto; align-items: center; gap: 7px; border-radius: 9px; transition: .16s ease; }
.item-picker-categories .tab-btn:hover { border-color: rgba(212, 175, 55, .38); color: #fff; }

.item-picker-subcategories {
    margin-top: 9px;
    padding: 9px;
    display: none;
    flex-wrap: wrap;
    gap: 6px;
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    background: rgba(4, 6, 11, .3);
}
.item-picker-subcategories .tab-btn { padding: 5px 10px; border-radius: 7px; font-size: .68rem; }

.item-picker-results-head { margin: 15px 2px 9px; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.item-picker-results-head > div { display: flex; align-items: baseline; gap: 9px; }
.item-picker-results-head strong { color: #fff; font-size: .76rem; }
.item-picker-results-head span { color: var(--text-muted); font-size: .63rem; }
.item-picker-results-head > span i { margin-right: 5px; color: var(--primary-gold); }

.item-picker-results {
    flex: 1 1 auto;
    min-height: 0;
    padding: 2px 6px 10px 2px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-content: start;
    gap: 9px;
    overflow-y: auto;
    overscroll-behavior: contain;
    contain: layout paint;
    scrollbar-color: rgba(212, 175, 55, .55) rgba(255, 255, 255, .04);
}
.item-picker-results.is-virtualized {
    --picker-virtual-card-height: 102px;
    display: block;
    position: relative;
    overflow-y: auto;
    overflow-anchor: none;
}
.item-picker-results.is-virtualized .item-picker-card {
    height: var(--picker-virtual-card-height);
    min-height: var(--picker-virtual-card-height);
    max-height: var(--picker-virtual-card-height);
}
.picker-virtual-window {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
}
.picker-virtual-spacer { width: 1px; pointer-events: none; }
.item-picker-results .item-picker-card-meta { display: none; }
.item-picker-results .item-picker-card-copy { align-self: center; }

.user-profile-badge { border: 0; background: transparent; color: inherit; cursor: pointer; text-align: left; }
.human-dialog .dialog-message { margin: 0; color: var(--text-sub); line-height: 1.65; white-space: pre-line; }
.auth-dialog { overflow: hidden; }
.auth-session-expired { margin: 12px 20px 0; padding: 10px 12px; border: 1px solid rgba(209, 154, 77, .55); border-radius: 3px; color: #f4d39c; background: rgba(85, 42, 23, .62); font-size: .78rem; line-height: 1.4; }
.auth-session-expired[hidden] { display: none; }
.auth-subtitle { margin-top: 5px; color: var(--text-muted); font-size: .72rem; }
.auth-tabs { padding: 0 20px; display: flex; gap: 8px; border-bottom: 1px solid var(--border-subtle); }
.auth-tabs button, .auth-tabs .demo-entry-link { padding: 12px 14px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--text-muted); cursor: pointer; }
.auth-tabs button.active { border-color: var(--primary-gold); color: var(--gold-light); }
.auth-tabs .demo-entry-link {display:inline-flex;align-items:center;text-decoration:none;color:#64d99b;white-space:nowrap;}
.auth-tabs .demo-entry-link:hover,.auth-tabs .demo-entry-link:focus-visible {border-color:#64d99b;color:#a6f5c9;background:linear-gradient(0deg,rgba(45,160,96,.13),transparent);}
@media(max-width:520px){.auth-tabs{padding:0 10px;gap:4px}.auth-tabs button,.auth-tabs .demo-entry-link{padding:10px 8px;font-size:11px;white-space:nowrap}}
.auth-pane { display: none; flex-direction: column; gap: 14px; }
.auth-pane.active { display: flex; }
.auth-pane label { display: grid; gap: 7px; color: var(--text-sub); font-size: .76rem; }
.auth-pane label[hidden] { display: none !important; }
.auth-pane label small { color: var(--text-muted); }
.registration-mode-help { margin: -2px 0 0; padding: 9px 11px; border: 1px solid rgba(212,175,55,.2); border-radius: 8px; background: rgba(212,175,55,.055); color: var(--text-muted); font-size: .68rem; line-height: 1.5; }
.auth-submit { width: 100%; justify-content: center; margin-top: 4px; }
.auth-account-pane { display: none; }
.auth-account-pane.active { display: block; }
.auth-hidden { display: none !important; }
.password-reset-backdrop { z-index: 4600; }
.password-reset-dialog { width: min(520px, calc(100vw - 28px)); }
.password-reset-help { margin: 0; padding: 12px 14px; border: 1px solid rgba(212,175,55,.28); border-radius: 10px; background: rgba(212,175,55,.07); color: var(--text-sub); font-size: .75rem; line-height: 1.6; }
.password-reset-error { padding: 10px 12px; border: 1px solid rgba(239,100,113,.42); border-radius: 9px; background: rgba(239,100,113,.1); color: #ffacb5; font-size: .73rem; line-height: 1.5; }
.account-summary { margin-bottom: 18px; display: flex; align-items: center; gap: 14px; }
.account-summary > i { color: var(--primary-gold); font-size: 2.6rem; }
.account-summary strong,.account-summary span { display: block; }
.account-summary span { margin-top: 5px; color: var(--text-muted); font-size: .7rem; }
.profile-characters-section { margin-bottom: 16px; padding: 14px; border: 1px solid rgba(212,175,55,.24); border-radius: 12px; background: rgba(5,8,14,.38); }
.profile-characters-heading { margin-bottom: 11px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.profile-characters-heading > div strong,.profile-characters-heading > div span { display: block; }
.profile-characters-heading > div strong { color: #fff; font-size: .82rem; }
.profile-characters-heading > div span { margin-top: 3px; color: var(--text-muted); font-size: .64rem; }
.profile-characters-heading .btn-hero-secondary { min-height: 32px; padding: 6px 9px; font-size: .62rem; }
.profile-character-heading-actions { display: flex; align-items: center; gap: 6px; }
.profile-character-slots { max-height: 330px; padding-right: 4px; display: grid; gap: 8px; overflow-y: auto; scrollbar-color: rgba(212,175,55,.5) transparent; }
.profile-character-slot { width: 100%; min-height: 67px; padding: 8px 10px; display: grid; grid-template-columns: 42px minmax(0,1fr) auto; align-items: center; gap: 10px; border: 1px solid var(--border-subtle); border-radius: 10px; background: rgba(24,29,44,.42); color: inherit; cursor: pointer; text-align: left; }
.profile-character-slot:hover { border-color: rgba(212,175,55,.46); background: rgba(45,38,22,.45); }
.profile-character-slot.selected { border-color: var(--primary-gold); box-shadow: 0 0 0 2px rgba(212,175,55,.08); }
.profile-character-slot.locked { border-color: rgba(239,68,68,.25); background: rgba(80,20,27,.12); }
.profile-character-slot.empty { border-style: dashed; }
.profile-character-avatar { position: relative; width: 42px; height: 42px; display: grid; place-items: center; overflow: hidden; border-radius: 9px; background: #06090f; color: var(--text-muted); }
.profile-character-avatar img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.profile-character-slot.locked .profile-character-avatar::after { content: "🔒"; position: absolute; inset: 0; display: grid; place-items: center; background: rgba(3,5,9,.7); font-size: .9rem; }
.profile-character-info strong,.profile-character-info span { display: block; }
.profile-character-info strong { overflow: hidden; color: #fff; font-size: .74rem; text-overflow: ellipsis; white-space: nowrap; }
.profile-character-info span { margin-top: 4px; color: var(--text-muted); font-size: .61rem; }
.profile-character-status { padding: 4px 7px; border-radius: 999px; background: rgba(16,185,129,.1); color: #6ee7b7; font-size: .56rem; font-weight: 800; }
.profile-character-slot.locked .profile-character-status { background: rgba(239,68,68,.1); color: #fda4af; }
.profile-character-loading { padding: 18px; color: var(--text-muted); font-size: .7rem; text-align: center; }
.profile-character-note { margin: 10px 0 0; color: var(--text-muted); font-size: .62rem; line-height: 1.5; }
.character-editor-fields { display: grid; gap: 13px; }
.character-editor-fields label,.character-code-dialog label { display: grid; gap: 6px; color: var(--text-sub); font-size: .72rem; }
.number-stepper { position: relative; min-width: 0; display: block; }
.number-stepper.full { width: 100%; }
.number-stepper.compact { width: 82px; flex: 0 0 82px; }
.number-stepper input[type="number"] { width: 100%!important; padding-right: 27px!important; appearance: textfield; -moz-appearance: textfield; }
.number-stepper input[type="number"]::-webkit-inner-spin-button,.number-stepper input[type="number"]::-webkit-outer-spin-button { margin: 0; appearance: none; -webkit-appearance: none; }
.number-stepper-controls { position: absolute; z-index: 2; top: 1px; right: 1px; bottom: 1px; width: 24px; display: grid; grid-template-rows: 1fr 1fr; overflow: hidden; border-left: 1px solid rgba(212,175,55,.24); border-radius: 0 7px 7px 0; }
.number-stepper-controls button { min-width: 0; padding: 0; display: grid; place-items: center; border: 0; background: rgba(212,175,55,.055); color: #bca45a; font-size: 7px; line-height: 1; cursor: pointer; }
.number-stepper-controls button+button { border-top: 1px solid rgba(212,175,55,.18); }
.number-stepper-controls button:hover { background: rgba(212,175,55,.18); color: #ffe9a0; }
.number-stepper-controls button:active { background: rgba(212,175,55,.28); }
.number-stepper.compact { width: 102px; flex-basis: 102px; }
.number-stepper input[type="number"] { padding-right: 57px!important; }
.number-stepper-controls { width: 52px; display: flex; flex-direction: row; }
.number-stepper-controls button { flex: 1 1 50%; font-size: 14px; font-weight: 700; }
.number-stepper-controls button+button { border-top: 0; border-left: 1px solid rgba(212,175,55,.18); }
.save-build-character { margin-bottom: 11px; padding: 9px 11px; display: flex; justify-content: space-between; gap: 12px; border: 1px solid rgba(212,175,55,.24); border-radius: 9px; background: rgba(212,175,55,.06); font-size: .7rem; }
.save-build-character span { color: var(--text-muted); }
.save-build-character strong { color: var(--gold-light); }
.char-profile-name { overflow: hidden; color: #fff8dc; font-family: var(--project-body-font, 'Geoform'), cursive, sans-serif; font-size: 1.02rem; font-weight: 800; letter-spacing: .015em; line-height: 1.25; text-overflow: ellipsis; text-shadow: 0 2px 8px #000; white-space: nowrap; }
.sidebar-build-state { padding: 12px 8px; color: var(--text-muted); font-size: .68rem; line-height: 1.5; text-align: center; }
button.my-build-card { width: 100%; border: 0; color: inherit; cursor: pointer; text-align: left; }

.item-picker-card {
    width: 100%;
    min-width: 0;
    min-height: 78px;
    padding: 11px;
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) 28px;
    align-items: center;
    gap: 11px;
    border: 1px solid var(--border-subtle);
    border-radius: 11px;
    background: rgba(24, 29, 44, .3);
    color: inherit;
    text-align: left;
    cursor: pointer;
    overflow: hidden;
    box-sizing: border-box;
    contain: layout paint style;
    content-visibility: auto;
    contain-intrinsic-size: auto 78px;
    transition: border-color .16s ease, background .16s ease, transform .16s ease;
}
.item-picker-card:hover { transform: translateY(-1px); border-color: rgba(212, 175, 55, .5); background: rgba(33, 40, 60, .48); }
.item-picker-results .item-picker-card,
.item-picker-results .item-picker-card *,
.item-picker-results .item-icon-composite * {
    animation: none !important;
    transition: none !important;
}
.item-picker-results .item-picker-card:hover {
    transform: none;
}
.item-picker-card:focus-visible { outline: 2px solid var(--primary-gold); outline-offset: 2px; }
.item-picker-card.is-selecting { pointer-events: none; }
.item-picker-card-icon { position: relative; width: 52px; height: 52px; overflow: hidden; border: 1px solid rgba(212, 175, 55, .22); border-radius: 9px; background: #05070b; }
.item-picker-card-icon img, .item-picker-card-icon .item-icon-composite { width: 100% !important; height: 100% !important; border-radius: 8px; }
.item-picker-card-copy { min-width: 0; overflow: hidden; }
.item-picker-card-name { width: 100%; max-width: 100%; min-height: 1.35em; overflow: hidden; display: -webkit-box; color: #fff; font-size: .76rem; font-weight: 700; line-height: 1.35; overflow-wrap: anywhere; text-overflow: ellipsis; white-space: normal; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.item-picker-card-subtype { display: block; margin-top: 5px; color: var(--text-muted); font-size: .62rem; line-height: 1.2; }
/* Item name/stage presentation is shared in item-details-shared.css. */

#admin-header-link[hidden] { display: none !important; }
body.project-locked { overflow: hidden; }
body.project-locked > .victory-header,
body.project-locked > .app-layout { visibility: hidden; pointer-events: none; user-select: none; }
body.project-locked #auth-modal { display: flex; }
body.project-locked #auth-modal-close { display: none; }
.item-picker-card-meta { margin-top: 5px; display: flex; flex-wrap: wrap; gap: 5px; }
.item-picker-card-meta span { min-width: 0; max-width: 100%; overflow: hidden; padding: 2px 6px; border-radius: 5px; background: rgba(255,255,255,.045); color: var(--text-muted); font-size: .56rem; text-overflow: ellipsis; white-space: nowrap; }
.item-picker-card-meta .progression { background: rgba(212,175,55,.1); color: var(--gold-light); }
.item-picker-card-action { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; background: rgba(212,175,55,.08); color: var(--primary-gold); font-size: .68rem; transition: .16s ease; }
.item-picker-card:hover .item-picker-card-action { background: var(--primary-gold); color: #111; }
.item-picker-card.collection-picker-card { min-height: 42px; padding: 7px 9px; grid-template-columns: minmax(190px,.42fr) minmax(0,1fr) 28px; align-items: center; gap: 10px; overflow: visible; background: #020202; }
.collection-picker-row-name { min-width: 0; overflow: hidden; color: #fff; font-size: .7rem; font-weight: 750; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.collection-picker-row-name .item-name-primary,.collection-picker-row-name .item-name-secondary { display: inline !important; }
.collection-picker-row-bonus { min-width: 0; color: #14b5a0; font-size: .69rem; font-weight: 800; line-height: 1.2; letter-spacing: -.01em; white-space: nowrap; }
.collection-picker-row-bonus.dense { font-size: .58rem; letter-spacing: -.025em; }
.collection-picker-row-bonus.ultra-dense { font-size: .48rem; letter-spacing: -.035em; }
.collection-picker-card .item-picker-card-action { margin: 0; }
.item-picker-card.collection-picker-card.direction-match { border-color: rgb(169 16 119 / 82%); }
.item-picker-card.collection-picker-card.direction-match:hover { border-color: #4ade80; }
.collection-picker-section-heading { grid-column: 1/-1; margin: 5px 0 1px; padding: 8px 10px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 1px solid rgba(148,163,184,.2); color: #cbd5e1; font-size: .7rem; }
.collection-picker-section-heading strong { font-size: inherit; }
.collection-picker-section-heading span { min-width: 24px; padding: 2px 7px; border-radius: 999px; background: rgba(148,163,184,.12); text-align: center; }
.collection-picker-section-heading.matching { border-color: rgba(74,222,128,.42); color: #86efac; }
.collection-picker-section-heading.matching span { background: rgba(34,197,94,.2); color: #bbf7d0; }
.collection-picker-section-heading.empty { padding: 12px 10px; border: 1px dashed rgba(74,222,128,.3); border-radius: 8px; background: rgba(20,83,45,.1); }
.replacement-rank-card.collection-rank-card { justify-content: center; }
.item-picker-body.collection-mode { grid-template-columns: minmax(0,1fr); }
.item-picker-body.collection-mode .item-picker-sidebar { display: none; }
.item-picker-body.collection-mode .item-picker-results { grid-template-columns: minmax(0,1fr); gap: 5px; }

@media (max-width: 720px) {
    .item-picker-card.collection-picker-card { grid-template-columns: minmax(120px,.38fr) minmax(0,1fr) 28px; gap: 7px; }
    .collection-picker-row-bonus { font-size: .58rem; }
    .collection-picker-row-bonus.dense { font-size: .5rem; }
    .collection-picker-row-bonus.ultra-dense { font-size: .43rem; }
}

.item-picker-state { min-height: 260px; grid-column: 1 / -1; display: grid; place-items: center; align-content: center; gap: 9px; color: var(--text-muted); text-align: center; }
.item-picker-state > i { font-size: 1.7rem; color: var(--primary-gold); }
.item-picker-state strong { color: var(--text-sub); font-size: .8rem; }
.item-picker-state span { max-width: 380px; font-size: .66rem; line-height: 1.5; }
.item-picker-state .btn-retry-search { margin-top: 5px; padding: 7px 12px; border: 1px solid var(--border-color); border-radius: 8px; background: var(--gold-dim); color: var(--gold-light); cursor: pointer; }

.item-picker-skeleton { min-height: 78px; border: 1px solid var(--border-subtle); border-radius: 11px; background: linear-gradient(90deg, rgba(24,29,44,.25), rgba(51,60,82,.42), rgba(24,29,44,.25)); background-size: 200% 100%; animation: picker-shimmer 1.2s infinite; }
@keyframes picker-shimmer { to { background-position: -200% 0; } }

.build-comparison-card { border-color: rgba(212, 175, 55, .32); }
.build-comparison-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.build-comparison-heading .card-title { margin-bottom: 5px; }
.build-comparison-heading p { margin: 0; color: var(--text-muted); font-size: .66rem; line-height: 1.45; }
#comparison-direction-badge { padding: 5px 8px; flex: 0 0 auto; border: 1px solid rgba(212,175,55,.3); border-radius: 7px; background: var(--gold-dim); color: var(--gold-light); font-size: .6rem; font-weight: 700; }
.efficiency-summary-grid { margin: 14px 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.efficiency-summary-grid > div { padding: 10px; border: 1px solid var(--border-subtle); border-radius: 9px; background: rgba(10,12,19,.44); }
.efficiency-summary-grid > div.accent { border-color: rgba(212,175,55,.35); background: rgba(212,175,55,.07); }
.efficiency-summary-grid small, .efficiency-summary-grid strong { display: block; }
.efficiency-summary-grid small { color: var(--text-muted); font-size: .57rem; }
.efficiency-summary-grid strong { margin-top: 5px; color: #fff; font-size: .72rem; }
.efficiency-summary-grid .accent strong { color: var(--gold-light); }
.build-comparison-table-wrap { max-height: 360px; overflow: auto; border: 1px solid var(--border-subtle); border-radius: 9px; }
.build-comparison-table { width: 100%; border-collapse: collapse; font-size: .63rem; }
.build-comparison-table th { position: sticky; top: 0; z-index: 1; padding: 8px; background: #111722; color: var(--text-muted); text-align: right; }
.build-comparison-table th:first-child { text-align: left; }
.build-comparison-table td { padding: 7px 8px; border-top: 1px solid rgba(255,255,255,.06); color: var(--text-sub); text-align: right; }
.build-comparison-table td:first-child { color: #fff; text-align: left; }
.build-comparison-table td.positive { color: #34d399; font-weight: 700; }
.build-comparison-table td.negative { color: #f87171; font-weight: 700; }
.build-comparison-table td.neutral { color: var(--text-muted); }
.build-comparison-table .comparison-empty-row td { padding: 26px 12px; color: var(--text-muted); text-align: center; line-height: 1.5; }
.active-set-summary { margin-bottom: 8px; padding: 9px; border-left: 3px solid var(--primary-gold); border-radius: 7px; background: rgba(212,175,55,.07); }
.active-set-summary > div { display: flex; justify-content: space-between; gap: 8px; }
.active-set-summary strong { color: var(--gold-light); font-size: .72rem; }
.active-set-summary span { color: var(--text-muted); font-size: .61rem; }
.active-set-summary p { margin: 5px 0 0; color: var(--text-sub); font-size: .62rem; line-height: 1.4; }
.active-set-summary p b { color: var(--primary-gold); }

/* ITEM PICKER V2 — navigation and results never share the same scroll layer */
.item-picker-dialog { width: min(1120px, 96vw); height: min(800px, 94vh); max-height: 94vh; }
.item-picker-header { min-height: 86px; flex: 0 0 auto; }
.item-picker-body {
    padding: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    flex: 1 1 auto;
    overflow: hidden;
}
.item-picker-sidebar {
    min-width: 0;
    padding: 18px 14px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    overflow-y: auto;
    border-right: 1px solid rgba(212,175,55,.18);
    background: linear-gradient(180deg, rgba(24,29,44,.48), rgba(10,12,19,.42));
}
.item-picker-sidebar-title { padding: 0 7px; }
.item-picker-sidebar-title span,.item-picker-sidebar-title small { display: block; }
.item-picker-sidebar-title span { color: #fff; font-size: .72rem; font-weight: 700; }
.item-picker-sidebar-title small { margin-top: 5px; color: var(--text-muted); font-size: .58rem; }
.item-picker-context-category {
    min-height: 48px;
    padding: 0 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid rgba(212,175,55,.32);
    border-radius: 9px;
    background: linear-gradient(90deg,rgba(212,175,55,.14),rgba(212,175,55,.035));
    color: var(--gold-light);
    font-size: .68rem;
    font-weight: 750;
}
.item-picker-context-category i { width: 20px; color: var(--primary-gold); text-align: center; }
.item-picker-categories {
    margin: 0;
    display: grid;
    gap: 6px;
    overflow: visible;
}
.item-picker-categories .tab-btn {
    width: 100%;
    min-height: 42px;
    padding: 0 11px;
    justify-content: flex-start;
    border: 1px solid transparent;
    background: transparent;
    text-align: left;
}
.item-picker-categories .tab-btn i { width: 20px; color: #7f899d; text-align: center; }
.item-picker-categories .tab-btn span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-picker-categories .tab-btn.active { border-color: rgba(212,175,55,.38); background: linear-gradient(90deg,rgba(212,175,55,.17),rgba(212,175,55,.04)); color: var(--gold-light); }
.item-picker-categories .tab-btn.active i { color: var(--primary-gold); }
.item-picker-toggle { width: 100%; min-width: 0; height: auto; min-height: 58px; margin-top: auto; }
.item-picker-content { min-width: 0; min-height: 0; padding: 18px 20px 0; display: flex; flex-direction: column; overflow: hidden; }
.item-picker-toolbar { display: flex; align-items: stretch; gap: 10px; flex: 0 0 auto; }
.item-picker-search { width: auto; height: 50px; flex: 1 1 auto; }
.item-picker-toolbar-toggle { width: 230px; min-height: 50px; margin: 0; flex: 0 0 230px; }
.item-picker-search-clear { width: 32px; height: 32px; display: grid; place-items: center; flex: 0 0 32px; border: 0; border-radius: 8px; background: transparent; color: var(--text-muted); cursor: pointer; }
.item-picker-search-clear:hover { background: rgba(255,255,255,.06); color: #fff; }
.item-picker-subcategories { flex: 0 0 auto; max-height: 105px; overflow-y: auto; }
.item-picker-results-head { flex: 0 0 auto; }
.item-picker-results { flex: 1 1 auto; min-height: 0; padding-bottom: 14px; }
.item-picker-footer { min-height: 58px; padding: 9px 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid var(--border-subtle); background: rgba(5,7,11,.55); }
.item-picker-footer > span { color: var(--text-muted); font-size: .6rem; }
.item-picker-footer kbd { margin-right: 5px; padding: 3px 6px; border: 1px solid var(--border-subtle); border-radius: 5px; background: rgba(255,255,255,.04); color: var(--text-sub); font: inherit; }
.item-picker-footer .btn-hero-secondary { min-height: 36px; padding: 0 16px; }

@media (max-width: 900px) and (min-width: 721px) {
    .item-picker-body { grid-template-columns: minmax(0,1fr); }
    .item-picker-content { padding-inline: 14px; }
    .item-picker-results { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
    .item-picker-backdrop { padding: 0; align-items: stretch; }
    .item-picker-dialog { width: 100vw; height: 100dvh; max-height: none; border-radius: 0; }
    .item-picker-header { min-height: 82px; padding: 14px; }
    .item-picker-slot-preview { width: 48px; height: 48px; flex-basis: 48px; }
    .item-picker-slot-hint { display: none; }
    .item-picker-body { padding: 0; display: grid; grid-template-columns: 1fr; grid-template-rows: minmax(0,1fr); }
    .item-picker-sidebar { padding: 10px 12px; gap: 8px; overflow: hidden; border-right: 0; border-bottom: 1px solid rgba(212,175,55,.18); }
    .item-picker-sidebar-title { display: none; }
    .item-picker-context-category { display: none; }
    .item-picker-categories { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
    .item-picker-categories .tab-btn { width: auto; min-height: 36px; flex: 0 0 auto; padding: 0 10px; }
    .item-picker-toggle { min-height: 42px; margin-top: 0; }
    .item-picker-toggle small { display: none; }
    .item-picker-content { padding: 12px 12px 0; }
    .item-picker-toolbar { flex-wrap: wrap; }
    .item-picker-search { width: 100%; flex-basis: 100%; }
    .item-picker-toolbar-toggle { width: 100%; min-height: 42px; flex-basis: 100%; }
    .item-picker-results { grid-template-columns: 1fr; }
    .item-picker-results-head > span { display: none; }
    .item-picker-footer { min-height: 52px; }
    .efficiency-summary-grid { grid-template-columns: 1fr; }
}

/* ADMIN PANEL STYLING OVERRIDES (FIX BUG_1.PNG) */
.form-input, .form-select {
    background: rgba(10, 12, 19, 0.7) !important;
    border: 1px solid var(--border-color) !important;
    color: #ffffff !important;
    padding: 8px 12px !important;
    border-radius: 8px !important;
    font-size: 0.85rem !important;
    outline: none !important;
}

.form-input:focus, .form-select:focus {
    border-color: var(--primary-gold) !important;
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.3) !important;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-sm { padding: 4px 10px; font-size: 0.76rem; }

.btn-primary {
    background: linear-gradient(135deg, #d4af37 0%, #b48811 100%) !important;
    border: none !important;
    color: #000000 !important;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid var(--border-subtle) !important;
    color: #cbd5e1 !important;
}

.btn-gold {
    background: rgba(212, 175, 55, 0.15) !important;
    border: 1px solid var(--primary-gold) !important;
    color: var(--primary-gold) !important;
}

.btn-outline {
    background: rgba(19, 23, 34, 0.5) !important;
    border: 1px solid var(--border-subtle) !important;
    color: #cbd5e1 !important;
}

.btn-outline:hover {
    border-color: var(--primary-gold) !important;
    color: var(--primary-gold) !important;
}

.btn-action-edit {
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid #3b82f6;
    color: #60a5fa;
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-action-del {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid #ef4444;
    color: #f87171;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* STRICT GLOBAL LINK STYLING - PREVENT UNSTYLED LINKS */
a, a:visited, a:hover, a:active {
    text-decoration: none !important;
    color: inherit;
}

.nav-links a.nav-item {
    color: var(--text-sub) !important;
    text-decoration: none !important;
    font-size: 0.88rem !important;
    font-weight: 600 !important;
    padding: 6px 14px !important;
    border-radius: 8px !important;
    transition: all 0.2s ease !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
}

.nav-links a.nav-item.active, .nav-links a.nav-item:hover {
    color: var(--primary-gold) !important;
    background: rgba(212, 175, 55, 0.12) !important;
    border: 1px solid rgba(212, 175, 55, 0.3) !important;
}
/* Character systems: collections, item skills and dual replacement economics */
.collection-entry-bonus,.collection-picker-bonus{display:flex;flex-direction:column;gap:4px;color:var(--text-sub);line-height:1.45;overflow-wrap:anywhere}
.collection-entry-bonus{margin:10px 0;padding:10px 12px;border:1px solid rgba(212,175,55,.2);border-radius:9px;background:rgba(212,175,55,.06)}
.collection-entry-bonus strong{color:var(--gold-light);font-size:.75rem;text-transform:uppercase;letter-spacing:.05em}
.collection-picker-bonus{width:100%;font-size:.78rem;color:#e5e7eb}
.item-skills-panel{padding:18px;border:1px solid var(--border-color);border-radius:14px;background:rgba(10,12,19,.72)}
.item-skills-columns{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin-top:16px}
.item-skills-columns>article{min-width:0;padding:12px;border:1px solid var(--border-subtle);border-radius:11px;background:rgba(0,0,0,.25)}
.item-skills-columns h4{margin:0 0 10px;color:var(--primary-gold);font-size:.9rem}
.item-skills-list{display:flex;flex-direction:column;gap:8px}
.item-skill-item-group{overflow:hidden;border:1px solid rgba(212,175,55,.18);border-radius:9px;background:rgba(255,255,255,.025)}
.item-skill-item-group>summary{margin:0;padding:8px 10px;display:flex;align-items:center;gap:8px;border-bottom:1px solid transparent;background:rgba(212,175,55,.055);color:#fff;cursor:pointer;font-size:.78rem;font-weight:750;line-height:1.35;list-style:none}.item-skill-item-group>summary::-webkit-details-marker{display:none}.item-skill-item-group>summary:before{content:'›';flex:0 0 auto;color:var(--primary-gold);font-size:1rem;line-height:1;transform:rotate(0);transition:transform .16s ease}.item-skill-item-group[open]>summary:before{transform:rotate(90deg)}.item-skill-item-group[open]>summary{border-bottom-color:rgba(212,175,55,.14)}.item-skill-item-group>summary span{min-width:0;flex:1}.item-skill-item-group>summary small{min-width:22px;padding:2px 6px;border-radius:999px;background:rgba(212,175,55,.13);color:var(--gold-light);font-size:.58rem;text-align:center}.item-skill-item-group>summary:hover{background:rgba(212,175,55,.1)}
.item-skill-group-list{display:grid;gap:1px}
.item-skill-entry{width:100%;min-width:0;padding:8px 10px;display:flex;align-items:center;justify-content:space-between;gap:8px;border:0;border-bottom:1px solid rgba(255,255,255,.035);background:rgba(0,0,0,.14);color:inherit;text-align:left;cursor:help;font:inherit;font-size:.78rem;line-height:1.45}
.item-skill-entry:last-child{border-bottom:0}.item-skill-entry:hover,.item-skill-entry:focus-visible{background:rgba(212,175,55,.09);outline:none}.item-skill-entry strong{min-width:0;color:#f8fafc;font-size:.76rem;overflow-wrap:anywhere}.item-skill-entry span{flex:0 0 auto;color:var(--text-muted);font-size:.6rem}
.item-skill-tooltip{position:fixed;z-index:6200;width:min(360px,calc(100vw - 24px));padding:12px;display:none;gap:11px;border:1px solid rgba(212,175,55,.4);border-radius:11px;background:rgba(7,9,14,.98);box-shadow:0 16px 44px rgba(0,0,0,.78);pointer-events:none}.item-skill-tooltip.active{display:flex}.item-skill-tooltip-icon{width:48px;height:48px;flex:0 0 48px;border:1px solid rgba(212,175,55,.34);border-radius:8px;background:#030509;object-fit:cover}.item-skill-tooltip-copy{min-width:0}.item-skill-tooltip-copy strong,.item-skill-tooltip-copy small,.item-skill-tooltip-copy p{display:block}.item-skill-tooltip-copy strong{color:#fff;font-size:.82rem;line-height:1.35}.item-skill-tooltip-copy small{margin-top:2px;color:var(--primary-gold);font-size:.62rem;line-height:1.35}.item-skill-tooltip-copy p{margin:7px 0 0;color:var(--text-sub);font-size:.72rem;line-height:1.55;white-space:pre-line;overflow-wrap:anywhere}
.item-skill-trigger-details{display:grid;gap:9px;margin-top:9px}.item-skill-trigger-details[hidden]{display:none}.item-skill-trigger-details>div{padding-top:8px;border-top:1px solid rgba(255,255,255,.08)}.item-skill-trigger-details b{display:block;color:var(--primary-gold);font-size:.62rem;line-height:1.35}.item-skill-trigger-details p{margin-top:3px}
.item-skill-tooltip [hidden]{display:none!important}
.item-skills-empty{color:var(--text-muted);font-size:.8rem}
.progress-stats-summary{margin:0 0 14px;padding:11px 12px;border:1px solid rgba(59,130,246,.2);border-radius:10px;background:rgba(59,130,246,.055)}
.progress-stats-summary>strong{display:block;margin-bottom:9px;color:#bfdbfe;font-size:.75rem;text-transform:uppercase;letter-spacing:.05em}
.progress-stats-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px 12px}
.progress-stats-grid span{display:flex;justify-content:space-between;gap:8px;font-size:.76rem}.progress-stats-grid small{color:var(--text-sub)}.progress-stats-grid b{color:#10b981}
.replacement-name-enchant{display:inline-flex;margin-right:0;padding:2px 5px;border-radius:4px;background:#d59c17;color:#16110a;font-style:normal;font-size:.61rem;line-height:1.15}
.replacement-rank-title{display:flex!important;align-items:flex-start;justify-content:flex-start;gap:7px;min-width:0}
.replacement-rank-title .replacement-name-enchant{flex:0 0 auto;margin-right:0;margin-top:1px}
.replacement-rank-title .replacement-rank-item-name{display:block;min-width:0;text-align:left;overflow-wrap:anywhere}
.replacement-rank-title .replacement-rank-item-name .item-enchant-prefix{display:inline-block!important;margin-right:.28em}
.replacement-rank-title .replacement-rank-item-name .item-name-primary,.replacement-rank-title .replacement-rank-item-name .item-name-secondary{display:inline!important}
.replacement-direction-gain{min-width:0;margin-top:auto;padding:5px 6px;display:flex;align-items:center;justify-content:space-between;gap:7px;border:1px solid rgba(52,211,153,.2);border-radius:6px;background:rgba(16,185,129,.07)}
.replacement-direction-gain small{min-width:0;color:#fff;font-size:13px;font-weight:600;line-height:1.25}.replacement-direction-gain strong{flex:0 0 auto;color:#34d399;font-size:13px;font-weight:800;white-space:nowrap}
.replacement-cost.dual{margin-top:0;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:5px;min-width:0}
.replacement-cost.dual.single{grid-template-columns:1fr}
.replacement-cost.dual .replacement-price-option{min-width:0;margin:0;display:flex;flex-direction:column;gap:2px;padding:6px;border-radius:6px;background:rgba(0,0,0,.24)}
.replacement-cost.dual small{color:var(--text-muted);font-size:9px;line-height:1.25;text-transform:none}.replacement-cost.dual strong{overflow-wrap:anywhere;font-size:10px;line-height:1.3;white-space:normal}.replacement-cost.dual em{color:var(--gold-light);font-size:9px;font-style:normal;line-height:1.3;white-space:normal}
.weapon-base-parameter-row small em{color:#38c975;font-style:normal}
@media(max-width:1100px){.item-skills-columns{grid-template-columns:1fr}}

/* Collection sections and compact single-row character navigation */
.character-system-tabs{display:flex;flex-wrap:nowrap;overflow-x:auto;scrollbar-width:thin}
.character-system-tab{flex:1 0 112px;white-space:normal}
.collection-section-tabs{display:flex;gap:7px;margin:-3px 0 13px;padding-bottom:3px;overflow-x:auto;scrollbar-width:thin}
.collection-section-tabs[hidden]{display:none}
.collection-section-tabs button{flex:0 0 auto;padding:7px 10px;border:1px solid rgba(129,140,248,.25);border-radius:999px;background:rgba(79,70,229,.07);color:#a5b4fc;cursor:pointer;font:inherit;font-size:.72rem;font-weight:750}
.collection-section-tabs button span{margin-left:4px;color:var(--text-muted);font-size:.66rem}
.collection-section-tabs button:hover,.collection-section-tabs button.active{border-color:rgba(165,180,252,.62);background:rgba(79,70,229,.22);color:#fff}
.collection-picker-bonus{padding:7px 9px;border-left:3px solid #818cf8;border-radius:5px;background:rgba(99,102,241,.09);color:#fff;font-size:.9rem;font-weight:700;line-height:1.5}
.build-icon{flex:0 0 28px;overflow:hidden}
.build-icon img{display:block;width:100%;height:100%;object-fit:cover;object-position:center;border-radius:inherit}
.my-build-card .build-info{min-width:0;overflow:hidden}
.my-build-card .build-info .title,.my-build-card .build-info .sub{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
/* Admin-controlled visibility and calculation status. These switches only
   change presentation; the underlying build data remains intact. */
.project-hide-replacements .replacement-summary-under-constructor {
    display: none !important;
}

.project-hide-characteristics .right-stats-panel {
    display: none !important;
}

.project-hide-equipment-effects .active-sets-box {
    display: none !important;
}

.project-hide-calculation-status .calculation-status-pill {
    display: none !important;
}

.calculation-model-badge {
    margin-left: 7px;
    padding: 3px 6px;
    border: 1px solid rgba(20, 181, 160, .48);
    border-radius: 999px;
    background: rgba(20, 181, 160, .09);
    color: #42d8c5;
    font-size: 8px;
    font-weight: 800;
    letter-spacing: .04em;
    vertical-align: middle;
    white-space: nowrap;
}

/* 2026 responsive and interaction pass */
#auth-modal{z-index:4300}#character-editor-modal,#character-code-modal,.onboarding-backdrop{z-index:4500}#message-modal{z-index:5200}.password-reset-backdrop{z-index:5400}
body.project-locked #auth-modal { z-index: 20000 !important; }
body.project-locked #message-modal { z-index: 20010 !important; }
.sidebar-qr-banner{margin-top:16px;overflow:hidden;border:1px solid rgba(212,175,55,.25);border-radius:10px;background:rgba(4,7,12,.5)}.sidebar-qr-banner>summary{padding:10px 11px;display:flex;align-items:center;justify-content:space-between;gap:8px;color:#f5e6b0;font-size:.72rem;font-weight:800;cursor:pointer;list-style:none}.sidebar-qr-banner>summary::-webkit-details-marker{display:none}.sidebar-qr-banner>summary i{transition:transform .18s ease}.sidebar-qr-banner[open]>summary i{transform:rotate(180deg)}.sidebar-qr-banner>div{padding:0 12px 12px;display:grid;gap:8px;text-align:center}.sidebar-qr-banner img{width:100%;aspect-ratio:1;object-fit:contain;border-radius:8px;background:#fff}.sidebar-qr-banner small{color:var(--text-muted);font-size:.62rem;line-height:1.4}
.profession-onboarding-dialog{width:min(900px,calc(100vw - 28px));max-height:min(820px,92vh)}.profession-tile-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;max-height:68vh;overflow-y:auto}.profession-tile{min-width:0;padding:9px;display:grid;gap:6px;border:1px solid var(--border-subtle);border-radius:11px;background:rgba(12,16,25,.75);color:inherit;text-align:left;cursor:pointer}.profession-tile:hover{border-color:var(--primary-gold);background:rgba(212,175,55,.09);transform:translateY(-1px)}.profession-tile-image{aspect-ratio:3/4;overflow:hidden;border-radius:8px;background:#05070c}.profession-tile-image img{width:100%;height:100%;object-fit:cover;object-position:top center}.profession-tile strong{overflow:hidden;color:#fff;font-size:.75rem;text-overflow:ellipsis;white-space:nowrap}.profession-tile small{color:var(--text-muted);font-size:.62rem}
.characteristics-card{position:relative;overflow:hidden}.calculation-card-title{justify-content:center!important;text-align:center}.calculation-card-title>span:first-child{width:100%}.characteristics-update-overlay{position:absolute;inset:0;z-index:40;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:9px;background:rgba(5,8,14,.35);color:#fff}.characteristics-update-overlay[hidden]{display:none}.characteristics-update-overlay strong{font-size:.82rem;letter-spacing:.04em}
.constructor-header-card{min-width:0}.constructor-selectors{min-width:0;flex-wrap:nowrap!important;overflow-x:auto;overscroll-behavior-x:contain;scrollbar-width:thin;justify-content:flex-end}.constructor-selectors>.selector-group,.constructor-selectors>.constructor-pvp-toggles{flex:0 0 auto}.constructor-selectors label,.constructor-selectors select{white-space:nowrap}#boost-direction-select{min-width:190px}
.slot-unequip-btn img{display:block!important;position:static!important;width:16px!important;height:16px!important;object-fit:contain!important;border-radius:0!important}.doll-slot .slot-unequip-btn,.special-parent-slot .slot-unequip-btn{width:20px;height:20px;padding:0;border:0;background:transparent!important;box-shadow:none!important}
.comp-item-attachments{margin:-4px 0 12px;display:grid;gap:8px}.comp-item-attachments[hidden]{display:none}.comp-item-attachments section{padding:8px;border:1px solid rgba(255,255,255,.08);border-radius:8px;background:rgba(0,0,0,.18)}.comp-item-attachments section>header{margin-bottom:6px;color:#b8c3d4;font-size:10px;font-weight:750;letter-spacing:.035em}.comp-item-attachments section>div{display:flex;align-items:center;flex-wrap:wrap;gap:6px}.comp-attachment-entry{width:38px;height:38px;padding:3px;display:grid;place-items:center;border:1px solid rgba(59,130,246,.28);border-radius:7px;background:rgba(59,130,246,.055);color:inherit;cursor:pointer}.comp-attachment-entry:hover{border-color:rgba(96,165,250,.62);background:rgba(59,130,246,.11)}.comp-attachment-entry.special{border-color:rgba(244,114,182,.28);background:rgba(244,114,182,.05)}.comp-attachment-entry.enchant{border-color:color-mix(in srgb,var(--enchantment-effect-color) 38%,transparent);background:color-mix(in srgb,var(--enchantment-effect-color) 7%,transparent)}.comp-attachment-entry.enchant.chaos{border-color:rgba(168,85,247,.48);background:rgba(126,34,206,.10)}.comp-attachment-entry.enchant:hover{border-color:color-mix(in srgb,var(--enchantment-effect-color) 70%,transparent)}.comp-attachment-entry.filled{box-shadow:inset 0 0 0 1px rgba(52,211,153,.8)}.comp-attachment-icon{position:relative;width:30px;height:30px;overflow:hidden;border-radius:5px;background:#05070b}.comp-attachment-icon>img,.comp-attachment-icon>.item-icon-composite,.comp-attachment-icon .item-icon-composite>img{width:100%!important;height:100%!important;margin:0!important;border:0!important;object-fit:cover!important}
.equipment-linked-effect{margin-top:8px;padding:9px;border:1px solid rgba(139,92,246,.28);border-radius:8px;background:rgba(124,58,237,.07)}.equipment-linked-effect header{display:flex;align-items:center;justify-content:space-between;gap:8px}.equipment-linked-effect header strong{color:#ddd6fe;font-size:.68rem}.equipment-linked-effect header span{color:#6ee7b7;font-size:.58rem;font-weight:800}.equipment-linked-effect.inactive{opacity:.62;border-style:dashed}.equipment-linked-effect.inactive header span{color:#fbbf24}.equipment-linked-effect p{white-space:pre-line}
.equipment-effect-item.soul-effect-block{border-color:color-mix(in srgb,var(--soul-effect-color) 58%,transparent);background:color-mix(in srgb,var(--soul-effect-color) 9%,transparent)}.equipment-effect-item.enchantment-effect-block{border-color:color-mix(in srgb,var(--enchantment-effect-color) 58%,transparent);background:color-mix(in srgb,var(--enchantment-effect-color) 9%,transparent)}.soul-effect-block .equipment-effect-status{color:var(--soul-effect-color)}.enchantment-effect-block .equipment-effect-status{color:var(--enchantment-effect-color)}
.item-attachment-effect-section{padding:9px!important;border-radius:8px}.item-attachment-effect-section.soul{border-color:color-mix(in srgb,var(--soul-effect-color) 55%,transparent)!important;background:color-mix(in srgb,var(--soul-effect-color) 9%,transparent)}.item-attachment-effect-section.enchantment{border-color:color-mix(in srgb,var(--enchantment-effect-color) 55%,transparent)!important;background:color-mix(in srgb,var(--enchantment-effect-color) 9%,transparent)}.item-attachment-effect-section .item-detail-lines>div{display:grid;gap:2px}.item-attachment-effect-section .item-detail-lines strong{color:#fff;font-size:.68rem}.item-attachment-effect-section .item-detail-lines span{color:var(--text-sub);font-size:.64rem;line-height:1.4;white-space:pre-line}
.item-attachment-effect-section.relation-description-effect{border-color:color-mix(in srgb,var(--conditional-effect-color) 55%,transparent)!important;background:color-mix(in srgb,var(--conditional-effect-color) 9%,transparent)}.item-attachment-effect-section.relation-description-effect .item-detail-lines span{color:var(--conditional-effect-color)}.item-attachment-effect-section.relation-description-effect .relation-description-copy{padding-bottom:6px}.item-attachment-effect-section.relation-description-effect .relation-effect-line{display:flex;align-items:flex-start;gap:6px;padding-top:5px;border-top:1px solid color-mix(in srgb,var(--conditional-effect-color) 23%,transparent);line-height:1.42}.item-attachment-effect-section.relation-description-effect .relation-effect-line .item-detail-marker{color:var(--conditional-effect-color);flex:0 0 auto}.item-attachment-effect-section.relation-description-effect .relation-effect-line strong{color:var(--conditional-effect-color);font-weight:700}

@media(max-width:1500px){.main-content{padding:20px}.right-stats-panel{flex-basis:310px;width:310px;min-width:310px}.constructor-header-card{align-items:flex-start;flex-direction:column;gap:12px}.constructor-selectors{width:100%;justify-content:flex-start}}
@media(max-width:1180px){.workspace-grid{display:grid;grid-template-columns:minmax(0,1fr)}.right-stats-panel{width:100%;min-width:0}.equipment-with-character-layout{overflow-x:auto;justify-content:flex-start!important}.right-stats-panel .card-panel{width:100%;box-sizing:border-box}.replacement-top-five{padding-bottom:12px}}
@media(max-width:900px){.profession-tile-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.constructor-title{white-space:nowrap}.constructor-selectors{padding-bottom:5px}.character-system-tab{flex:0 0 auto;white-space:nowrap}.modal-box{max-width:calc(100vw - 20px)}}
@media(max-width:720px){.sidebar-qr-banner{display:none}.constructor-header-card{padding:13px}.constructor-selectors{display:flex;gap:10px}.selector-group{flex-direction:column;align-items:flex-start;gap:4px}.constructor-pvp-toggles{align-items:flex-end}.equipment-with-character-layout{padding-bottom:8px}.left-hero-column{flex-basis:240px!important;width:240px!important;min-width:240px!important}.fullbody-character-card{min-height:390px!important}.equipment-grid-wrap{flex-basis:280px!important}.profession-tile-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.card-panel{padding:14px}.replacement-summary-heading{align-items:flex-start;flex-direction:column;gap:7px}.right-stats-panel{gap:12px}}
@media(max-width:480px){.victory-header-side{justify-content:space-between}.victory-header .btn-hero-secondary{font-size:.58rem}.profession-tile-grid{gap:8px}.profession-onboarding-dialog .modal-body{padding:12px}.main-content{padding:10px 6px}.constructor-header-card{border-radius:9px}.left-hero-column{flex-basis:220px!important;width:220px!important;min-width:220px!important}.character-system-tabs{gap:5px}.character-system-tab{min-width:100px;padding-inline:8px}.base-stats-compact-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}}

/* Complete responsive matrix: phone, tablet, laptop, Full HD, 2K and 4K. */
.app-layout,.main-content,.workspace-grid,.center-workspace,.character-system-panel,
.l2-equipment-card,.equipment-with-character-layout,.equipment-grid-wrap,.right-hero-column {
    min-width: 0;
    box-sizing: border-box;
}
.main-content {
    width: 100%;
    max-width: 2400px;
    margin-inline: auto;
}
.character-system-tabs {
    display: flex !important;
    grid-template-columns: none !important;
    flex-wrap: nowrap !important;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
}
.character-system-tab {
    min-width: 132px;
    flex: 1 0 132px;
    white-space: nowrap;
}

@media (min-width: 2560px) {
    html { font-size: 17px; }
    .main-content { padding: 32px 42px; }
    .workspace-grid { gap: 26px; }
    .right-stats-panel { width: 380px; min-width: 380px; flex-basis: 380px; }
    .l2-equipment-card { padding: 22px !important; }
    .replacement-rank-card { min-width: 246px; }
}

@media (max-width: 1750px) and (min-width: 761px) {
    .equipment-with-character-layout {
        display: grid !important;
        grid-template-columns: 300px minmax(280px, 1fr) !important;
        align-items: stretch !important;
        justify-content: stretch !important;
        gap: 14px !important;
        overflow: visible !important;
    }
    .left-hero-column {
        width: 300px !important;
        min-width: 300px !important;
        max-width: 300px !important;
        flex-basis: 300px !important;
    }
    .equipment-grid-wrap {
        width: 100% !important;
        min-width: 280px !important;
        flex-basis: auto !important;
    }
    .right-hero-column {
        grid-column: 1 / -1;
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
        min-height: 360px !important;
        max-height: min(520px, 52vh) !important;
        flex-basis: auto !important;
    }
}

@media (max-width: 2200px) {
    .constructor-header-card {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }
    .constructor-selectors {
        display: grid !important;
        grid-template-columns: minmax(250px,1.15fr) minmax(145px,.55fr) minmax(250px,1fr) minmax(290px,1.15fr);
        width: 100%;
        align-items: center;
        overflow: visible;
        justify-content: flex-start;
    }
    .constructor-selectors > .selector-group { min-width: 0; }
    .constructor-selectors > .constructor-pvp-toggles { grid-column: 1 / -1; }
}

@media (max-width: 1500px) {
    .constructor-selectors {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: center;
        gap: 10px 16px;
        overflow: visible;
        padding-bottom: 0;
    }
    .constructor-selectors > .selector-group {
        min-width: 0;
        justify-content: space-between;
    }
    .constructor-selectors > .selector-group select,
    .constructor-selectors > .selector-group input {
        min-width: 0;
        max-width: 100%;
    }
    .constructor-selectors > .constructor-pvp-toggles {
        grid-column: 1 / -1;
        min-width: 0;
        flex-wrap: wrap;
    }
}

@media (max-width: 1180px) {
    .workspace-grid {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
    }
    .right-stats-panel {
        width: 100%;
        min-width: 0;
        flex-basis: auto;
    }
    .equipment-with-character-layout { overflow: visible; }
    .right-stats-panel .card-panel { width: 100%; box-sizing: border-box; }
}

@media (max-width: 1180px) {
    .victory-header { position: relative; }
    .app-layout { min-height: 0; display: block; }
    .sidebar {
        position: sticky;
        top: 0;
        z-index: 900;
        width: 100%;
        height: auto;
        padding: 8px 10px;
        overflow-x: auto;
        overflow-y: hidden;
        border-right: 0;
        border-bottom: 1px solid var(--border-subtle);
        scrollbar-width: thin;
    }
    .sidebar-group-title,.my-builds-list,.btn-create-build-side,.sidebar-qr-banner { display: none; }
    .sidebar-menu { display: flex; gap: 6px; width: max-content; min-width: 100%; }
    .sidebar-item { flex: 0 0 auto; margin: 0; padding: 8px 11px; white-space: nowrap; }
    .main-content { padding: 18px 14px; }
    .constructor-header-card { padding: 14px; }
    .constructor-selectors { justify-content: flex-start; }
    .item-skills-columns { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
    body { background-attachment: scroll; }
    .victory-header {
        padding: 12px;
        align-items: stretch;
        flex-direction: column;
        gap: 9px;
    }
    .victory-header-content { width: 100%; }
    .victory-header .hero-title { overflow: hidden; font-size: clamp(.82rem, 4vw, 1.08rem); text-overflow: ellipsis; }
    .victory-header-side { width: 100%; margin: 0; justify-content: space-between; gap: 7px; }
    .victory-header-side .hero-buttons { min-width: 0; }
    .victory-header .btn-hero-primary,.victory-header .btn-hero-secondary { min-height: 36px; padding: 7px 9px; }
    .victory-header .user-profile-badge { min-height: 36px; }
    .sidebar { padding: 7px 8px; }
    .sidebar-item span { display: inline; }
    .main-content { padding: 10px 7px; }
    .constructor-header-card { gap: 9px; margin-bottom: 10px; }
    .constructor-title { font-size: .9rem; }
    .constructor-selectors { gap: 8px 10px; padding-bottom: 4px; }
    .constructor-selectors .select-dark,#boost-direction-select { min-width: 156px; max-width: 220px; }
    #character-budget-input { width: 150px !important; }
    .character-system-tabs { margin-bottom: 10px; gap: 5px; }
    .character-system-tab { min-width: 118px; flex-basis: 118px; padding-inline: 9px; }
    .l2-equipment-card { padding: 10px !important; border-radius: 11px; }
    .equipment-with-character-layout {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important;
        justify-items: center !important;
        gap: 10px !important;
        overflow: visible !important;
    }
    .left-hero-column {
        width: min(100%, 340px) !important;
        min-width: 0 !important;
        max-width: 340px !important;
        flex-basis: auto !important;
    }
    .fullbody-character-card { height: 400px !important; min-height: 400px !important; }
    .equipment-grid-wrap {
        width: 100% !important;
        min-width: 0 !important;
        flex-basis: auto !important;
        overflow-x: auto;
        justify-content: center !important;
        padding: 4px 0 7px;
    }
    .right-hero-column {
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
        min-height: 360px !important;
        max-height: min(480px, 56vh) !important;
        flex-basis: auto !important;
    }
    .active-sets-box { width: 100%; box-sizing: border-box; }
    .replacement-summary-under-constructor { margin-top: 12px; }
    .replacement-summary-heading { padding: 10px 12px; }
    .replacement-top-five { padding: 6px; }
    .replacement-rank-card { min-width: min(224px, calc(100vw - 34px)); }
    .modal-overlay,.modal-backdrop { padding: 6px; }
    .modal-box,.profession-onboarding-dialog { width: calc(100vw - 12px); max-width: none; max-height: calc(100dvh - 12px); }
    .profession-tile-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .item-skill-tooltip { width: calc(100vw - 16px); }
    .progress-stats-grid,.base-stats-compact-grid { grid-template-columns: repeat(2,minmax(0,1fr)) !important; }
}

@media (max-width: 520px) {
    .victory-header-side { overflow-x: auto; justify-content: flex-start; scrollbar-width: none; }
    .victory-header-side::-webkit-scrollbar { display: none; }
    .sidebar-menu { min-width: max-content; }
    .sidebar-item { padding: 7px 9px; font-size: .72rem; }
    .constructor-selectors { grid-template-columns: minmax(0,1fr); }
    .constructor-selectors > .constructor-pvp-toggles { grid-column: auto; display: grid; grid-template-columns: 1fr; }
    .constructor-selectors > .selector-group { align-items: stretch; }
    .constructor-selectors .select-dark,#boost-direction-select { width: 100%; max-width: none; }
    #character-budget-input { width: 100% !important; }
    .equipment-grid-wrap { justify-content: flex-start !important; }
    .authentic-doll-grid {
        grid-template-columns: repeat(3, 62px);
        grid-template-rows: repeat(5, 62px);
        gap: 7px;
    }
    .doll-slot { width: 62px; height: 62px; border-radius: 8px; }
    .doll-slot.mini { width: 42px; height: 42px; }
    .l2-equipment-inner { gap: 7px !important; }
    .left-spirit-stack { gap: 6px !important; }
    .slot-label { max-width: 58px; overflow: hidden; font-size: .54rem; text-overflow: ellipsis; white-space: nowrap; }
    .fullbody-character-card { height: 360px !important; min-height: 360px !important; }
    .profession-tile-grid { gap: 7px; }
    .profession-onboarding-dialog .modal-body { padding: 10px; }
    .progress-stats-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 360px) {
    .main-content { padding-inline: 4px; }
    .authentic-doll-grid {
        grid-template-columns: repeat(3, 58px);
        grid-template-rows: repeat(5, 58px);
        gap: 5px;
    }
    .doll-slot { width: 58px; height: 58px; }
    .doll-slot.mini { width: 38px; height: 38px; }
    .slot-label { max-width: 54px; font-size: .5rem; }
    .card-panel { padding: 11px; }
}

/* Equipment sub-slots: game-style shared stage and artifact book. */
.equipment-grid-wrap {
    --equipment-primary-width: 252px;
    width: 312px !important;
    min-width: 312px !important;
    flex: 0 0 312px !important;
    display: grid !important;
    grid-template-columns: 48px var(--equipment-primary-width);
    grid-template-rows: auto;
    align-content: center;
    align-items: start !important;
    justify-content: center !important;
    gap: 10px 12px;
    overflow: visible !important;
}
.equipment-core-row { display: contents !important; }
.equipment-primary-column {
    grid-column: 2;
    grid-row: 1;
    width: var(--equipment-primary-width);
    min-width: 0;
    display: grid;
    justify-items: center;
    gap: 11px;
}
.equipment-grid-wrap .left-spirit-stack {
    grid-column: 1;
    grid-row: 1;
    align-self: center;
    justify-self: end;
    margin: 0 !important;
}
.special-slot-stage {
    grid-column: auto;
    grid-row: auto;
    width: var(--equipment-primary-width);
    min-width: 0;
    box-sizing: border-box;
    padding: 6px;
    overflow: hidden;
    border: 1px solid rgba(212,175,55,.3);
    border-radius: 10px;
    background: linear-gradient(180deg,rgba(20,23,31,.96),rgba(7,9,14,.92));
    box-shadow: inset 0 0 22px rgba(212,175,55,.035),0 8px 20px rgba(0,0,0,.24);
}
.special-inline-panels { min-height: 38px; }
.special-submenu-popover.special-inline-panel,
.special-submenu-popover.special-inline-panel.active {
    position: static;
    inset: auto;
    width: 100%;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 0;
    grid-template-columns: repeat(var(--special-slot-columns,6),minmax(0,36px));
    justify-content: center;
    gap: 5px;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
}
.special-submenu-popover.special-inline-panel { display: none; }
.special-submenu-popover.special-inline-panel.active { display: grid; }
:is(#menu-seed,#luck-menu-seed).special-inline-panel,
:is(#menu-seed,#luck-menu-seed).special-inline-panel.active {
    grid-template-columns: 36px minmax(0,1fr) repeat(4,36px);
    justify-content: stretch;
}
:is(#menu-seed,#luck-menu-seed) [data-slot-id="agathion_main"] { grid-column: 1; }
:is(#menu-seed,#luck-menu-seed) [data-slot-id="agathion1"] { grid-column: 3; }
:is(#menu-seed,#luck-menu-seed) [data-slot-id="agathion2"] { grid-column: 4; }
:is(#menu-seed,#luck-menu-seed) [data-slot-id="agathion3"] { grid-column: 5; }
:is(#menu-seed,#luck-menu-seed) [data-slot-id="agathion4"] { grid-column: 6; }
.special-submenu-popover.special-inline-panel > .doll-slot {
    width: 36px;
    height: 36px;
    border-radius: 7px;
    background: rgba(3,5,9,.82);
    box-shadow: inset 0 0 10px rgba(255,255,255,.025);
}
.special-submenu-popover.special-inline-panel > .doll-slot:hover {
    transform: translateY(-1px);
}
.special-inline-panel .doll-slot .item-icon-secondary-badge {
    top: auto;
    right: auto;
    bottom: 1px;
    left: 1px;
    min-width: 0;
    height: 12px;
    padding: 0 3px;
    border-radius: 3px;
    font-size: 8px;
    line-height: 10px;
}
.special-inline-panel .doll-slot .slot-unequip-btn {
    top: 1px;
    right: 1px;
    width: 13px;
    height: 13px;
    transform: none;
}
.special-inline-panel .doll-slot .slot-unequip-btn img {
    width: 10px !important;
    height: 10px !important;
}
.special-inline-panel .doll-slot .slot-unequip-btn:hover { transform: scale(1.08); }
.special-submenu-popover.special-inline-panel .special-submenu-empty {
    max-width: none;
    padding: 5px 4px 1px;
    font-size: .52rem;
}
.equipment-special-access {
    width: var(--equipment-primary-width);
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}
.special-tabs-row {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(4,56px);
    justify-content: space-between;
    gap: 9px;
}
.special-parent-slot {
    width: 56px;
    height: 56px;
    border-radius: 9px;
    background: rgba(7,9,14,.7);
}
.special-parent-slot.active {
    border-color: #f1c85a;
    box-shadow: inset 0 0 0 1px rgba(255,226,138,.38),0 0 0 2px rgba(212,175,55,.14),0 0 18px rgba(212,175,55,.28);
    transform: translateY(-2px);
}
.special-parent-slot.active::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 19;
    border-radius: inherit;
    background: var(--selected-special-parent-frame,none) center/100% 100% no-repeat;
    pointer-events: none;
}
.special-tabs-row:not(.has-selected-special-parent-frame) .special-parent-slot.active::after { display: none; }
.special-tabs-row.has-selected-special-parent-frame .special-parent-slot.active {
    border-color: transparent;
    box-shadow: 0 0 0 1px rgba(212,175,55,.16),0 0 18px rgba(212,175,55,.24);
}
.special-instruction-text {
    width: 100%;
    margin: 7px 0 0;
    display: grid;
    justify-items: center;
    gap: 2px;
    text-align: center;
    white-space: normal;
}
.special-instruction-text strong { color: var(--text-sub); font-size: .54rem; }
.special-instruction-text span { color: var(--text-muted); font-size: .48rem; line-height: 1.35; }

.artifact-book-overlay-container {
    position: fixed;
    inset: 0;
    z-index: 3900;
    pointer-events: none;
}
.artifact-book-overlay-container.is-docked {
    inset: auto;
    pointer-events: none;
}
.artifact-book-overlay-container.is-docked .artifact-blocks-popover {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    padding: 0 !important;
    display: none;
    overflow: hidden;
    place-items: stretch;
    background: transparent !important;
    backdrop-filter: none;
    pointer-events: auto;
}
.artifact-book-overlay-container.is-docked .artifact-blocks-popover.active {
    display: block;
}
.artifact-book-overlay-container.is-docked .artifact-book-dialog,
.artifact-book-overlay-container.is-docked .artifact-book-board {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    aspect-ratio: auto;
}
.artifact-book-overlay-container.is-docked .artifact-book-dialog {
    display: block;
}
.artifact-blocks-popover {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100dvh;
    max-width: none;
    max-height: none;
    box-sizing: border-box;
    margin: 0;
    padding: 18px !important;
    grid-template-columns: minmax(0,1fr);
    grid-template-rows: minmax(0,1fr);
    justify-content: stretch;
    align-content: stretch;
    place-items: center;
    overflow-y: auto;
    border: 0 !important;
    border-radius: 0;
    background: rgba(0,0,0,.82) !important;
    backdrop-filter: blur(9px);
    box-shadow: none;
    pointer-events: auto;
}
.artifact-blocks-popover.active { display: grid; }
.artifact-book-dialog {
    position: relative;
    width: min(420px,calc(100vw - 24px));
    max-height: calc(100dvh - 24px);
    padding: 0;
    display: grid;
    grid-template-rows: minmax(0,1fr);
    overflow: hidden;
    justify-self: center;
    align-self: center;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}
.artifact-book-dialog::before,.artifact-book-dialog::after {
    display: none;
}
.artifact-book-dialog::before { top: 4px; left: 4px; border-top: 1px solid; border-left: 1px solid; }
.artifact-book-dialog::after { right: 4px; bottom: 4px; border-right: 1px solid; border-bottom: 1px solid; }
.artifact-book-dialog .artifact-book-close {
    top: 8px;
    right: 8px;
    width: 31px;
    height: 31px;
    border-radius: 3px;
    background: rgba(8,9,8,.72);
}
.artifact-book-legend {
    position: relative;
    z-index: 4;
    padding: 9px 4px 3px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 5px;
    border-top: 1px solid rgba(186,149,75,.25);
}
.artifact-book-legend span { padding: 3px 6px; border: 1px solid rgba(255,255,255,.1); color: #aba99f; font-size: .5rem; }
.artifact-book-legend .attack { color: #ed6b6b; }.artifact-book-legend .defense { color: #93b9ed; }.artifact-book-legend .support { color: #9bcda8; }.artifact-book-legend .balance { color: #d9bd79; }
body.artifact-book-open { overflow: hidden; }

@media (max-width: 760px) {
    .equipment-grid-wrap {
        width: 312px !important;
        min-width: 0 !important;
        flex-basis: auto !important;
        justify-self: center;
        overflow: visible;
    }
}
@media (max-width: 520px) {
    .equipment-grid-wrap {
        --equipment-primary-width: 200px;
        width: 249px !important;
        grid-template-columns: 42px var(--equipment-primary-width);
        gap: 8px 7px;
    }
    .special-slot-stage { padding: 5px; }
    .special-submenu-popover.special-inline-panel,
    .special-submenu-popover.special-inline-panel.active { grid-template-columns: repeat(var(--special-slot-columns,6),30px); gap: 4px; }
    :is(#menu-seed,#luck-menu-seed).special-inline-panel,
    :is(#menu-seed,#luck-menu-seed).special-inline-panel.active { grid-template-columns: 30px minmax(0,1fr) repeat(4,30px); }
    .special-submenu-popover.special-inline-panel > .doll-slot { width: 30px; height: 30px; }
    .special-inline-panels { min-height: 30px; }
    .special-tabs-row { grid-template-columns: repeat(4,44px); gap: 8px; }
    .special-parent-slot { width: 44px; height: 44px; border-radius: 7px; }
    .special-instruction-text span { font-size: .45rem; }
    .artifact-blocks-popover { padding: 6px !important; }
    .artifact-book-dialog { width: calc(100vw - 12px); max-height: calc(100dvh - 12px); padding: 0; }
    .artifact-book-board {
        width: min(300px,calc((100dvh - 20px)/2),100%);
        height: auto;
        min-height: 0;
        aspect-ratio: 1/2;
    }
    .artifact-block-card { width: 108px; }
    .artifact-block-card:nth-child(1) { top: 6%; }
    .artifact-block-card:nth-child(2) { bottom: 18%; left: 12.5%; }
    .artifact-block-card:nth-child(3) { right: 12.5%; bottom: 18%; }
    .artifact-book-board .artifact-block-card .row-3-slots { grid-template-columns: repeat(2,45px); grid-template-rows: repeat(2,45px); gap: 5px; }
    .artifact-book-board .row-3-slots .doll-slot { width: 45px; height: 45px; }
    .artifact-book-board .artifact-block-card .row-4-slots { grid-template-columns: repeat(2,32px); grid-template-rows: repeat(2,32px); gap: 4px; }
    .artifact-book-board .row-4-slots .doll-slot { width: 32px; height: 32px; }
}

@media (hover: none), (pointer: coarse) {
    .special-inline-panel .doll-slot.equipped .slot-unequip-btn {
        opacity: .88;
        pointer-events: auto;
    }
}
@media (max-width: 360px) {
    .equipment-grid-wrap {
        --equipment-primary-width: 184px;
        width: 227px !important;
        grid-template-columns: 38px var(--equipment-primary-width);
        gap: 7px 5px;
    }
    .special-submenu-popover.special-inline-panel,
    .special-submenu-popover.special-inline-panel.active { grid-template-columns: repeat(var(--special-slot-columns,6),27px); gap: 4px; }
    :is(#menu-seed,#luck-menu-seed).special-inline-panel,
    :is(#menu-seed,#luck-menu-seed).special-inline-panel.active { grid-template-columns: 27px minmax(0,1fr) repeat(4,27px); }
    .special-submenu-popover.special-inline-panel > .doll-slot { width: 27px; height: 27px; }
    .special-inline-panels { min-height: 27px; }
    .special-tabs-row { grid-template-columns: repeat(4,41px); gap: 6px; }
    .special-parent-slot { width: 41px; height: 41px; }
    .special-instruction-text strong { font-size: .5rem; }
    .artifact-book-board { width: min(286px,calc((100dvh - 20px)/2),100%); }
}

@media (max-height: 720px) {
    .artifact-book-board { width: min(300px,calc((100dvh - 20px)/2),100%); }
    .artifact-block-card { width: 104px; gap: 6px; }
    .artifact-block-card:nth-child(1) { top: 7%; }
    .artifact-block-card:nth-child(2) { bottom: 20%; left: 12.5%; }
    .artifact-block-card:nth-child(3) { right: 12.5%; bottom: 20%; }
    .artifact-book-board .artifact-block-card .row-3-slots { grid-template-columns: repeat(2,42px); grid-template-rows: repeat(2,42px); gap: 4px; }
    .artifact-book-board .row-3-slots .doll-slot { width: 42px; height: 42px; }
    .artifact-book-board .artifact-block-card .row-4-slots { grid-template-columns: repeat(2,30px); grid-template-rows: repeat(2,30px); gap: 4px; }
    .artifact-book-board .row-4-slots .doll-slot { width: 30px; height: 30px; }
}

/* 2026 workspace redesign: priority / analytics / inventory. */
.workspace-redesign .victory-header {
    height: 76px;
    min-height: 76px;
    padding: 10px clamp(18px, 2.5vw, 42px);
    display: grid;
    grid-template-columns: minmax(235px, 1fr) minmax(430px, auto) minmax(235px, 1fr);
    gap: 22px;
    overflow: visible;
    background: linear-gradient(90deg, rgba(18,23,32,.94), rgba(26,32,43,.9) 50%, rgba(18,23,32,.94));
}
.workspace-redesign .victory-header-content { max-width: 310px; }
.workspace-redesign .victory-header .hero-tag { margin-bottom: 2px; color: #b9c2cb; font-size: .58rem; letter-spacing: .14em; text-transform: uppercase; }
.workspace-redesign .victory-header .hero-title { font-size: clamp(.86rem,1.18vw,1.18rem); letter-spacing: -.02em; text-transform: none; }
.victory-product-nav { position: relative; z-index: 2; min-width: 430px; display: flex; align-items: center; justify-content: center; gap: 6px; }
.victory-product-tab { position: relative; min-width: 126px; min-height: 42px; padding: 9px 16px; border: 1px solid transparent; border-radius: 10px; background: transparent; color: #aeb9c5; font: 700 .75rem var(--project-body-font, 'Geoform'),sans-serif; cursor: pointer; white-space: nowrap; transition: color .18s ease, border-color .18s ease, background .18s ease, transform .18s ease; }
.victory-product-tab:hover { color: #fff; background: rgba(255,255,255,.045); transform: translateY(-1px); }
.victory-product-tab.active { border-color: rgba(212,175,55,.42); background: linear-gradient(180deg,rgba(212,175,55,.16),rgba(212,175,55,.06)); color: #ffe9a4; box-shadow: inset 0 -2px 0 rgba(212,175,55,.65),0 8px 25px rgba(0,0,0,.16); }
.workspace-redesign .victory-header-side { margin: 0; justify-self: end; }
.workspace-redesign .victory-header .user-profile-badge { min-height: 42px; }

.workspace-redesign .app-layout { min-height: calc(100vh - 76px); display: grid; grid-template-columns: 340px minmax(0,1fr); align-items: start; }
.workspace-redesign .priority-sidebar { position: sticky; top: 76px; z-index: 20; width: 340px; height: calc(100vh - 76px); padding: 15px 16px 16px; overflow: hidden; border-right: 1px solid rgba(212,175,55,.17); background: linear-gradient(180deg,rgba(22,28,39,.88),rgba(13,17,25,.8)); box-sizing: border-box; }
.priority-sidebar-content { height: 100%; min-height: 0; display: flex; flex-direction: column; gap: 10px; }
.priority-sidebar-intro { flex: 0 0 auto; padding: 7px 8px 10px; display: grid; gap: 4px; border-bottom: 1px solid rgba(255,255,255,.07); }
.priority-sidebar-intro span { color: #7f8e9d; font-size: .61rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.priority-sidebar-intro strong { color: #f5f7f9; font: 700 .92rem var(--project-body-font, 'Geoform'),sans-serif; }
#priority-rating-host { min-height: 0; flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: rgba(212,175,55,.48) transparent; }
.priority-sidebar .replacement-summary-hero { width: 100%; margin: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; overflow: visible; }
.priority-sidebar .replacement-summary-heading { padding: 0 4px 9px; flex-direction:column; align-items:flex-start; justify-content: flex-start; gap:3px; border: 0; }
.priority-sidebar .replacement-summary-heading .section-kicker { display: none; }
.priority-sidebar .replacement-direction { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.priority-sidebar .replacement-sort-rule { display:block; color:#778793; font-size:.55rem; line-height:1.35; }
.priority-sidebar .replacement-top-five { padding: 0 3px 12px; display: flex; flex-direction: column; gap: 8px; overflow: visible; }
.priority-sidebar .replacement-rank-card { width: 100%; min-width: 0; flex: 0 0 auto; padding: 9px; border-radius: 10px; background: rgba(7,11,17,.58); box-sizing: border-box; }
.priority-sidebar .replacement-rank-body { grid-template-columns: 44px minmax(0,1fr); }
.priority-sidebar .replacement-rank-icon { width: 44px; height: 44px; }
.priority-sidebar .replacement-rank-name strong { font-size: .7rem; }
.priority-sidebar .replacement-boost { font-size: .58rem; }
.priority-sidebar .sidebar-qr-banner { flex: 0 0 auto; margin: 0; }

.workspace-redesign .main-content { padding: 18px clamp(14px,1.5vw,24px) 30px; overflow: visible; }
.workspace-redesign .workspace-grid { display: grid; grid-template-columns: minmax(560px,1fr) minmax(365px,405px); align-items: start; gap: 16px; }
.workspace-redesign .center-workspace { min-width: 0; }
.workspace-redesign .character-system-tabs { margin-bottom: 12px; padding: 5px; border: 1px solid rgba(255,255,255,.07); border-radius: 12px; background: rgba(19,25,35,.58); }
.workspace-redesign .character-system-panel.active { min-width: 0; }
.character-overview-dashboard { min-width: 0; display: grid; grid-template-columns: minmax(0,1fr); gap: 14px; }
.character-overview-dashboard .right-stats-panel { width: 100%!important; min-width: 0!important; max-width: none!important; display: block; }
.character-overview-dashboard .characteristics-card { margin: 0; border-color: rgba(212,175,55,.2); background: linear-gradient(145deg,rgba(27,34,46,.78),rgba(16,21,30,.74)); }
.character-overview-dashboard .right-hero-column { width: 100%!important; max-width: none!important; height: auto!important; min-height: 0; display: grid!important; grid-template-columns: minmax(0,1.2fr) minmax(275px,.8fr); gap: 14px!important; overflow: visible; }
.character-overview-dashboard .right-hero-column .active-sets-box { order: 1; min-height: 245px!important; max-height: 390px; margin: 0; background: linear-gradient(145deg,rgba(28,35,46,.84),rgba(14,19,27,.8))!important; }
.character-overview-dashboard .right-hero-column .positive-buffs-card { order: 2; min-height: 150px; margin: 0; background: linear-gradient(145deg,rgba(24,37,49,.82),rgba(14,22,31,.78))!important; }
.character-overview-dashboard .equipment-effects-scroll { height: auto; min-height: 175px; max-height: 315px; flex: 1 1 auto; }
.character-overview-dashboard .attribute-tab-card { margin: 0; border-color: rgba(88,183,178,.24); background: linear-gradient(145deg,rgba(20,34,42,.82),rgba(13,22,29,.76)); }

.inventory-workspace { position: sticky; top: 92px; min-width: 0; max-height: calc(100vh - 108px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: rgba(212,175,55,.48) transparent; }
.inventory-shell { min-width: 0; padding: 12px; display: flex; flex-direction: column; gap: 11px; border: 1px solid rgba(212,175,55,.28); border-radius: 16px; background: linear-gradient(155deg,rgba(31,37,48,.9),rgba(15,20,29,.88)); box-shadow: 0 20px 55px rgba(0,0,0,.28); }
.inventory-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.inventory-heading span { color: #82909e; font-size: .6rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.inventory-heading strong { color: #f9e7a9; font: 700 .9rem var(--project-body-font, 'Geoform'),sans-serif; }
.inventory-character-host { width: 100%; min-width: 0; }
.inventory-workspace .left-hero-column { width: 100%!important; min-width: 0!important; max-width: none!important; flex: none!important; }
.inventory-workspace .fullbody-character-card { width: 100%!important; height: 205px!important; min-height: 205px!important; border-color: rgba(212,175,55,.3)!important; border-radius: 12px!important; background: radial-gradient(circle at 52% 28%,rgba(105,130,153,.22),rgba(14,19,27,.9) 72%)!important; box-shadow: inset 0 0 45px rgba(0,0,0,.22),0 12px 30px rgba(0,0,0,.22); }
.inventory-workspace .character-image-wrap > img { display:none!important; }
.inventory-workspace .character-image-wrap { display:flex; align-items:stretch; }
.inventory-workspace .character-overlay-info { position:relative; inset:auto; height:100%; padding:11px 12px 10px; display:flex; flex-direction:column; justify-content:flex-start; box-sizing:border-box; background:none; }
.inventory-workspace .character-name-row { min-height:30px; justify-content:center; padding:0 4px 8px; border-bottom:1px solid rgba(212,175,55,.18); }
.inventory-workspace .character-name-row .char-profile-name { flex:none; width:100%; overflow:hidden; color:#f4f6f7; font-size:.78rem; font-weight:800; text-align:center; text-overflow:ellipsis; white-space:nowrap; }
.inventory-workspace .character-profile-meta { margin-top:auto; display:grid; grid-template-columns:minmax(0,1fr) 92px auto; align-items:end; gap:8px; }
.inventory-workspace #character-display-class,.inventory-workspace #character-display-level { display: none; }
.inventory-workspace .profile-class-control,.inventory-workspace .profile-level-control { min-width: 0; display: grid; gap: 4px; align-items: end; }
.inventory-workspace .profile-class-control label,.inventory-workspace .profile-level-control label { color: #c9d2db; font-size: .56rem; font-weight: 700; }
.inventory-workspace .profile-class-control select { width: 100%; min-width: 0; padding-inline: 8px; color: #f7df91; font-size: .68rem; }
.inventory-workspace .profile-level-control .number-stepper { width: 100%; }
.inventory-workspace .profile-level-control .number-stepper.compact { flex-basis: auto; }
.inventory-workspace .profile-level-control input { min-height: 32px; }
.inventory-workspace .character-save-button { width: auto; min-width: 76px; height: 30px; padding: 0 10px; font-size: .62rem; font-weight: 800; }
.character-avatar-hover-preview { position:fixed; z-index:3600; width:min(310px,calc(100vw - 24px)); height:min(440px,calc(100vh - 24px)); overflow:hidden; border:1px solid rgba(212,175,55,.48); border-radius:14px; isolation:isolate; background:#0d121a; box-shadow:0 28px 85px rgba(0,0,0,.72),inset 0 0 35px rgba(212,175,55,.08); opacity:0; visibility:hidden; pointer-events:none; transform:translateX(12px) scale(.98); transition:opacity .18s ease,transform .18s ease,visibility 0s linear .18s; }
.character-avatar-hover-preview::before { content:""; position:absolute; inset:-20px; z-index:0; background:linear-gradient(180deg,rgba(7,10,15,.08),rgba(7,10,15,.56)),var(--character-avatar-image,none) center/cover no-repeat; filter:blur(16px) saturate(.85) brightness(.62); transform:scale(1.08); }
.character-avatar-hover-preview img { position:relative; z-index:1; display:block; width:100%; height:100%; object-fit:contain; object-position:center bottom; }
.character-avatar-hover-preview.active { opacity:1; visibility:visible; transform:translateX(0) scale(1); transition-delay:0s; }
.character-avatar-hover-preview.is-empty { display:none; }
.inventory-quick-controls { padding: 10px; display: grid; grid-template-columns: minmax(0,1fr) minmax(130px,.62fr); gap: 9px; border: 1px solid rgba(255,255,255,.07); border-radius: 11px; background: rgba(7,11,17,.34); }
.inventory-quick-controls .selector-group { min-width: 0; display: grid; gap: 5px; }
.inventory-quick-controls .selector-group label { font-size: .61rem; }
.inventory-quick-controls .selector-group select,.inventory-quick-controls .selector-group input { width: 100%!important; min-width: 0; box-sizing: border-box; }
.inventory-quick-controls .constructor-pvp-toggles { grid-column: 1/-1; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
.inventory-quick-controls .constructor-pvp-toggle { min-width: 0; white-space: normal; }
.inventory-board { min-width: 0; padding: 10px 7px 8px; border: 1px solid rgba(255,255,255,.065); border-radius: 12px; background: radial-gradient(circle at 50% 38%,rgba(75,90,108,.12),rgba(6,10,16,.28) 70%); }
.inventory-board-heading { margin: 0 3px 7px; display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.inventory-board-heading strong { color: #e7edf2; font-size: .72rem; }
.inventory-board-heading span { color: #758492; font-size: .54rem; }
.inventory-workspace .equipment-grid-wrap { width: 100%!important; max-width: 100%!important; margin: 0 auto; flex: none!important; overflow: visible!important; }
.inventory-workspace .artifact-book-overlay-container { position: static; }
.workspace-redesign .constructor-header-card,.workspace-redesign .l2-equipment-card { display: none; }

.product-view-placeholder { min-height: calc(100vh - 125px); padding: 55px; display: grid; place-content: center; justify-items: center; text-align: center; border: 1px solid rgba(212,175,55,.2); border-radius: 18px; background: radial-gradient(circle at 50% 35%,rgba(212,175,55,.09),rgba(18,24,33,.74) 45%,rgba(10,14,21,.84)); }
.product-view-placeholder[hidden] { display: none; }
.product-view-placeholder h2 { margin: 9px 0 10px; color: #fff; font: 700 1.55rem var(--project-body-font, 'Geoform'),sans-serif; }
.product-view-placeholder p { max-width: 560px; margin: 0 0 24px; color: #9aa8b5; line-height: 1.65; }

/* Wide, task-oriented personal cabinet. */
.auth-dialog.account-mode { --modal-max-width: 1180px; width: min(1180px,calc(100vw - 36px)); max-width: none; max-height: min(880px,calc(100vh - 28px)); border-color: rgba(205,176,101,.3); background: linear-gradient(145deg,#26303b 0%,#1e2833 42%,#18222c 100%); box-shadow: 0 35px 100px rgba(0,0,0,.58); }
.auth-dialog.account-mode .modal-header { background: rgba(238,242,244,.035); }
.auth-dialog.account-mode .auth-account-pane.active { max-height: calc(100vh - 115px); padding: 18px 20px 20px; display: grid; grid-template-columns: minmax(340px,.82fr) minmax(0,1.3fr); align-items: start; gap: 14px; overflow-y: auto; }
.auth-dialog.account-mode .account-summary { grid-column: 1/-1; margin: 0; padding: 5px 3px 13px; border-bottom: 1px solid rgba(255,255,255,.09); }
.profile-premium-banner { margin-left: auto; min-width: 190px; padding: 8px 12px; display: flex; align-items: center; gap: 10px; border: 1px solid rgba(229,186,83,.5); border-radius: 12px; background: linear-gradient(115deg,rgba(162,113,35,.28),rgba(63,48,73,.34)); box-shadow: inset 0 1px rgba(255,255,255,.12),0 7px 20px rgba(0,0,0,.18); color: #f8e9bd; cursor: pointer; text-align: left; }
.profile-premium-banner:hover { border-color:#ffe2a1; background:linear-gradient(115deg,rgba(183,132,44,.4),rgba(79,58,91,.47)); }
.profile-premium-banner.is-premium { border-color:rgba(241,215,136,.85); box-shadow:0 0 20px rgba(222,174,65,.17); }
.profile-premium-banner > .ui-symbol:first-child { font-size: 1.28rem; color:#f8d584; }
.profile-premium-banner span { min-width:0; display:grid; gap:2px; }
.profile-premium-banner span strong { font-size:.79rem; color:#fff4ce; }
.profile-premium-banner span small { overflow:hidden; font-size:.59rem; color:#d7c9ab; text-overflow:ellipsis; white-space:nowrap; }
.profile-premium-banner > .ui-symbol:last-child { margin-left:auto; opacity:.72; }
#premium-modal { z-index: 4600; }
.premium-dialog { width:min(580px,calc(100vw - 24px)); max-height:min(750px,calc(100dvh - 24px)); overflow:auto; background:linear-gradient(150deg,#252c38,#151d2a); border-color:rgba(219,180,91,.4); }
.premium-dialog .modal-body { padding:19px; }
.premium-dialog .profile-premium-section { display:grid; gap:11px; }
.premium-dialog .profile-access-request-form { display:grid; gap:10px; }
.premium-dialog .profile-access-request-form label { display:grid; gap:6px; }
.account-admin-shortcut { margin-left: auto; padding: 8px 12px; border: 1px solid rgba(212,175,55,.38); border-radius: 8px; background: rgba(212,175,55,.08); color: #ffe49a; font-size: .68rem; font-weight: 700; text-decoration: none; }
.account-overview-metrics { grid-column: 1/-1; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; }
.account-overview-metrics > span { min-width: 0; padding: 11px 13px; display: grid; gap: 5px; border: 1px solid rgba(255,255,255,.1); border-radius: 10px; background: rgba(244,247,248,.055); }
.account-overview-metrics small { color: #91a2af; font-size: .6rem; }
.account-overview-metrics strong { overflow: hidden; color: #f4f7f8; font-size: .78rem; text-overflow: ellipsis; white-space: nowrap; }
.auth-dialog.account-mode .profile-characters-section,.auth-dialog.account-mode .profile-equipment-prices-section { min-width: 0; height: 100%; margin: 0; padding: 14px; border: 1px solid rgba(255,255,255,.1); border-radius: 13px; background: rgba(240,245,247,.045); box-sizing: border-box; }
.auth-dialog.account-mode .profile-characters-section,.auth-dialog.account-mode .profile-equipment-prices-section { grid-column: 1/-1; height: auto; }
.auth-dialog.account-mode .profile-equipment-prices-section { padding-top: 14px; }
.auth-dialog.account-mode .profile-character-slots { display:grid; grid-auto-flow:column; grid-auto-columns:minmax(230px,1fr); grid-template-columns:none; max-height:none; gap:9px; padding:2px 2px 10px; overflow-x:auto; overflow-y:hidden; }
.auth-dialog.account-mode .profile-character-slot { min-height: 80px; grid-template-columns: 58px minmax(0,1fr) auto; border-color: rgba(255,255,255,.1); background: rgba(9,15,22,.34); }
.auth-dialog.account-mode .profile-character-avatar { width: 58px; height: 58px; border-radius: 11px; }
.auth-dialog.account-mode .profile-character-info strong { font-size: .79rem; }
.auth-dialog.account-mode .profile-character-info span { font-size: .65rem; }
.auth-dialog.account-mode .profile-equipment-price-list { max-height: 465px; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.auth-dialog.account-mode .profile-equipment-price-row { grid-template-columns: 44px minmax(0,1fr); align-items: center; padding: 9px; border-color: rgba(255,255,255,.1); border-radius: 10px; background: rgba(8,14,21,.33); }
.auth-dialog.account-mode .profile-price-item-icon,.auth-dialog.account-mode .profile-price-item-icon>.item-icon-composite { width: 42px; height: 42px; }
.auth-dialog.account-mode .profile-price-input { grid-column: 1/-1; padding-top: 7px; border-top: 1px solid rgba(255,255,255,.07); }
.auth-dialog.account-mode #logout-button { grid-column: 1/-1; width: auto; min-width: 180px; justify-self: end; margin: 0; }
.account-summary:has(.profile-premium-banner) .account-admin-shortcut { margin-left:0; }

@media (max-width: 1480px) {
    .workspace-redesign .app-layout { grid-template-columns: 300px minmax(0,1fr); }
    .workspace-redesign .priority-sidebar { width: 300px; }
    .workspace-redesign .workspace-grid { grid-template-columns: minmax(520px,1fr) 370px; }
    .character-overview-dashboard .right-hero-column { grid-template-columns: 1fr; }
}
@media (max-width: 1180px) {
    .workspace-redesign .victory-header { grid-template-columns: minmax(190px,1fr) minmax(390px,auto) minmax(90px,1fr); }
    .workspace-redesign .victory-header .profile-info { display: none; }
    .workspace-redesign .app-layout { grid-template-columns: 260px minmax(0,1fr); }
    .workspace-redesign .priority-sidebar { width: 260px; }
    .workspace-redesign .workspace-grid { grid-template-columns: minmax(0,1fr); }
    .inventory-workspace { position: relative; top: auto; order: -1; max-height: none; }
    .inventory-shell { display: grid; grid-template-columns: minmax(270px,.8fr) minmax(340px,1.2fr); align-items: start; }
    .inventory-heading { grid-column: 1/-1; }
    .inventory-quick-controls { grid-column: 1; }
    .inventory-board { grid-column: 2; grid-row: 2/5; }
    .inventory-workspace .artifact-book-overlay-container { grid-column: 1/-1; }
}
@media (max-width: 900px) {
    .workspace-redesign .victory-header { position: sticky; height: auto; min-height: 0; padding: 9px 12px; grid-template-columns: minmax(0,1fr) auto; gap: 8px 12px; }
    .workspace-redesign .victory-header-content { display: none; }
    .victory-product-nav { grid-column: 1; grid-row: 1; min-width: 0; max-width: 100%; justify-content: flex-start; overflow-x: auto; }
    .victory-product-tab { min-width: 116px; min-height: 39px; padding-inline: 11px; }
    .workspace-redesign .victory-header-side { grid-column: 2; grid-row: 1; }
    .workspace-redesign .app-layout { display: flex; flex-direction: column; }
    .workspace-redesign .priority-sidebar { position: relative; top: auto; order: 2; width: 100%; height: auto; max-height: none; border: 1px solid rgba(212,175,55,.17); }
    #priority-rating-host { overflow: visible; }
    .workspace-redesign .main-content { order: 1; width: 100%; }
    .priority-sidebar .replacement-top-five { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
    .auth-dialog.account-mode .auth-account-pane.active { grid-template-columns: 1fr; }
    .auth-dialog.account-mode .account-summary,.account-overview-metrics,.auth-dialog.account-mode #logout-button { grid-column: 1; }
}
@media (max-width: 680px) {
    .workspace-redesign .main-content { padding: 10px 7px 18px!important; }
    .workspace-redesign .character-system-tabs { border-radius: 9px; }
    .inventory-shell { display: flex; align-items: stretch; padding: 9px; }
    .inventory-workspace .fullbody-character-card { height: 185px!important; min-height: 185px!important; }
    .inventory-quick-controls { grid-template-columns: 1fr; }
    .inventory-quick-controls .constructor-pvp-toggles { grid-column: 1; grid-template-columns: 1fr; }
    .inventory-board-heading span { display: none; }
    .character-overview-dashboard .right-hero-column { grid-template-columns: 1fr!important; }
    .priority-sidebar .replacement-top-five { grid-template-columns: 1fr; }
    .account-overview-metrics { grid-template-columns: 1fr; }
    .profile-premium-banner { width:100%; }
    .auth-dialog.account-mode .profile-equipment-price-list { grid-template-columns: 1fr; }
    .auth-dialog.account-mode .account-summary { align-items: flex-start; flex-wrap: wrap; }
    .account-admin-shortcut { width: 100%; margin-left: 0; text-align: center; }
}
.item-attribute-tooltip{margin:12px 0 4px;padding:0 7px 7px;border:1px solid rgba(100,91,72,.82);border-radius:9px;overflow:hidden;background:rgba(5,6,5,.92);box-shadow:inset 0 0 0 1px rgba(0,0,0,.72)}
.item-attribute-title{margin:0 -5px 4px;padding:4px 7px;color:#d8cba7;font-size:.76rem;line-height:1.2;background:linear-gradient(90deg,rgba(60,52,39,.78),rgba(31,29,24,.72));border-bottom:1px solid rgba(112,101,78,.55)}
.item-attribute-row{position:relative;min-height:24px;padding:3px 2px 9px;color:#f1f1ef;overflow:hidden;border-bottom:1px solid rgba(255,255,255,.025)}
.item-attribute-row:last-child{border-bottom:0}
.item-attribute-row::after{content:"";position:absolute;z-index:0;left:2px;width:40%;bottom:3px;height:5px;border-radius:999px;background:rgba(255,255,255,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.8)}
.item-attribute-row span{position:relative;z-index:2;display:block;font-size:.78rem;line-height:1.15;white-space:nowrap}.item-attribute-row small{color:#d7d5cf;font-size:inherit}
.item-attribute-row i{position:absolute;z-index:1;left:2px;bottom:3px;width:var(--attribute-fill);height:5px;border-radius:999px;background:#888;box-shadow:0 0 5px currentColor}
.item-attribute-row.fire i{color:#bf5038;background:#bf5038}.item-attribute-row.water i{color:#2f82bc;background:#2f82bc}.item-attribute-row.earth i{color:#3e9c82;background:#3e9c82}.item-attribute-row.wind i{color:#718c92;background:#718c92}.item-attribute-row.holy i{color:#b7a2cf;background:#b7a2cf}.item-attribute-row.dark i{color:#794293;background:#794293}
.attachment-custom-frame{position:absolute!important;inset:0;width:100%!important;height:100%!important;object-fit:contain;z-index:3;pointer-events:none}

/* Database-backed Life Stone picker. */
.manual-enchant-stone-picker{display:grid;grid-template-columns:minmax(0,1fr) minmax(140px,.36fr);gap:12px;padding:14px;border:1px solid rgba(20,181,160,.34);border-radius:10px;background:rgba(3,12,18,.72)}
.manual-enchant-stone-picker label{display:grid;gap:6px;color:#d8e5e8;font-size:.78rem}.manual-enchant-stone-picker label.full{grid-column:1/-1}.manual-enchant-stone-picker select{width:100%;min-width:0}
.enchantment-stone-select-button{display:grid;grid-template-columns:48px minmax(0,1fr);align-items:center;gap:11px;width:100%;min-height:58px;padding:7px 10px;border:1px solid rgba(208,177,93,.38);border-radius:8px;background:linear-gradient(135deg,rgba(28,29,25,.96),rgba(7,14,18,.96));color:#fff;text-align:left;cursor:pointer}.enchantment-stone-select-button:hover{border-color:#d0b15d;box-shadow:0 0 0 2px rgba(208,177,93,.1)}.enchantment-stone-select-icon{display:block;width:44px;height:44px}.enchantment-stone-select-icon>img,.enchantment-stone-select-icon>.item-icon-composite{width:100%;height:100%}.enchantment-stone-select-button>span{display:grid;gap:3px;min-width:0}.enchantment-stone-select-button strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:.84rem}.enchantment-stone-select-button small{color:#8ea0a5;font-size:.68rem}
.manual-enchant-property-list{grid-column:1/-1;display:grid;gap:8px}.manual-enchant-property-row{display:grid;grid-template-columns:minmax(0,1fr) minmax(110px,.28fr);gap:8px;align-items:end;padding:9px;border:1px solid rgba(255,255,255,.08);border-radius:8px;background:rgba(0,0,0,.28)}.manual-enchant-property-row label{min-width:0}.manual-enchant-property-value[hidden]{display:none}.manual-enchant-property-empty{padding:12px;border:1px dashed rgba(255,255,255,.15);border-radius:8px;color:#84969b;text-align:center;font-size:.74rem}
.manual-enchant-value-input{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:7px}.manual-enchant-value-input b{color:#14b5a0;font-size:.78rem}
.enchantment-stone-picker-backdrop{z-index:4300}.enchantment-stone-picker-dialog{--modal-max-width:760px}.enchantment-stone-picker-dialog .modal-body{display:grid;gap:12px}.enchantment-stone-picker-results{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;max-height:min(520px,65vh);overflow:auto;padding:2px}.enchantment-stone-card{display:grid;grid-template-columns:54px minmax(0,1fr);align-items:center;gap:10px;min-width:0;padding:9px;border:1px solid rgba(255,255,255,.09);border-radius:9px;background:rgba(2,7,10,.9);color:#fff;text-align:left;cursor:pointer}.enchantment-stone-card:hover{border-color:#14b5a0;background:rgba(20,181,160,.09)}.enchantment-stone-card>i,.enchantment-stone-card>i>.item-icon-composite{display:block;width:52px;height:52px}.enchantment-stone-card>span{display:grid;gap:4px;min-width:0}.enchantment-stone-card strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:.78rem}.enchantment-stone-card small{color:#14b5a0;font-size:.66rem}.enchantment-stone-empty{grid-column:1/-1;padding:28px 14px;border:1px dashed rgba(255,255,255,.12);border-radius:9px;color:#8fa0a5;text-align:center}
.manual-enchant-effect-preview{grid-column:1/-1;display:grid;gap:5px;min-height:54px;padding:10px 12px;border-left:3px solid #14b5a0;background:rgba(20,181,160,.08);color:#a9bbc0;font-size:.76rem;line-height:1.45}.manual-enchant-effect-preview strong{color:#fff;font-size:.82rem}.manual-enchant-effect-preview span{white-space:normal}
.manual-enchant-legacy{margin-top:12px;border:1px solid rgba(255,255,255,.1);border-radius:9px;background:rgba(0,0,0,.22)}.manual-enchant-legacy>summary{cursor:pointer;padding:11px 13px;color:#9eb0b5;font-size:.76rem}.manual-enchant-legacy[open]>summary{border-bottom:1px solid rgba(255,255,255,.08);color:#e7f1f3}.manual-enchant-legacy>.manual-enchant-name,.manual-enchant-legacy>.manual-enchant-bonus-list,.manual-enchant-legacy>#manual-enchant-add-bonus{margin:12px}
.equipment-enchant-stone-icon{position:relative;display:block;width:34px;height:34px;flex:0 0 34px}.equipment-enchant-stone-icon>.item-icon-composite,.equipment-enchant-stone-icon>i{width:100%;height:100%}.equipment-enchant-stone-icon img{max-width:100%;max-height:100%}

/* Equipment prices in the personal cabinet. */
.profile-equipment-prices-section{margin-top:14px;padding-top:14px;border-top:1px solid rgba(255,255,255,.08)}.profile-equipment-prices-section>h4{margin:0 0 4px;color:#fff;font-size:.86rem}.profile-equipment-prices-section>p{margin:0 0 10px;color:#819399;font-size:.7rem;line-height:1.4}
.profile-equipment-price-list{display:grid;gap:6px;max-height:340px;overflow:auto;padding-right:4px}.profile-equipment-price-row{display:grid;grid-template-columns:38px minmax(0,1fr) minmax(145px,.45fr);align-items:center;gap:10px;padding:7px 8px;border:1px solid rgba(255,255,255,.07);border-radius:7px;background:rgba(0,0,0,.2)}.profile-equipment-price-row span{min-width:0;color:#ccd8db;font-size:.72rem}.profile-price-item-icon,.profile-price-item-icon>.item-icon-composite{display:block;width:36px;height:36px}.profile-price-item-copy{display:grid;gap:2px;overflow:hidden}.profile-price-item-copy strong,.profile-price-item-copy small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.profile-price-item-copy small{color:#7f9297}.profile-price-input{display:flex;align-items:center;gap:5px}.profile-price-input input{text-align:right;min-width:0;width:100%}.profile-price-input em{color:#7f9297;font-size:.62rem;font-style:normal}
.profile-audio-settings{display:grid;gap:12px;margin-top:14px;padding:14px;border:1px solid rgba(255,255,255,.1);border-radius:13px;background:rgba(240,245,247,.045)}.profile-audio-toggle-row{display:flex;flex-wrap:wrap;gap:8px 15px}.profile-audio-toggle-row label{color:#d8e2e5;font-size:.68rem;white-space:nowrap}.profile-audio-toggle-row input{accent-color:#b89452}.profile-audio-volume-row{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.profile-audio-volume-row label{display:grid;grid-template-columns:auto minmax(40px,1fr) auto;align-items:center;gap:7px;color:#aebec5;font-size:.65rem}.profile-audio-volume-row input{min-width:0;width:100%;accent-color:#b89452}.profile-audio-volume-row output{min-width:31px;color:#d9b973;font-size:.62rem;text-align:right}@media (max-width:640px){.profile-audio-volume-row{grid-template-columns:1fr}}

/* UI-001: equipment prices have their own focused workspace. */
.equipment-prices-dialog{--modal-max-width:980px;width:min(980px,calc(100vw - 30px));max-height:min(780px,calc(100vh - 28px));background:linear-gradient(145deg,#26303b 0%,#1c2631 54%,#151e28 100%)}.equipment-prices-dialog .modal-body{max-height:calc(100vh - 124px);overflow:auto}.equipment-prices-dialog .profile-equipment-prices-section{margin:0;padding:0;border:0;background:transparent}.equipment-prices-summary{display:grid;grid-template-columns:auto minmax(130px,1fr);align-items:baseline;gap:5px 12px;margin:0 0 15px;padding:12px 14px;border:1px solid rgba(214,181,103,.24);border-radius:11px;background:linear-gradient(100deg,rgba(188,144,62,.14),rgba(29,43,59,.3))}.equipment-prices-summary-label{color:#9aabb7;font-size:.62rem;text-transform:uppercase;letter-spacing:.06em}.equipment-prices-summary strong{min-width:0;color:#fff0bf;font-size:.88rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.equipment-prices-summary-note{grid-column:1/-1;color:#aab8c0;font-size:.67rem;line-height:1.45}.equipment-prices-dialog .profile-equipment-price-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;max-height:none;overflow:visible;padding:0}.equipment-price-card{display:grid;gap:10px;min-width:0;padding:11px 12px;border:1px solid rgba(255,255,255,.11);border-radius:12px;background:linear-gradient(145deg,rgba(15,24,35,.72),rgba(5,11,18,.54));box-shadow:inset 0 1px rgba(255,255,255,.035);transition:border-color .15s ease,transform .15s ease}.equipment-price-card:focus-within,.equipment-price-card:hover{border-color:rgba(225,190,109,.58);transform:translateY(-1px)}.equipment-price-card-item{display:grid;grid-template-columns:48px minmax(0,1fr);align-items:center;gap:10px}.equipment-price-card .profile-price-item-icon,.equipment-price-card .profile-price-item-icon>.item-icon-composite{width:48px;height:48px}.equipment-price-card .profile-price-item-copy{gap:4px}.equipment-price-card .profile-price-item-copy strong{color:#eff5f6;font-size:.74rem;line-height:1.35;white-space:normal;overflow-wrap:anywhere}.equipment-price-slot{width:max-content;max-width:100%;padding:2px 6px;border-radius:999px;background:rgba(184,146,69,.16);color:#d7bd7b!important;font-size:.58rem!important;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.equipment-price-card-value{display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;gap:9px;padding-top:9px;border-top:1px solid rgba(255,255,255,.075)}.equipment-price-card-value>small{color:#8fa0ab;font-size:.62rem}.equipment-price-card .profile-price-input{justify-content:flex-end;min-width:0}.equipment-price-card .profile-price-input input{min-width:0;height:30px;color:#f7e4ad;font-weight:700}.equipment-price-card .profile-price-input em{white-space:nowrap}.equipment-prices-dialog .profile-character-loading{grid-column:1/-1}
@media(max-width:720px){.equipment-prices-dialog .profile-equipment-price-list{grid-template-columns:1fr}.equipment-prices-dialog{width:calc(100vw - 14px)}.equipment-prices-summary{grid-template-columns:1fr}.equipment-prices-summary-note{grid-column:auto}}

/* UI-001: summary belongs to the item list, not the personal cabinet. */
.account-overview-metrics-single{grid-template-columns:minmax(0,1fr);max-width:360px}.equipment-prices-summary{grid-template-columns:repeat(3,minmax(0,1fr));align-items:stretch}.equipment-prices-summary-stat{min-width:0;display:grid;gap:5px;padding:2px 10px;border-right:1px solid rgba(255,255,255,.1)}.equipment-prices-summary-stat:last-of-type{border-right:0}.equipment-prices-summary-stat small{color:#9aabb7;font-size:.6rem;text-transform:uppercase;letter-spacing:.05em}.equipment-prices-summary-stat strong{display:block;color:#fff0bf;font-size:.82rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.equipment-prices-summary-note{grid-column:1/-1;margin-top:4px;padding-top:8px;border-top:1px solid rgba(255,255,255,.08)}@media(max-width:720px){.equipment-prices-summary{grid-template-columns:1fr}.equipment-prices-summary-stat{padding:4px 0;border-right:0;border-bottom:1px solid rgba(255,255,255,.08)}.equipment-prices-summary-note{grid-column:auto}}

/* Configurable QR banner layouts. */
.sidebar-qr-banner[data-format="compact"] .sidebar-qr-description{display:none}.sidebar-qr-banner[data-format="compact"]{grid-template-columns:62px minmax(0,1fr)}.sidebar-qr-banner[data-format="minimal"] .sidebar-qr-copy{display:none}.sidebar-qr-banner[data-format="minimal"]{display:flex;justify-content:center}

/* Resilient workspace sizing for browser zoom and intermediate resolutions. */
html,body{max-width:100%;overflow-x:clip}
.app-layout,.main-content,.workspace-grid,.center-workspace,.character-system-panel,.l2-equipment-card,.equipment-with-character-layout,.equipment-grid-wrap,.right-stats-panel{min-width:0;max-width:100%;box-sizing:border-box}
.character-system-tabs,.constructor-direction-row{max-width:100%;overflow-x:auto;overflow-y:hidden;scrollbar-width:thin}
.modal-box{max-width:min(calc(100vw - 24px),var(--modal-max-width,1180px));box-sizing:border-box}
@media(max-width:1450px){.workspace-grid{grid-template-columns:minmax(0,1fr)!important}.right-stats-panel{position:relative!important;inset:auto!important;width:100%!important;max-height:none}.equipment-with-character-layout{max-width:100%}}
@media(max-width:980px){.equipment-with-character-layout{grid-template-columns:1fr!important}.character-portrait-column{width:min(100%,430px);margin-inline:auto}.equipment-grid-wrap{width:100%!important;overflow-x:auto}.main-content{padding-inline:12px!important}.constructor-controls-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}}
@media(max-width:680px){.manual-enchant-stone-picker{grid-template-columns:1fr}.manual-enchant-stone-picker label.full{grid-column:auto}.manual-enchant-property-row,.enchantment-stone-picker-results{grid-template-columns:1fr}.profile-equipment-price-row{grid-template-columns:38px minmax(0,1fr)}.profile-price-input{grid-column:1/-1}.constructor-controls-grid{grid-template-columns:1fr!important}.modal-box{max-width:calc(100vw - 12px);margin:6px}.modal-body{padding-inline:12px}.workspace-grid{gap:10px}}

/* Keep the redesigned grid authoritative over legacy responsive fallbacks. */
.workspace-redesign.product-view-active .app-layout { display: block; }
.workspace-redesign.product-view-active .main-content { width: 100%; }
@media (min-width:1181px) and (max-width:1450px) {
    .workspace-redesign .workspace-grid { grid-template-columns: minmax(520px,1fr) 370px!important; }
}

/* Workspace refinement: compact inventory and independent analytics columns. */
.workspace-redesign .priority-sidebar,
.workspace-redesign #priority-rating-host,
.character-overview-dashboard .right-stats-panel,
.inventory-workspace {
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.workspace-redesign .priority-sidebar::-webkit-scrollbar,
.workspace-redesign #priority-rating-host::-webkit-scrollbar,
.character-overview-dashboard .right-stats-panel::-webkit-scrollbar,
.inventory-workspace::-webkit-scrollbar { width: 0; height: 0; display: none; }

.character-overview-dashboard {
    grid-template-columns: minmax(300px,.82fr) minmax(360px,1.18fr);
    grid-template-rows: auto auto;
    align-items: start;
}
.character-overview-dashboard .right-stats-panel {
    position: sticky!important;
    top: 92px!important;
    grid-column: 1;
    grid-row: 1 / -1;
    max-height: calc(100vh - 108px)!important;
    overflow-y: auto;
    overscroll-behavior: contain;
}
.character-overview-dashboard .right-hero-column {
    grid-column: 2;
    grid-row: 1;
    display: flex!important;
    flex-direction: column!important;
    gap: 14px!important;
}
.character-overview-dashboard .right-hero-column .positive-buffs-card { order: 1; width: 100%; box-sizing: border-box; }
.character-overview-dashboard .right-hero-column .active-sets-box { order: 2; width: 100%; box-sizing: border-box; }
.character-overview-dashboard .attribute-tab-card { grid-column: 2; grid-row: 2; }

.inventory-workspace .fullbody-character-card {
    height: 174px!important;
    min-height: 174px!important;
}
.inventory-quick-controls { grid-template-columns: minmax(0,1fr); }
.inventory-quick-controls .inventory-budget-control { grid-column: 1; grid-row: 1; }
.inventory-quick-controls .inventory-direction-control { grid-column: 1; grid-row: 2; }
.inventory-quick-controls .constructor-pvp-toggles { grid-column: 1; grid-row: 3; }

.inventory-dyes-row {
    margin: 0 3px 9px;
    padding: 7px 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    border: 1px solid rgba(255,255,255,.065);
    border-radius: 9px;
    background: rgba(4,8,13,.3);
}
.inventory-dyes-row > span { display: none; }
.inventory-dyes-row .left-spirit-stack { display: flex!important; flex-direction: row!important; align-items: center; gap: 7px!important; margin: 0!important; }
.inventory-dyes-row .doll-slot.mini { width: 41px!important; height: 41px!important; border-radius: 8px; }

.inventory-workspace .equipment-grid-wrap {
    --inventory-slot-size: 76px;
    --inventory-slot-gap: 10px;
    --inventory-primary-width: calc(var(--inventory-slot-size) * 3 + var(--inventory-slot-gap) * 2);
    --inventory-child-slot-size: 35px;
    --inventory-parent-slot-size: 49px;
    --equipment-primary-width: var(--inventory-primary-width);
    width: var(--inventory-primary-width)!important;
    min-width: var(--inventory-primary-width)!important;
    flex: 0 0 var(--inventory-primary-width)!important;
    display: block!important;
}
.inventory-workspace .equipment-primary-column { grid-column: auto; width: var(--inventory-primary-width); gap: var(--inventory-slot-gap); }
.inventory-workspace .authentic-doll-grid {
    grid-template-columns: repeat(3,var(--inventory-slot-size))!important;
    grid-template-rows: repeat(5,var(--inventory-slot-size))!important;
    gap: var(--inventory-slot-gap)!important;
}
.inventory-workspace .authentic-doll-grid > .doll-slot { width: var(--inventory-slot-size)!important; height: var(--inventory-slot-size)!important; border-radius: 9px; }
.inventory-workspace .doll-row-2-items {
    grid-template-columns: repeat(2,var(--inventory-slot-size))!important;
    justify-content: center;
    gap: var(--inventory-slot-gap)!important;
}
.inventory-workspace .doll-row-2-items .doll-slot { width: var(--inventory-slot-size)!important; height: var(--inventory-slot-size)!important; border-radius: 9px; }
.inventory-workspace .authentic-doll-grid .slot-label { max-width: calc(var(--inventory-slot-size) - 4px); font-size: .52rem; }
.inventory-workspace .special-slot-stage {
    width: var(--inventory-primary-width);
    margin-inline: 0;
    padding: 5px;
    position: relative;
    overflow: visible;
    border-color: transparent;
    background: transparent;
    box-shadow: none;
}
.inventory-workspace .special-slot-stage::before {
    content: "";
    position: absolute;
    z-index: 0;
    inset: -4px -10px;
    border: 1px solid rgba(212,175,55,.3);
    border-radius: 10px;
    background: linear-gradient(180deg,rgba(20,23,31,.96),rgba(7,9,14,.92));
    box-shadow: inset 0 0 22px rgba(212,175,55,.035),0 8px 20px rgba(0,0,0,.24);
    pointer-events: none;
}
.inventory-workspace .special-slot-stage > .special-inline-panels {
    position: relative;
    z-index: 1;
}
.inventory-workspace .special-inline-panels { min-height: 31px; }
.inventory-workspace .special-submenu-popover.special-inline-panel,
.inventory-workspace .special-submenu-popover.special-inline-panel.active {
    grid-template-columns: repeat(var(--special-slot-columns,6),var(--inventory-child-slot-size));
    gap: 4px;
}
.inventory-workspace :is(#menu-seed,#luck-menu-seed).special-inline-panel,
.inventory-workspace :is(#menu-seed,#luck-menu-seed).special-inline-panel.active { grid-template-columns: var(--inventory-child-slot-size) minmax(0,1fr) repeat(4,var(--inventory-child-slot-size)); }
.inventory-workspace .special-submenu-popover.special-inline-panel > .doll-slot { width: var(--inventory-child-slot-size); height: var(--inventory-child-slot-size); border-radius: 6px; }
.inventory-workspace .special-tabs-row { grid-template-columns: repeat(4,var(--inventory-parent-slot-size)); justify-content: center; gap: var(--inventory-slot-gap); }
.inventory-workspace .special-parent-slot { width: var(--inventory-parent-slot-size); height: var(--inventory-parent-slot-size); border-radius: 8px; }

@media (max-width: 1480px) {
    .character-overview-dashboard { grid-template-columns: minmax(250px,.6fr) minmax(0,1.4fr); }
}
@media (max-width: 1180px) {
    .inventory-shell { grid-template-columns: minmax(300px,.92fr) minmax(300px,1.08fr); }
    .inventory-character-host { grid-column: 1; grid-row: 1; }
    .inventory-quick-controls { grid-column: 1; grid-row: 2; }
    .inventory-board { grid-column: 2; grid-row: 1 / span 2; }
    .inventory-workspace .fullbody-character-card { height: 174px!important; min-height: 174px!important; }
}
@media (max-width: 760px) {
    .character-overview-dashboard { grid-template-columns: minmax(0,1fr); grid-template-rows: auto; }
    .character-overview-dashboard .right-stats-panel { position: relative!important; top: auto!important; grid-column: 1; grid-row: auto; max-height: calc(100vh - 90px)!important; }
    .character-overview-dashboard .right-hero-column,.character-overview-dashboard .attribute-tab-card { grid-column: 1; grid-row: auto; }
    .inventory-workspace .fullbody-character-card { height: 185px!important; min-height: 185px!important; }
    .workspace-redesign .priority-sidebar { height: min(650px,72vh); overflow: hidden; }
}

.character-overview-dashboard .positive-buffs-card > div:first-child {
    display: grid!important;
    grid-template-columns: minmax(0,1fr) auto;
    gap: 8px;
}
.character-overview-dashboard .positive-buffs-card > div:first-child > div { min-width: 0; flex-wrap: wrap; }
.character-overview-dashboard #buff-count-badge { white-space: nowrap; }
@media (max-width: 900px) {
    .workspace-redesign .priority-sidebar { height: min(650px,72vh); max-height: 650px; overflow: hidden; }
}

/* Character card and overview composition. */
.character-overview-dashboard {
    grid-template-rows: auto;
    grid-template-columns: minmax(270px,.6fr) minmax(0,1.4fr);
    align-items: start;
}
.left-overview-column {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0,1fr);
    align-content: start;
    gap: 6px;
}
.right-overview-column {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0,1fr);
    grid-template-rows: auto auto;
    align-content: start;
    gap: 14px;
}
.overview-top-row {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    align-items: stretch;
    gap: 14px;
    margin: 0;
}
.overview-top-row .positive-buffs-card,
.overview-top-row .attribute-tab-card {
    width: 100%;
    min-width: 0;
    height: 100%;
    margin: 0;
    box-sizing: border-box;
}
.overview-top-row .positive-buffs-card {
    min-height: 0;
    background: linear-gradient(145deg,rgba(24,37,49,.82),rgba(14,22,31,.78))!important;
}
.overview-top-row .attribute-tab-card {
    grid-column: auto;
    grid-row: auto;
    padding: 12px;
}
.overview-top-row .attribute-tab-heading { margin-bottom: 10px; }
.overview-top-row .attribute-tab-grid { grid-template-columns: minmax(0,1fr); gap: 8px; }
.overview-top-row .attribute-attack-card,
.overview-top-row .attribute-defense-card { padding: 10px; }
.overview-top-row .attribute-section-label { margin-bottom: 7px; }
.overview-top-row .attribute-attack-value { min-height: 45px; }
.overview-top-row .attribute-defense-grid > div { padding: 5px 8px; }
.character-summary-host { grid-column: 1; grid-row: auto; width: 100%; min-width: 0; }
.character-summary-host .left-hero-column { width: 100%!important; min-width: 0!important; max-width: none!important; flex: none!important; }
.character-summary-host .fullbody-character-card {
    width: 100%!important;
    height: 410px!important;
    min-height: 410px!important;
    border-color: rgba(212,175,55,.3)!important;
    border-radius: 12px!important;
    background: radial-gradient(circle at 52% 28%,rgba(105,130,153,.22),rgba(14,19,27,.9) 72%)!important;
    box-shadow: inset 0 0 45px rgba(0,0,0,.22),0 12px 30px rgba(0,0,0,.22);
}
.character-summary-host .character-image-wrap > img {
    position: relative;
    z-index: 1;
    object-fit: contain!important;
    object-position: center bottom!important;
}
.character-summary-host .character-image-wrap { isolation: isolate; overflow: hidden; background: #111721; }
.character-summary-host .character-image-wrap::before {
    content: '';
    position: absolute;
    inset: -18px;
    z-index: 0;
    background:
        linear-gradient(180deg,rgba(8,12,18,.12),rgba(8,12,18,.5)),
        var(--character-avatar-image,none) center/cover no-repeat;
    filter: blur(14px) saturate(.82) brightness(.66);
    transform: scale(1.08);
    opacity: .9;
    pointer-events: none;
}
.character-summary-host .character-overlay-info { z-index: 2; }
.character-summary-host .character-overlay-info { padding: 35px 12px 11px; }
.character-summary-host .character-profile-meta { display: grid; grid-template-columns: minmax(0,1fr) 92px; align-items: end; gap: 8px; }
.character-summary-host #character-display-class,.character-summary-host #character-display-level { display: none; }
.character-summary-host .profile-class-control,.character-summary-host .profile-level-control { min-width: 0; display: grid; gap: 4px; align-items: end; }
.character-summary-host .profile-class-control label,.character-summary-host .profile-level-control label { color: #c9d2db; font-size: .56rem; font-weight: 700; }
.character-summary-host .profile-class-control select { width: 100%; min-width: 0; padding-inline: 8px; color: #f7df91; font-size: .68rem; }
.character-summary-host .profile-level-control .number-stepper { width: 100%; }
.character-summary-host .profile-level-control .number-stepper.compact { flex-basis: auto; }
.character-summary-host .profile-level-control input { min-height: 32px; }
.character-summary-host .character-save-button { width: auto; min-width: 76px; height: 30px; padding: 0 10px; font-size: .62rem; font-weight: 800; }
.character-overview-dashboard .right-stats-panel {
    grid-column: 1;
    grid-row: auto;
    position: relative!important;
    top: auto!important;
    margin-top: 0!important;
}
.character-overview-dashboard .right-hero-column {
    grid-column: 1;
    grid-row: 2;
    width: 100%!important;
    height: var(--overview-effects-height,clamp(300px,calc(100vh - 440px),660px))!important;
    min-height: 240px!important;
    max-height: calc(100vh - 110px)!important;
    display: flex!important;
    overflow: hidden!important;
}
.character-overview-dashboard .right-hero-column .active-sets-box {
    order: 1;
    width: 100%;
    height: 100%;
    min-height: 0!important;
    max-height: none!important;
    margin: 0;
}
.right-overview-column .equipment-effects-scroll {
    height: 0!important;
    min-height: 0!important;
    max-height: none!important;
    flex: 1 1 0!important;
}
@media (max-width: 1480px) {
    .character-overview-dashboard { grid-template-columns: minmax(250px,.6fr) minmax(0,1.4fr); }
    .overview-top-row .positive-buffs-card > div:first-child {
        grid-template-columns: minmax(0,1fr)!important;
    }
    .overview-top-row .positive-buffs-card > div:first-child > button { justify-self: start; }
}
@media (max-width: 760px) {
    .character-overview-dashboard { grid-template-columns: minmax(0,1fr); }
    .left-overview-column,.right-overview-column { grid-column: 1; grid-row: auto; }
    .character-summary-host .fullbody-character-card { height: 370px!important; min-height: 370px!important; }
    .character-overview-dashboard .right-hero-column { height: min(560px,calc(100vh - 100px))!important; max-height: min(560px,calc(100vh - 100px))!important; }
}
@media (max-width: 520px) {
    .overview-top-row { grid-template-columns: minmax(0,1fr); }
}

/* Fixed workspace height: the statistic list scrolls inside its card. */
@media (min-width: 1181px) {
    body.workspace-redesign { height: 100dvh; overflow: hidden; }
    .workspace-redesign .app-layout { height: calc(100dvh - 76px); min-height: 0; overflow: hidden; }
    .workspace-redesign .main-content { height: 100%; min-height: 0; overflow: hidden; }
    .workspace-redesign .workspace-grid { height: 100%; min-height: 0; align-items: stretch; }
    .workspace-redesign .center-workspace { height: 100%; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
    .workspace-redesign .character-system-tabs { flex: 0 0 auto; }
    .workspace-redesign .character-system-panel.active { flex: 1 1 0; min-height: 0; overflow: hidden; }
    .character-overview-dashboard { height: 100%; min-height: 0; align-items: stretch; }
    .left-overview-column { height: 100%; min-height: 0; grid-template-rows: minmax(0,1fr); overflow: hidden; }
    .right-overview-column { height: 100%; min-height: 0; grid-template-rows: auto minmax(0,1fr); overflow: hidden; }
    .character-summary-host .fullbody-character-card { height: auto!important; min-height: 0!important; aspect-ratio: 4 / 3; }
    .character-overview-dashboard .right-stats-panel { height: 100%; min-height: 0; overflow: hidden; }
    .character-overview-dashboard .characteristics-card { height: 100%; min-height: 0; display: flex; flex-direction: column; overflow: hidden; box-sizing: border-box; }
    .character-overview-dashboard .summary-stat-panels { flex: 1 1 0; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
    .character-overview-dashboard .summary-stat-panel.active { min-height: 0; }
    .character-overview-dashboard .right-hero-column { height: 100%!important; min-height: 0!important; max-height: none!important; }
    .inventory-workspace { height: 100%; max-height: none; top: auto; overflow: hidden; }
    .inventory-shell { height: 100%; min-height: 0; padding: 9px; gap: 7px; overflow: hidden; box-sizing: border-box; }
    .inventory-character-host { flex: 0 0 auto; }
    .inventory-quick-controls { flex: 0 0 auto; padding: 7px; gap: 6px; }
    .inventory-quick-controls .selector-group { gap: 3px; }
    .inventory-board { flex: 1 1 auto; min-height: 0; padding: 7px 5px 5px; overflow: hidden; }
    .inventory-board-heading { margin-bottom: 5px; }
    .inventory-dyes-row { margin-bottom: 6px; padding-block: 5px; }
}

/* Equipment effects are switched by source tabs inside the panel. */
.equipment-effects-tabs { position: sticky; top: 0; z-index: 5; flex: 0 0 auto; display: grid; grid-template-columns: repeat(auto-fit,minmax(82px,1fr)); gap: 5px; margin: 0 0 9px; padding: 2px 0 8px; background: linear-gradient(180deg,rgba(10,12,19,.98) 72%,rgba(10,12,19,0)); }
.equipment-effects-tab { min-width: 0; min-height: 32px; padding: 5px 7px; border: 1px solid rgba(255,255,255,.1); border-radius: 7px; overflow: hidden; background: rgba(255,255,255,.035); color: #8e9ca7; font: 700 .59rem var(--project-body-font, 'Geoform'),sans-serif; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; transition: border-color .16s ease,background .16s ease,color .16s ease,box-shadow .16s ease; }
.equipment-effects-tab:hover { border-color: rgba(212,175,55,.38); color: #edf2f4; background: rgba(255,255,255,.065); }
.equipment-effects-tab.active { border-color: rgba(212,175,55,.62); color: #ffe692; background: rgba(212,175,55,.12); box-shadow: inset 0 -2px 0 rgba(212,175,55,.72); }
.equipment-effects-tab[data-equipment-effects-tab="soul"].active { border-color: color-mix(in srgb,var(--soul-effect-color) 72%,transparent); color: var(--soul-effect-color); background: color-mix(in srgb,var(--soul-effect-color) 12%,transparent); box-shadow: inset 0 -2px 0 var(--soul-effect-color); }
.equipment-effects-tab[data-equipment-effects-tab="enchantments"].active { border-color: color-mix(in srgb,var(--enchantment-effect-color) 72%,transparent); color: var(--enchantment-effect-color); background: color-mix(in srgb,var(--enchantment-effect-color) 12%,transparent); box-shadow: inset 0 -2px 0 var(--enchantment-effect-color); }
.equipment-effects-tab[data-equipment-effects-tab="links"].active { border-color: color-mix(in srgb,var(--conditional-effect-color) 72%,transparent); color: var(--conditional-effect-color); background: color-mix(in srgb,var(--conditional-effect-color) 10%,transparent); box-shadow: inset 0 -2px 0 var(--conditional-effect-color); }
.equipment-effects-panel { flex: 0 0 auto; display: grid; gap: 7px; min-width: 0; padding: 1px; }
.equipment-effects-panel[hidden] { display: none!important; }
.equipment-linked-effects-panel { border: 0; background: none; }
.equipment-linked-effect-item { border-color: color-mix(in srgb,var(--conditional-effect-color) 58%,transparent); background: color-mix(in srgb,var(--conditional-effect-color) 8%,transparent); }
.equipment-linked-effect-item[open] { border-color: color-mix(in srgb,var(--conditional-effect-color) 78%,transparent); }
.equipment-linked-effect-item .equipment-effect-status,.equipment-linked-effect-item .equipment-effect-body b { color: var(--conditional-effect-color); }
@media (max-width: 560px) { .equipment-effects-tabs { grid-template-columns: repeat(2,minmax(0,1fr)); } }

/* Preserve 76px cells on tall screens and compact the entire inventory on shorter desktops. */
@media (min-width: 1181px) and (max-height: 1100px) {
    .inventory-workspace .equipment-grid-wrap {
        --inventory-slot-size: 64px;
        --inventory-slot-gap: 6px;
        --inventory-child-slot-size: 32px;
        --inventory-parent-slot-size: 43px;
    }
    .inventory-workspace .fullbody-character-card { height: 148px!important; min-height: 148px!important; }
    .inventory-dyes-row .doll-slot.mini { width: 35px!important; height: 35px!important; }
    .inventory-workspace .special-inline-panels { min-height: 28px; }
    .inventory-workspace .special-instruction-text { margin-top: 3px; }
    .inventory-board-heading span,.inventory-workspace .special-instruction-text span { display: none; }
}
@media (min-width: 1181px) and (max-height: 920px) {
    .inventory-workspace .equipment-grid-wrap {
        --inventory-slot-size: 52px;
        --inventory-slot-gap: 5px;
        --inventory-child-slot-size: 28px;
        --inventory-parent-slot-size: 37px;
    }
    .inventory-workspace .fullbody-character-card { height: 125px!important; min-height: 125px!important; }
    .inventory-workspace .character-overlay-info { padding: 8px 9px 7px; }
    .inventory-workspace .character-save-button { height: 26px; min-width: 66px; padding-inline: 7px; }
    .inventory-quick-controls { padding: 5px; gap: 4px; }
    .inventory-quick-controls .selector-group label { font-size: .56rem; }
    .inventory-quick-controls .constructor-pvp-toggles { gap: 4px; }
    .inventory-dyes-row { padding: 3px 6px; margin-bottom: 4px; }
    .inventory-dyes-row .doll-slot.mini { width: 29px!important; height: 29px!important; }
    .inventory-workspace .special-inline-panels { min-height: 24px; }
}
@media (min-width: 1181px) and (max-height: 790px) {
    .inventory-workspace .equipment-grid-wrap {
        --inventory-slot-size: 44px;
        --inventory-slot-gap: 4px;
        --inventory-child-slot-size: 25px;
        --inventory-parent-slot-size: 32px;
    }
    .inventory-workspace .fullbody-character-card { height: 104px!important; min-height: 104px!important; }
    .inventory-workspace .character-overlay-info { padding: 7px; }
    .inventory-workspace .character-name-row { min-height:24px; padding-bottom:5px; }
    .inventory-workspace .character-profile-meta { grid-template-columns: minmax(0,1fr) 72px auto; gap: 5px; }
    .inventory-workspace .profile-class-control label,.inventory-workspace .profile-level-control label { display: none; }
    .inventory-workspace .profile-class-control select,.inventory-workspace .profile-level-control input { min-height: 27px; height: 27px; }
    .inventory-dyes-row .doll-slot.mini { width: 24px!important; height: 24px!important; }
    .inventory-workspace .special-inline-panels { min-height: 21px; }
}

/* Bottom-left project support control and the sliding QR panel. */
.support-project-widget { position: fixed; left: 16px; bottom: 16px; z-index: 1600; width: min(268px,calc(100vw - 24px)); pointer-events: none; }
.support-project-widget[hidden] { display: none; }
.support-project-toggle { min-height: 42px; padding: 0 17px; pointer-events: auto; border: 1px solid rgba(212,175,55,.52); border-radius: 10px; background: linear-gradient(135deg,rgba(50,43,25,.97),rgba(16,20,28,.97)); box-shadow: 0 10px 32px rgba(0,0,0,.38); color: #ffe49a; font-family: var(--project-body-font, 'Geoform'),sans-serif; font-size: .72rem; font-weight: 800; cursor: pointer; }
.support-project-toggle:hover { border-color:#f1ce67; color:#fff1bd; transform:translateY(-1px); }
.support-project-panel { position: absolute; left: 0; bottom: 52px; width: 100%; padding: 14px; display: grid; gap: 9px; justify-items: center; box-sizing: border-box; border: 1px solid rgba(212,175,55,.34); border-radius: 13px; background: linear-gradient(145deg,rgba(26,32,42,.98),rgba(10,14,21,.98)); box-shadow: 0 24px 60px rgba(0,0,0,.58); opacity: 0; transform: translateY(24px) scale(.98); visibility: hidden; pointer-events: none; transition: opacity .24s ease,transform .24s ease,visibility 0s linear .24s; }
.support-project-widget.open .support-project-panel { opacity: 1; transform: translateY(0) scale(1); visibility: visible; pointer-events: auto; transition-delay: 0s; }
.support-project-panel strong { color:#f7e5a6; font-size:.82rem; text-align:center; }
.support-project-panel img { width:min(220px,100%); aspect-ratio:1; object-fit:contain; border-radius:9px; background:#fff; }
.support-project-panel small { color:#a8b4bd; font-size:.66rem; line-height:1.45; text-align:center; }
.support-project-widget[data-format="compact"] .support-project-panel { grid-template-columns:minmax(0,1fr); justify-items:center; }
.support-project-widget[data-format="compact"] .support-project-panel img { width:min(220px,100%); grid-row:auto; }
.support-project-widget[data-format="compact"] .support-project-panel strong,.support-project-widget[data-format="compact"] .support-project-panel small { text-align:left; }
.support-project-widget[data-format="minimal"] .support-project-panel strong,.support-project-widget[data-format="minimal"] .support-project-panel small { display:none; }
@media (max-width: 680px) { .support-project-widget { left: 8px; bottom: 8px; } }

/* Project-wide scrollbars. */
html,
body,
body * {
    scrollbar-width: thin;
    scrollbar-color: rgba(212,175,55,.72) rgba(8,12,18,.72);
}
body *::-webkit-scrollbar,
html::-webkit-scrollbar,
body::-webkit-scrollbar {
    display: block!important;
    width: 9px;
    height: 9px;
}
body *::-webkit-scrollbar-track,
html::-webkit-scrollbar-track,
body::-webkit-scrollbar-track {
    border: 1px solid rgba(255,255,255,.035);
    border-radius: 999px;
    background: rgba(8,12,18,.72);
}
body *::-webkit-scrollbar-thumb,
html::-webkit-scrollbar-thumb,
body::-webkit-scrollbar-thumb {
    min-height: 34px;
    border: 2px solid rgba(8,12,18,.88);
    border-radius: 999px;
    background: linear-gradient(180deg,rgba(240,203,99,.88),rgba(146,106,26,.9));
    box-shadow: inset 0 0 0 1px rgba(255,235,170,.2),0 0 8px rgba(212,175,55,.16);
}
body *::-webkit-scrollbar-thumb:hover,
html::-webkit-scrollbar-thumb:hover,
body::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg,#f5d778,#b9862b);
}
body *::-webkit-scrollbar-corner { background: rgba(8,12,18,.9); }
.workspace-redesign .priority-sidebar::-webkit-scrollbar,
.workspace-redesign #priority-rating-host::-webkit-scrollbar,
.character-overview-dashboard .right-stats-panel::-webkit-scrollbar,
.inventory-workspace::-webkit-scrollbar {
    display: block!important;
    width: 8px!important;
    height: 8px!important;
}
.workspace-redesign .priority-sidebar,
.workspace-redesign #priority-rating-host,
.character-overview-dashboard .right-stats-panel,
.inventory-workspace {
    scrollbar-width: thin!important;
    scrollbar-color: rgba(212,175,55,.72) rgba(8,12,18,.72)!important;
}

/* Character editor follows the brighter personal-cabinet visual language. */
#character-editor-modal {
    z-index: 4700;
    background: rgba(5,9,14,.72);
    backdrop-filter: blur(9px);
}
.modal-box.character-editor-dialog {
    --modal-max-width: 720px;
    width: min(720px,calc(100vw - 28px));
    max-width: none;
    overflow: hidden;
    border: 1px solid rgba(205,176,101,.34);
    border-radius: 16px;
    background: linear-gradient(145deg,#26303b 0%,#1e2833 46%,#18222c 100%);
    box-shadow: 0 34px 100px rgba(0,0,0,.62),inset 0 1px rgba(255,255,255,.035);
}
.character-editor-dialog .modal-header {
    padding: 18px 20px;
    border-bottom: 1px solid rgba(255,255,255,.09);
    background: linear-gradient(90deg,rgba(244,247,248,.06),rgba(212,175,55,.035));
}
.character-editor-dialog .modal-title { color: #f4f7f8; font-size: 1.02rem; }
.character-editor-dialog .auth-subtitle { margin-top: 5px; color: #9aacb8; }
.character-editor-dialog .modal-close {
    width: 34px;
    height: 34px;
    min-width: 34px;
    padding: 0;
    flex: 0 0 34px;
    display: grid;
    place-items: center;
    box-sizing: border-box;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 9px;
    background: rgba(7,12,18,.42);
    color: #c5d0d7;
    font-family: Arial,sans-serif;
    font-size: 23px;
    line-height: 1;
    appearance: none;
}
.character-editor-dialog .modal-close:hover { border-color: rgba(212,175,55,.42); background: rgba(212,175,55,.1); color: #fff; }
.character-editor-fields {
    padding: 22px!important;
    grid-template-columns: minmax(0,1.25fr) minmax(190px,.75fr);
    gap: 14px!important;
}
.character-editor-fields > label {
    min-width: 0;
    overflow: hidden;
    padding: 12px;
    border: 1px solid rgba(255,255,255,.09);
    border-radius: 11px;
    background: rgba(240,245,247,.045);
    color: #b8c5cd;
    font-size: .68rem;
    font-weight: 700;
}
.character-editor-fields > label:first-of-type { grid-column: 1 / -1; }
.character-editor-fields input,
.character-editor-fields select {
    width: 100%!important;
    max-width: 100%;
    min-width: 0;
    min-height: 40px;
    box-sizing: border-box;
    border-color: rgba(205,176,101,.22);
    background: rgba(8,14,21,.54);
}
.character-editor-fields select { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.character-editor-fields .number-stepper { width: 100%; min-width: 0; box-sizing: border-box; }
.character-editor-dialog .modal-footer {
    padding: 14px 20px 18px;
    gap: 9px;
    border-top: 1px solid rgba(255,255,255,.08);
    background: rgba(7,12,18,.16);
}
.character-editor-dialog .modal-footer button { min-width: 112px; }
@media (max-width: 620px) {
    .character-editor-fields { grid-template-columns: minmax(0,1fr); padding: 14px!important; }
    .character-editor-fields > label:first-of-type { grid-column: 1; }
    .character-editor-dialog .modal-footer { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
    .character-editor-dialog .modal-footer button:last-child { grid-column: 1 / -1; }
}
#project-boot-loader {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 100000;
    background: #090b10;
    color: #e4d2a3;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 18px;
    font-size: 14px;
}
.project-booting #project-boot-loader { display: flex; }
.project-booting #auth-modal, .project-booting #main-3d-stage { visibility: hidden; }
.profile-premium-form { display: flex; align-items: end; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.profile-premium-form label { flex: 1 1 220px; min-width: 0; }
.profile-premium-form button { min-height: 38px; }
#character-editor-change-code-wrap[hidden] { display: none !important; }
.onboarding-races { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0 15px; }
.onboarding-races button { padding: 7px 10px; border: 1px solid rgba(212,175,55,.3); border-radius: 6px; background: rgba(10,14,22,.8); color: #d8dce4; cursor: pointer; }
.onboarding-races button.is-selected { border-color: #d4af37; background: rgba(212,175,55,.17); color: #f8e4a2; }

/* Creation carousel reuses the live character stage: one WebGL renderer only. */
.onboarding-backdrop { background:transparent; backdrop-filter:none; }
.onboarding-backdrop { font-family:var(--creation-font,Geoform),sans-serif; }
.onboarding-backdrop::before { content:""; position:absolute; inset:0; pointer-events:none; background:var(--creation-background-color,#03060c); opacity:var(--creation-background-opacity,0); }
.onboarding-backdrop.creation-hide-race-labels .onboarding-races button>span:last-child,.onboarding-backdrop.creation-hide-class-caption .onboarding-stage-caption { display:none; }
body.is-onboarding .l2-draggable-window,body.is-onboarding #l2-main-footer,body.is-onboarding .victory-header,body.is-onboarding #l2-action-dock,body.is-onboarding .app-layout { visibility:hidden!important; }
.profession-onboarding-dialog { width:100vw!important; max-width:none!important; height:100dvh; max-height:none!important; border:0; border-radius:0; background:transparent; box-shadow:none; backdrop-filter:none; pointer-events:none; }
.profession-onboarding-dialog .modal-header { flex:0 0 auto; padding:14px 26px; border:0; background:linear-gradient(180deg,rgba(3,6,12,.94),rgba(3,6,12,.38)); pointer-events:auto; }
.profession-onboarding-dialog .modal-title { font-size:1.18rem; }
.profession-onboarding-dialog .onboarding-body { position:relative; min-height:0; flex:1; display:flex; flex-direction:column; padding:0 20px 15px; overflow:hidden; pointer-events:none; }
.profession-onboarding-dialog .onboarding-music-toggle { position:absolute; z-index:7; top:12px; right:clamp(16px,2.6vw,44px); min-width:112px; height:32px; padding:0 11px; display:flex; align-items:center; justify-content:space-between; gap:12px; border:1px solid rgba(214,180,104,.48); border-radius:5px; background:linear-gradient(180deg,rgba(33,29,25,.88),rgba(8,11,16,.9)); color:#e8edf4; font:700 .68rem 'Geoform',var(--project-body-font,'Geoform'),sans-serif; letter-spacing:.03em; cursor:pointer; pointer-events:auto; box-shadow:inset 0 0 0 1px rgba(255,255,255,.035),0 4px 14px rgba(0,0,0,.32); }
.profession-onboarding-dialog .onboarding-music-toggle strong { color:#75e7a8; font-size:.7rem; }
.profession-onboarding-dialog .onboarding-music-toggle[aria-pressed="false"] { border-color:rgba(137,148,164,.35); color:#9ca7b5; }
.profession-onboarding-dialog .onboarding-music-toggle[aria-pressed="false"] strong { color:#f08383; }
.profession-onboarding-dialog .onboarding-music-toggle:hover { border-color:#e7c77a; filter:brightness(1.1); }
@media (max-width:680px) { .profession-onboarding-dialog .onboarding-music-toggle { top:7px; right:8px; min-width:96px; height:29px; padding:0 8px; font-size:.61rem; } }
.onboarding-character-rotate-surface { position:absolute; z-index:1; left:20%; right:20%; top:16%; bottom:27%; cursor:grab; touch-action:none; pointer-events:auto; outline:none; }
.onboarding-character-rotate-surface:active { cursor:grabbing; }
.onboarding-character-rotate-surface:focus-visible { outline:1px solid rgba(239,198,103,.72); outline-offset:-2px; }
.onboarding-races { position:relative; z-index:4; flex:0 0 auto; margin:4px auto; padding:5px; max-width:100%; display:flex; flex-wrap:nowrap; gap:12px; overflow-x:auto; border:0; border-radius:0; background:transparent; pointer-events:auto; }
.onboarding-races button,.onboarding-races button.is-selected { min-width:72px; padding:3px 4px; display:grid; justify-items:center; gap:2px; border:0; border-radius:0; background:transparent; color:#d8dce4; font-size:.69rem; white-space:nowrap; }
.onboarding-race-mark { width:62px; height:62px; display:grid; place-items:center; border:0; border-radius:0; background:transparent; color:#f4d999; }
.onboarding-race-mark img { display:block; width:58px; height:58px; object-fit:contain; filter:drop-shadow(0 2px 3px rgba(0,0,0,.6)); transition:transform .2s ease,filter .2s ease; }
.onboarding-races button:hover .onboarding-race-mark img,.onboarding-races button.is-selected .onboarding-race-mark img { transform:scale(1.12); filter:drop-shadow(0 0 9px rgba(242,205,122,.72)); }
.onboarding-races button.is-selected { color:#f7dfa1; }
.onboarding-genders { position:absolute; z-index:5; right:clamp(18px,3vw,52px); top:58%; display:grid; grid-template-columns:repeat(2,90px); gap:8px; color:#d3b97c; pointer-events:auto; }
.onboarding-genders>span { grid-column:1/-1; font-size:.76rem; text-align:center; }
.onboarding-genders button { min-height:94px; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:1px; padding:4px; border:1px solid rgba(209,182,119,.45); border-radius:8px; background:rgba(6,10,18,.68); color:#e2e3e8; cursor:pointer; font:inherit; font-size:.75rem; transition:border-color .18s,background .18s,box-shadow .18s; }
.onboarding-genders button img { display:block; width:58px; height:58px; object-fit:contain; filter:drop-shadow(0 2px 3px rgba(0,0,0,.7)); }
.onboarding-genders button span { line-height:1.15; }
.onboarding-genders button:hover:not(:disabled) { border-color:#f2d48d; box-shadow:0 0 13px rgba(222,174,77,.24); }
.onboarding-genders button.is-selected { border-color:#e7c77a; background:rgba(167,120,55,.25); color:#ffe4a4; }
.onboarding-genders button:disabled { opacity:.38; cursor:not-allowed; }
.onboarding-genders small { grid-column:1/-1; max-width:188px; min-height:1em; color:#bec8d4; font-size:.6rem; text-align:center; }
.onboarding-stage-controls { position:absolute; z-index:4; left:50%; bottom:clamp(164px,21vh,230px); width:min(440px,65vw); height:64px; transform:translateX(-50%); display:flex; align-items:center; justify-content:space-between; gap:10px; pointer-events:none; }
.onboarding-carousel-arrow { flex:0 0 60px; width:60px; height:60px; border:0; border-radius:0; background:transparent center/52px 52px no-repeat; cursor:pointer; pointer-events:auto; transition:transform .18s,filter .18s; }
#onboarding-race-prev { background-image:url('/static/images/onboarding-controls/Arrow_left.png'); }
#onboarding-race-prev:hover,#onboarding-race-prev:focus-visible { background-image:url('/static/images/onboarding-controls/Arrow_left_a.png'); }
#onboarding-race-next { background-image:url('/static/images/onboarding-controls/Arrow_right.png'); }
#onboarding-race-next:hover,#onboarding-race-next:focus-visible { background-image:url('/static/images/onboarding-controls/Arrow_right_a.png'); }
.onboarding-carousel-arrow:hover { transform:scale(1.1); filter:drop-shadow(0 0 9px rgba(229,181,85,.5)); }
.onboarding-carousel-arrow:focus-visible { outline:2px solid #f0ce7c; outline-offset:2px; }
.onboarding-stage-caption { align-self:flex-end; margin-bottom:0; padding:4px 8px; display:grid; justify-items:center; gap:2px; border:0; border-radius:0; background:transparent; color:#e8ebf0; text-align:center; text-shadow:0 2px 6px #000,0 0 10px #000; }
.onboarding-stage-caption span { color:#d6b36b; font-size:.66rem; }
.onboarding-stage-caption strong { font-size:.88rem; }
.onboarding-bottom { position:relative; z-index:4; flex:0 0 auto; min-height:0; width:min(1100px,100%); margin:auto auto 0; padding:5px 10px; border:0; border-radius:0; background:transparent; pointer-events:auto; text-shadow:0 2px 5px #000; }
.onboarding-class-heading { margin:0 2px 3px; display:flex; justify-content:space-between; gap:10px; color:#f3dfa7; font-size:.72rem; }
.onboarding-class-heading small { color:#a8b1bd; font-size:.61rem; }
.profession-onboarding-dialog .profession-tile-grid { display:flex; max-height:none; gap:10px; overflow-x:auto; overflow-y:hidden; padding:2px 2px 8px; scroll-snap-type:x proximity; }
.profession-onboarding-dialog .profession-tile,.profession-onboarding-dialog .profession-tile:hover { flex:0 0 104px; width:104px; min-height:75px; display:grid; grid-template-columns:1fr; grid-template-rows:49px auto; justify-items:center; align-items:center; gap:2px; padding:2px 4px; border:0; border-radius:0; background:transparent; box-shadow:none; text-align:center; scroll-snap-align:center; }
.profession-onboarding-dialog .profession-tile:hover { transform:translateY(-2px); }
.profession-onboarding-dialog .profession-tile.is-selected { background:transparent; box-shadow:none; }
.profession-onboarding-dialog .profession-tile-image { grid-row:auto; width:48px; height:49px; aspect-ratio:auto; overflow:visible; border:0; border-radius:0; background:transparent; }
.profession-onboarding-dialog .profession-tile-image img { object-fit:contain; object-position:center; filter:drop-shadow(0 2px 4px rgba(0,0,0,.65)); }
.profession-onboarding-dialog .profession-tile.is-selected .profession-tile-image img { filter:drop-shadow(0 0 11px rgba(239,198,103,.8)); }
.profession-onboarding-dialog .profession-tile strong { align-self:start; color:#e8ebf0; white-space:normal; line-height:1.1; font-size:.68rem; }
.profession-onboarding-dialog .profession-tile.is-selected strong { color:#f4d796; }
.onboarding-continue { display:block; min-height:30px; margin:3px auto 0; padding:3px 15px; border:0; }
@media (max-width:680px) { .profession-onboarding-dialog .modal-header { padding:9px 13px; }.profession-onboarding-dialog .onboarding-body { padding:0 7px 7px; }.onboarding-races { gap:4px; }.onboarding-races button,.onboarding-races button.is-selected { min-width:58px; font-size:.56rem; }.onboarding-race-mark { width:36px; height:36px; }.onboarding-race-mark img { width:34px; height:34px; }.onboarding-genders { position:relative; right:auto; top:auto; margin:0 auto; display:flex; flex-wrap:wrap; justify-content:center; align-items:center; gap:5px; min-width:0; }.onboarding-genders>span { width:100%; }.onboarding-genders button { padding:4px 8px; }.onboarding-genders small { width:100%; max-width:none; }.onboarding-carousel-arrow { width:37px; height:56px; font-size:2.2rem; }.profession-onboarding-dialog .profession-tile { flex-basis:96px; width:96px; } }
@media (max-width:680px) { .onboarding-races { width:min(125px,36vw); max-width:none; margin-left:8px; margin-right:auto; }.onboarding-genders { position:absolute; right:8px; top:56%; margin:0; display:grid; grid-template-columns:repeat(2,65px); gap:4px; min-width:0; }.onboarding-genders>span,.onboarding-genders small { grid-column:1/-1; width:auto; }.onboarding-genders button { min-height:69px; padding:2px; font-size:.62rem; }.onboarding-genders button img { width:40px; height:40px; }.onboarding-stage-controls { width:min(76vw,360px); bottom:clamp(145px,22vh,188px); height:48px; }.onboarding-carousel-arrow { flex-basis:46px; width:46px; height:46px; background-size:39px 39px; }.onboarding-stage-caption { font-size:.7rem; } }
@media (max-width:680px) { .onboarding-character-rotate-surface { left:14%; right:14%; top:18%; bottom:31%; } }
.profession-tile[hidden] { display: none !important; }
/* Server-configurable creation interface; caps retain a usable mobile carousel. */
.profession-onboarding-dialog .modal-title { color:var(--creation-title-color,#f8fafc);font-size:var(--creation-title-size,19px); }
.profession-onboarding-dialog .onboarding-races { margin-top:var(--creation-race-top,4px);transform:translateX(var(--creation-race-left,0px)); }
.profession-onboarding-dialog .onboarding-bottom { width:min(var(--creation-class-width,1100px),100%);margin-bottom:var(--creation-class-bottom,0px); }
.profession-onboarding-dialog .auth-subtitle,.profession-onboarding-dialog .onboarding-stage-caption,.profession-onboarding-dialog .profession-tile strong { color:var(--creation-label-color,#e8ebf0); }
.profession-onboarding-dialog .onboarding-races button.is-selected,.profession-onboarding-dialog .profession-tile.is-selected strong,.profession-onboarding-dialog .onboarding-class-heading,.profession-onboarding-dialog .onboarding-stage-caption span { color:var(--creation-accent-color,#f4d796); }
.profession-onboarding-dialog .onboarding-race-mark { width:calc(var(--creation-race-icon,58px) + 4px);height:calc(var(--creation-race-icon,58px) + 4px); }
.profession-onboarding-dialog .onboarding-race-mark img { width:var(--creation-race-icon,58px);height:var(--creation-race-icon,58px); }
.profession-onboarding-dialog .onboarding-genders { top:var(--creation-gender-top,58%);right:var(--creation-gender-right,3%); }
.profession-onboarding-dialog .onboarding-genders button { border-color:var(--creation-gender-border,#d1b677); }
.profession-onboarding-dialog .onboarding-genders button.is-selected { border-color:var(--creation-accent-color,#f4d796); }
.profession-onboarding-dialog .onboarding-genders button img { width:var(--creation-gender-icon,58px);height:var(--creation-gender-icon,58px); }
.profession-onboarding-dialog .onboarding-stage-controls { width:min(var(--creation-arrow-spread,440px),75vw);bottom:clamp(120px,var(--creation-arrow-bottom,21vh),320px); }
.profession-onboarding-dialog .onboarding-carousel-arrow { flex-basis:var(--creation-arrow-icon,52px);width:var(--creation-arrow-icon,52px);height:var(--creation-arrow-icon,52px);background:none!important;display:grid;place-items:center; }
.profession-onboarding-dialog .onboarding-carousel-arrow img { grid-area:1/1;width:100%;height:100%;object-fit:contain; }
.profession-onboarding-dialog .onboarding-carousel-arrow .arrow-hover { opacity:0; }
.profession-onboarding-dialog .onboarding-carousel-arrow:hover .arrow-hover,.profession-onboarding-dialog .onboarding-carousel-arrow:focus-visible .arrow-hover { opacity:1; }
.profession-onboarding-dialog .onboarding-carousel-arrow:hover .arrow-normal,.profession-onboarding-dialog .onboarding-carousel-arrow:focus-visible .arrow-normal { opacity:0; }
.profession-onboarding-dialog .profession-tile-image { width:var(--creation-class-icon,48px);height:var(--creation-class-icon,48px); }
.profession-onboarding-dialog .profession-tile strong { font-size:var(--creation-class-name-size,11px); }
.profession-onboarding-dialog .onboarding-continue { font-size:var(--creation-continue-size,13px); }
.profession-onboarding-dialog .onboarding-bottom { width:min(var(--creation-class-width,2400px),100%);padding-inline:4px; }
.profession-onboarding-dialog .profession-tile-grid { width:100%;box-sizing:border-box; }
.profession-onboarding-dialog .onboarding-create-row { display:flex;align-items:center;justify-content:center;gap:10px;min-height:44px;margin:0 0 8px;pointer-events:auto; }
.profession-onboarding-dialog .onboarding-create-row label { color:var(--creation-label-color,#e8ebf0);font-size:.72rem;white-space:nowrap; }
.profession-onboarding-dialog #onboarding-character-name { width:clamp(150px,20vw,260px);min-width:0;height:36px;box-sizing:border-box;border:1px solid rgba(212,175,55,.45);border-radius:6px;background:rgba(7,10,17,.84);color:#fff;padding:7px 10px;font:inherit;font-size:.75rem; }
.profession-onboarding-dialog #onboarding-character-name:focus { outline:1px solid var(--creation-accent-color,#f4d796);outline-offset:1px; }
.profession-onboarding-dialog .onboarding-continue { position:relative;display:grid;place-items:center;flex:0 0 185px;width:185px;height:38px;min-height:38px;margin:0;padding:0;border:0;border-radius:0;background:transparent!important;box-shadow:none!important;color:#fff4d4;font-weight:800;cursor:pointer;text-shadow:0 1px 3px #000; }
.profession-onboarding-dialog .onboarding-continue img,.profession-onboarding-dialog .onboarding-continue span { grid-area:1/1; }
.profession-onboarding-dialog .onboarding-continue img { width:100%;height:100%;object-fit:fill;pointer-events:none; }
.profession-onboarding-dialog .onboarding-continue span { position:relative;z-index:1; }
.profession-onboarding-dialog .onboarding-continue:hover { filter:brightness(1.18);transform:translateY(-1px); }
.profession-onboarding-dialog .onboarding-continue:disabled { opacity:.58;cursor:wait; }
body.is-onboarding:not(.onboarding-preview-ready) #main-3d-canvas { visibility:hidden; }
body.is-onboarding > :not(#main-3d-stage):not(#profession-onboarding-modal):not(#onboarding-server-modal):not(#message-modal):not(#project-boot-loader):not(script):not(style):not(link) { visibility:hidden!important; }
:is(#l2-window-inventory,.inventory-equivalent) .inventory-shell { padding-inline:3px!important; }
:is(#l2-window-inventory,.inventory-equivalent) .inventory-board { padding-inline:3px!important; }
:is(#l2-window-inventory,.inventory-equivalent) .l2-window-body { padding-inline:5px!important; }
.profession-onboarding-dialog .onboarding-weapon-choices { position:absolute;z-index:5;left:clamp(18px,3vw,52px);top:48%;display:flex;align-items:center;gap:7px;pointer-events:auto;color:#d8c28c;font-size:.7rem; }
.profession-onboarding-dialog .onboarding-weapon-choices[hidden] { display:none!important; }
.profession-onboarding-dialog .onboarding-weapon-choices button { min-height:30px;padding:4px 11px;border:1px solid rgba(210,175,104,.4);border-radius:5px;background:rgba(8,12,18,.78);color:#e9e4d7;font:inherit;cursor:pointer; }
.profession-onboarding-dialog .onboarding-weapon-choices button.is-selected { border-color:#e9c778;background:rgba(142,103,43,.38);color:#ffe7ac; }
@media (max-width:680px) { .profession-onboarding-dialog .onboarding-weapon-choices { top:43%;left:12px;flex-wrap:wrap;max-width:180px;gap:4px; }.profession-onboarding-dialog .onboarding-weapon-choices span { flex-basis:100%; }.profession-onboarding-dialog .onboarding-weapon-choices button { min-height:27px;padding:3px 7px; } }
.number-stepper-controls button[data-number-step] { font-size:0!important;color:transparent!important; }
@media (max-width:680px) {
 .profession-onboarding-dialog .onboarding-race-mark { width:clamp(28px,calc(var(--creation-race-icon,58px) * .65),58px);height:clamp(28px,calc(var(--creation-race-icon,58px) * .65),58px); }
 .profession-onboarding-dialog .onboarding-race-mark img { width:100%;height:100%; }
 .profession-onboarding-dialog .onboarding-genders { top:var(--creation-gender-top,58%);right:var(--creation-gender-right,3%); }
 .profession-onboarding-dialog .onboarding-genders button img { width:clamp(28px,calc(var(--creation-gender-icon,58px) * .7),70px);height:clamp(28px,calc(var(--creation-gender-icon,58px) * .7),70px); }
 .profession-onboarding-dialog .onboarding-carousel-arrow { flex-basis:clamp(32px,calc(var(--creation-arrow-icon,52px) * .75),68px);width:clamp(32px,calc(var(--creation-arrow-icon,52px) * .75),68px);height:clamp(32px,calc(var(--creation-arrow-icon,52px) * .75),68px); }
 .profession-onboarding-dialog .onboarding-create-row { flex-wrap:wrap;gap:5px;justify-content:center;margin-bottom:5px; }
 .profession-onboarding-dialog .onboarding-create-row label { width:100%;text-align:center;font-size:.65rem; }
 .profession-onboarding-dialog #onboarding-character-name { width:min(42vw,190px);height:32px; }
 .profession-onboarding-dialog .onboarding-continue { flex-basis:120px;width:120px;height:32px;min-height:32px; }
}

/* UI-014: character creation controls stay readable over the permanent base scene. */
.profession-onboarding-dialog .onboarding-gender-panel {
    position: absolute; z-index: 7; top: var(--creation-gender-top, 58%); right: var(--creation-gender-right, 3%);
    display: grid; justify-items: center; gap: 8px; pointer-events: auto;
}
.profession-onboarding-dialog .onboarding-gender-panel .onboarding-genders { position: static; inset: auto; }
.profession-onboarding-dialog .onboarding-gender-panel .onboarding-music-toggle { position: static; width: min(172px, 100%); min-width: 0; height: 32px; }
.profession-onboarding-dialog .onboarding-bottom {
    padding: 9px 12px 11px; border: 1px solid rgba(194,166,108,.2); border-radius: 3px;
    background: linear-gradient(180deg,rgba(3,7,13,.52),rgba(2,5,10,.82));
    box-shadow: 0 8px 28px rgba(0,0,0,.36), inset 0 1px rgba(255,255,255,.025);
}
.onboarding-server-backdrop { z-index: 4700; background: rgba(1,4,9,.74); }
.onboarding-server-dialog { width: min(760px,calc(100vw - 28px)); max-height: min(720px,calc(100dvh - 28px)); }
.onboarding-server-list { display: grid; grid-template-columns: repeat(auto-fit,minmax(190px,1fr)); gap: 10px; }
.onboarding-server-state { grid-column: 1/-1; padding: 28px; color: var(--text-muted,#aab2bd); text-align: center; }
.onboarding-server-card {
    min-height: 132px; padding: 0; overflow: hidden; display: grid; grid-template-rows: 92px auto;
    border: 1px solid rgba(185,154,91,.32); border-radius: 3px; background: rgba(5,9,15,.9);
    color: #eef2f7; cursor: pointer; text-align: left;
    transition: border-color .16s ease,box-shadow .16s ease,transform .16s ease;
}
.onboarding-server-card:hover { transform: translateY(-1px); border-color: rgba(231,199,122,.7); }
.onboarding-server-card.is-selected { border-color: #e7c77a; box-shadow: 0 0 0 1px rgba(231,199,122,.28),0 0 18px rgba(214,170,74,.22); }
.onboarding-server-preview { background: linear-gradient(145deg,rgba(29,39,52,.92),rgba(7,11,18,.96)); background-position: center; background-size: cover; }
.onboarding-server-preview img { display:block; width:100%; height:100%; object-fit:cover; }
.onboarding-server-card strong { padding: 11px 12px 12px; font-size: .82rem; }
.character-server-name { color: var(--character-server-color,#d7b86c); white-space: nowrap; }
@media (max-width:680px) {
    .profession-onboarding-dialog .onboarding-gender-panel { top: var(--creation-gender-top,58%); right: var(--creation-gender-right,3%); gap: 5px; }
    .profession-onboarding-dialog .onboarding-gender-panel .onboarding-genders { position: static; margin: 0; }
    .profession-onboarding-dialog .onboarding-gender-panel .onboarding-music-toggle { width: 134px; height: 29px; }
    .profession-onboarding-dialog .onboarding-bottom { padding: 6px 7px 8px; }
    .onboarding-server-list { grid-template-columns: 1fr 1fr; }
}

/* Unified horizontal loaders. Circular spinners are intentionally not used. */
.l2-loader-bar {
    position: relative;
    display: block;
    width: min(180px, 100%);
    height: 5px;
    overflow: hidden;
    border: 1px solid rgba(212,175,55,.28);
    border-radius: 999px;
    background: rgba(255,255,255,.075);
    box-shadow: inset 0 1px 3px rgba(0,0,0,.42), 0 0 12px rgba(212,175,55,.08);
}
.l2-loader-bar > span {
    position: absolute;
    inset-block: 0;
    left: -42%;
    width: 42%;
    border-radius: inherit;
    background: linear-gradient(90deg,transparent,#b98a32 18%,#f5d778 58%,#fff0bd 76%,transparent);
    box-shadow: 0 0 12px rgba(245,215,120,.72);
    animation: l2-loader-bar-slide 1.05s ease-in-out infinite;
}
.l2-loader-bar.is-compact { width: 58px; height: 4px; }
@keyframes l2-loader-bar-slide {
    0% { left: -42%; }
    100% { left: 100%; }
}
.ui-symbol.icon-spinner.is-spinning {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 5px;
    overflow: hidden;
    border: 1px solid rgba(212,175,55,.28);
    border-radius: 999px;
    background: rgba(255,255,255,.075);
    animation: none !important;
    vertical-align: middle;
}
.ui-symbol.icon-spinner.is-spinning::before {
    content: '' !important;
    position: absolute;
    inset-block: 0;
    left: -48%;
    width: 48%;
    border-radius: inherit;
    background: linear-gradient(90deg,transparent,#d0a74d,#ffe59a,transparent);
    animation: l2-loader-bar-slide .9s ease-in-out infinite;
}
.profile-character-loading.is-loading,
.saved-builds-loading,
.enchantment-stone-empty.is-loading,
.forgotten-power-empty.is-loading,
.registration-mode-help.is-loading,
#modal-picker-families:has(.l2-loader-bar),
#manual-enchant-effect-preview:has(.l2-loader-bar) {
    display: grid;
    justify-items: center;
    gap: 9px;
    padding: 18px;
    color: var(--text-muted);
    font-size: .7rem;
    text-align: center;
}
.registration-mode-help.is-loading { justify-items: start; padding: 0; text-align: left; }
.comparison-characteristics-loader .comparison-loader-bar { width: 180px; }

/* Password visibility and Caps Lock feedback for every password form. */
.password-input-shell {
    position: relative;
    display: block;
    width: 100%;
    min-width: 0;
}
.password-input-shell > input { padding-right: 46px !important; }
.password-visibility-toggle {
    position: absolute;
    z-index: 2;
    top: 50%;
    right: 5px;
    width: 34px;
    height: 30px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #8f9dab;
    cursor: pointer;
    transform: translateY(-50%);
}
.password-visibility-toggle::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 8px;
    width: 16px;
    height: 11px;
    border: 1.5px solid currentColor;
    border-radius: 55% 0 55% 0;
    transform: rotate(45deg);
}
.password-visibility-toggle::after {
    content: '';
    position: absolute;
    left: 15px;
    top: 12px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
}
.password-visibility-toggle:hover,
.password-visibility-toggle.is-visible { background: rgba(212,175,55,.1); color: #f0cf77; }
.password-visibility-toggle:focus-visible { outline: 2px solid #f0cf77; outline-offset: 1px; }
.password-input-shell.caps-lock-active > input { border-color: rgba(245,158,11,.72) !important; }
.password-caps-warning {
    margin-top: 5px;
    color: #f6b94a;
    font-size: .64rem;
    font-weight: 700;
    line-height: 1.3;
}
.password-caps-warning[hidden] { display: none !important; }

@media (prefers-reduced-motion: reduce) {
    .l2-loader-bar > span,
    .ui-symbol.icon-spinner.is-spinning::before { animation-duration: 2s; }
}
.profile-access-request-form { display: grid; gap: 9px; margin-top: 12px; padding-top: 12px; border-top: 1px solid rgba(212, 175, 55, .18); }
.profile-access-request-form label { display: grid; gap: 5px; min-width: 0; color: var(--text-sub); font-size: .72rem; }
.profile-access-request-form textarea { resize: vertical; min-height: 70px; }
.profile-access-requests, .profile-access-codes { display: grid; gap: 8px; margin-top: 10px; }
.profile-access-request, .profile-access-code { padding: 9px; border: 1px solid rgba(212, 175, 55, .2); border-radius: 8px; background: rgba(4, 6, 10, .55); overflow-wrap: anywhere; }
.profile-access-request strong, .profile-access-request small, .profile-access-code span, .profile-access-code code { display: block; }
.profile-access-request strong, .profile-access-codes > strong { color: #f2d991; font-size: .75rem; }
.profile-access-request small, .profile-access-code span { color: var(--text-muted); font-size: .66rem; }
.profile-access-request p { margin: 5px 0 0; font-size: .7rem; }
.profile-access-request .profile-access-reply { color: #9fe2bf; }
.profile-access-code code { margin: 7px 0; color: #fff; font-size: .78rem; user-select: all; }
.premium-locked-rating #priority-rating-host { display: none !important; }

/* UI-011: one configurable palette for nested effects and rating positions. */
:root {
    --soul-effect-color:#3b82f6; --soul-effect-background:#102443; --soul-effect-text:#d7e9ff;
    --enchantment-effect-color:#8b5cf6; --enchantment-effect-background:#21183a; --enchantment-effect-text:#e9ddff;
    --conditional-effect-color:#f0d477; --relation-effect-background:#332d1c; --relation-effect-text:#f6e7a8;
    --rating-first-color:#34d399; --rating-second-color:#f59e0b; --rating-third-color:#ef4444;
    --craft-effect-color:#e8cb71; --craft-effect-background:#282214; --craft-effect-text:#f7e8b4;
}
.equipment-effect-item.soul-effect-block,
.item-attachment-effect-section.soul {
    background:var(--soul-effect-background)!important;
    color:var(--soul-effect-text);
}
.equipment-effect-item.enchantment-effect-block,
.item-attachment-effect-section.enchantment,
.comp-attachment-entry.enchant {
    background:var(--enchantment-effect-background)!important;
    color:var(--enchantment-effect-text);
}
.item-attachment-effect-section.soul .item-detail-lines span { color:var(--soul-effect-text); }
.item-attachment-effect-section.enchantment .item-detail-lines span { color:var(--enchantment-effect-text); }
.equipment-linked-effect,
.equipment-linked-effect-item,
.item-attachment-effect-section.relation-description-effect {
    border-color:color-mix(in srgb,var(--conditional-effect-color) 58%,transparent)!important;
    background:var(--relation-effect-background)!important;
    color:var(--relation-effect-text);
}
.equipment-linked-effect p,
.equipment-linked-effect-item .equipment-effect-body,
.item-attachment-effect-section.relation-description-effect .item-detail-lines span {
    color:var(--relation-effect-text);
}
.equipment-effects-tab[data-equipment-effects-tab="soul"]:hover { border-color:var(--soul-effect-color); color:var(--soul-effect-text); background:var(--soul-effect-background); }
.equipment-effects-tab[data-equipment-effects-tab="enchantments"]:hover { border-color:var(--enchantment-effect-color); color:var(--enchantment-effect-text); background:var(--enchantment-effect-background); }
.equipment-effects-tab[data-equipment-effects-tab="links"]:hover { border-color:var(--conditional-effect-color); color:var(--relation-effect-text); background:var(--relation-effect-background); }

/* 2026-09-30: compact account layout, topmost confirmations and support UI. */
#message-modal.active { z-index:200000!important; }
#support-modal { z-index:12000; }
.l2-footer-support {
    position:static; z-index:3; min-height:29px; padding:4px 18px;
    border:1px solid rgba(212,175,55,.48); border-radius:3px;
    background:linear-gradient(180deg,rgba(212,175,55,.18),rgba(103,76,20,.12));
    box-shadow:0 4px 14px rgba(0,0,0,.35),inset 0 1px rgba(255,255,255,.08);
    color:#f7dda0; font:750 .72rem var(--project-body-font,'Geoform'),sans-serif;
    letter-spacing:.03em; cursor:pointer; transform:none;
}
.l2-footer-support-wrap { display:flex; align-items:center; justify-content:center; flex:0 0 auto; min-width:max-content; margin-left:12px; }
.l2-footer-support:hover { border-color:#f4d77f; color:#fff4c6; }
.support-dialog { width:min(430px,calc(100vw - 28px)); }
.support-dialog-body { display:grid; justify-items:center; gap:14px; text-align:center; }
.support-dialog-body img { display:block; width:min(280px,80vw); max-height:48vh; object-fit:contain; border-radius:3px; background:#fff; }
.support-dialog-body p { margin:0; color:var(--text-sub); font-size:.76rem; line-height:1.55; white-space:pre-line; }

.auth-dialog.account-mode .profile-character-slots {
    grid-template-columns:repeat(3,minmax(0,1fr)); grid-auto-flow:row; grid-auto-columns:auto;
    max-height:none; overflow-x:hidden; overflow-y:auto;
}
.auth-dialog.account-mode .profile-character-slot { min-width:0; grid-template-columns:46px minmax(0,1fr); }
.auth-dialog.account-mode .profile-character-avatar { width:46px; height:46px; }
.auth-dialog.account-mode .profile-character-status { grid-column:2; justify-self:start; }
.onboarding-server-dialog { width:min(380px,calc(100vw - 28px)); }
.onboarding-server-list { grid-template-columns:1fr; }
.onboarding-server-card { min-height:112px; grid-template-rows:76px auto; }

.comp-result-overview { container-type:inline-size; }
.comp-result-costs > div { grid-template-columns:max-content minmax(0,1fr); gap:6px; }
.comp-result-costs > div > span { font-size:clamp(6.5px,2.6cqi,11px); white-space:nowrap; }
.comp-result-costs > div > strong,
.comp-result-costs > div > strong > span {
    overflow:visible; font-size:clamp(6.5px,2.8cqi,12px); letter-spacing:-.02em; white-space:nowrap;
}
.progression-calculation-loader {
    position:sticky; top:0; z-index:20; margin:0 0 8px; padding:7px 10px;
    display:flex; align-items:center; justify-content:center; gap:10px;
    border:1px solid rgba(212,175,55,.24); border-radius:3px; background:rgba(5,8,13,.92);
    color:#e7d8a2; font-size:.67rem; box-shadow:0 5px 16px rgba(0,0,0,.32);
}
.progression-calculation-loader[hidden] { display:none; }
.progression-calculation-loader .l2-loader-bar { width:min(150px,45%); }

.victory-main-logo {
    position:fixed; z-index:1; top:0; right:clamp(12px,2vw,32px);
    width:clamp(360px,44vw,820px); height:auto; max-width:calc(100vw - 24px); max-height:none; object-fit:contain; pointer-events:none;
    mix-blend-mode:screen; filter:drop-shadow(0 6px 16px rgba(0,0,0,.78)) saturate(1.05);
    transform:none;
}
.victory-header::after { display:none!important; }
body.is-onboarding .victory-main-logo { display:none; }
@media (max-width:1100px) {
    .auth-dialog.account-mode .profile-character-slots { grid-template-columns:repeat(2,minmax(0,1fr)); }
    .victory-main-logo { width:min(48vw,480px); }
}
@media (max-width:720px) {
    .auth-dialog.account-mode .profile-character-slots { grid-template-columns:1fr; }
    .l2-footer-support-wrap { margin-left:6px; }
    .l2-footer-support { padding-inline:10px; }
    .victory-main-logo { width:min(42vw,220px); }
}

/* Keep the text clear of the characteristics card and its blue progress panel. */
.character-overview-dashboard .characteristics-card { padding-inline:16px; box-sizing:border-box; }
#l2-window-stats .characteristics-card { padding-inline:16px !important; box-sizing:border-box; }
.characteristics-card #base-stats-summary,
.characteristics-card .summary-stat-panels { padding-inline:8px; box-sizing:border-box; }
.characteristics-card .progress-stats-summary { padding:14px 16px; }

/* UI-018: client-style settings, independent category column and content. */
#audio-settings-modal .audio-settings-dialog { width:min(800px, calc(100vw - 24px)); max-width:800px; background:rgba(23,23,18,.98); border:1px solid #78694a; border-radius:3px; }
#audio-settings-modal .modal-header { justify-content:center; padding:10px 36px; border-bottom:1px solid #77694d; }
#audio-settings-modal .modal-header .modal-close { position:absolute; right:10px; top:8px; }
#audio-settings-modal .settings-layout { display:grid; grid-template-columns:125px minmax(0,1fr); gap:0; padding:0; min-height:320px; max-height:70vh; overflow:hidden; }
.settings-navigation { display:flex; flex-direction:column; background:rgba(0,0,0,.22); border-right:1px solid #77694d; }
.settings-navigation button { min-height:48px; padding:10px 12px; background:linear-gradient(#302d26,#191916); color:#d7d3c6; border:0; border-bottom:1px solid #655a42; border-radius:0; text-align:right; cursor:pointer; }
.settings-navigation button.active { background:linear-gradient(90deg,#29251a,#6a5422); color:#efd36e; box-shadow:inset -3px 0 #bd9e48; }
.settings-content { min-width:0; padding:16px; overflow:auto; color:#c9c5b9; }
.settings-content h3 { color:#e8dfc8; font-size:16px; margin:0 0 16px; padding-bottom:8px; border-bottom:1px solid #574d36; }
.settings-content .profile-audio-toggle-row { flex-wrap:wrap; gap:14px; }
.settings-content .profile-audio-volume-row { display:grid; grid-template-columns:1fr; gap:16px; }
.settings-content input[type=range] { accent-color:#bda356; }
.settings-content input[type=checkbox] { accent-color:#bda356; width:16px; height:16px; }
.settings-content [hidden] { display:none !important; }
.settings-toggle { display:flex; gap:10px; align-items:center; }
.settings-content,.settings-content h3,.settings-navigation button,.settings-navigation button.active { color:#fff; }
.settings-toggle-row { display:flex; align-items:center; justify-content:space-between; gap:12px; width:100%; padding:10px 8px; box-sizing:border-box; color:#fff; }
#audio-settings-modal [data-settings-panel="character"] { display:flex; flex-direction:column; min-height:100%; }
#audio-settings-modal .settings-option-block { padding-bottom:18px; }
#audio-settings-modal .settings-option-block p { margin:4px 8px 0; }
#audio-settings-modal .settings-option-block p,
#audio-settings-modal .settings-reset-action p { text-align:left; line-height:1.55; color:#fff; }
#audio-settings-modal .settings-reset-actions { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:24px; margin-top:auto; padding:20px 8px 0; border-top:1px solid #574d36; }
#audio-settings-modal .settings-reset-action { display:flex; flex-direction:column; align-items:flex-start; gap:12px; min-width:0; }
#audio-settings-modal .settings-reset-action p { margin:0; font-size:12px; }
#audio-settings-modal .settings-reset-action button { margin-top:auto; max-width:100%; }
#audio-settings-modal .settings-reset-action-equipment { align-items:flex-end; }
.settings-switch { position:relative; display:inline-block; flex:0 0 40px; width:40px; height:22px; }
.l2-footer-character-name { display:inline-flex; align-items:center; gap:5px; min-width:0; }
.footer-premium-wing { width:28px; height:28px; object-fit:contain; flex-shrink:0; }
#hero-tales-subcategories-nav button { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:4px; }
.hero-subcategory-icon { width:calc(32px * var(--skill-scale,1)); height:calc(32px * var(--skill-scale,1)); object-fit:contain; border-radius:3px; }
#character-footer-name { max-width:none; overflow:visible; }
#audio-settings-modal .settings-switch input { position:absolute; inset:0; width:100%; height:100%; margin:0; opacity:0; cursor:pointer; z-index:1; }
.settings-switch-track { display:block; width:100%; height:100%; background:#343a42; border:1px solid #7e858e; border-radius:12px; box-sizing:border-box; pointer-events:none; }
.settings-switch-track::after { content:''; display:block; width:16px; height:16px; margin:2px; border-radius:50%; background:#fff; transition:transform .15s ease; }
.settings-switch input:checked+.settings-switch-track { background:#536b3a; border-color:#a9bc73; }
.settings-switch input:checked+.settings-switch-track::after { transform:translateX(18px); }
.settings-switch input:focus-visible+.settings-switch-track { outline:2px solid #d9c995; outline-offset:2px; }
.settings-content .profile-audio-settings { border-radius:3px; }
.settings-content .profile-audio-toggle-row label,.settings-content .profile-audio-volume-row label { font-size:13px; color:#fff; }
.settings-content .profile-audio-volume-row output { color:#fff; }
.profile-average-prices { display:flex; align-items:center; gap:8px; padding:10px 0; font-size:13px; }
.has-money-input-hint { position:relative; }
.money-input-hint { position:absolute; bottom:calc(100% + 3px); right:0; z-index:5; padding:4px 8px; background:#191d17; border:1px solid #77694d; border-radius:3px; color:#e7d99e; font-size:11px; white-space:nowrap; max-width:min(420px,80vw); overflow:hidden; text-overflow:ellipsis; pointer-events:none; }
.money-input-hint[hidden] { display:none; }
.money-input-hint-portal { position:fixed; z-index:2147483647; bottom:auto; left:auto; max-width:min(420px,calc(100vw - 16px)); }
.skill-navigation-layout { display:grid !important; grid-template-columns:minmax(105px,27%) minmax(0,1fr); gap:12px; min-height:0; height:100%; overflow:hidden; padding:10px !important; }
.skill-menu-scroll { min-width:0; min-height:0; overflow-y:auto; overflow-x:hidden; scrollbar-width:thin; display:flex; flex-direction:column; gap:8px; border-right:1px solid rgba(155,124,61,.35); padding-right:8px; }
.skill-menu-scroll nav,.skill-menu-scroll .forgotten-skill-tabs { display:flex !important; flex-direction:column !important; align-items:stretch; gap:6px; overflow:visible !important; width:100%; padding:0; }
.skill-menu-scroll .item-skills-cat-nav { display:flex !important; flex-direction:column !important; padding:0; gap:6px; }
.skill-menu-scroll button { flex:0 0 auto; min-width:0 !important; width:100%; background:rgba(25,25,18,.8); border:1px solid rgba(155,124,61,.22); border-radius:3px; padding:8px 6px; color:#bbb5a1; cursor:pointer; }
.skill-menu-scroll button.is-active { color:#f0d58d; background:rgba(117,92,36,.25); border-color:#9e854c; }
.skill-menu-scroll .forgotten-skill-tab { display:flex; flex-direction:column; align-items:center; justify-content:center; }
.skill-menu-scroll .forgotten-tab-label { white-space:normal; text-align:center; }
.skill-content-scroll { min-width:0; min-height:0; overflow:auto; scrollbar-width:thin; }
.skill-content-scroll .item-skills-columns { grid-template-columns:1fr; }
.skill-content-scroll [hidden] { display:none !important; }
.forgotten-book-price>img { width:24px; height:24px; object-fit:contain; border-radius:3px; }
#l2-window-skills .l2-subtabs-nav { display:flex; flex-wrap:nowrap; overflow-x:auto; flex-shrink:0; }
#l2-window-skills .l2-subtab-panel { min-height:0; flex:1; }
#class-skill-fields { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
@media(max-width:500px) { #audio-settings-modal .settings-layout { grid-template-columns:100px minmax(0,1fr); } .settings-content { padding:12px; } }

.special-instruction-text.combat-context-picker { display:flex !important; flex-direction:row !important; justify-content:center; align-items:center; gap:8px; width:100%; margin:6px 0; }
#l2-window-skills #panel-class-skills { display:flex !important; flex-direction:column; min-height:0; height:100%; }
#class-skills-type-nav { display:flex; flex-direction:row; justify-content:center; gap:8px; flex:0 0 auto; margin-bottom:12px; }
#class-skills-type-nav button { padding:7px 16px; border:1px solid rgba(155,124,61,.4); background:rgba(20,22,18,.7); color:#fff; border-radius:3px; cursor:pointer; }
#class-skills-type-nav button.is-active { background:rgba(117,92,36,.35); border-color:#9e854c; }
#class-skills-tabs { display:none !important; }
.profession-skills-list { display:flex; flex-direction:column; gap:8px; overflow:auto; min-height:0; flex:1; }
.profession-skill-row { display:grid; grid-template-columns:44px 100px minmax(0,1fr) minmax(150px,26%); gap:10px; align-items:start; padding:10px; border:1px solid rgba(155,124,61,.25); border-radius:3px; background:rgba(10,14,15,.65); }
.profession-skill-icon { width:44px; height:44px; border-radius:3px; background:rgba(0,0,0,.3); }
.profession-skill-icon img { width:100%; height:100%; object-fit:contain; border-radius:3px; }
.profession-skill-levels { display:flex; flex-direction:column; gap:6px; }
.profession-skill-levels label { display:flex; flex-direction:column; gap:3px; font-size:10px; color:#fff; }
.profession-skill-levels select { width:100%; min-width:0; padding:5px; background:#11171c; color:#fff; border:1px solid #655a3f; border-radius:3px; }
.profession-skill-levels option { color:#fff; background:#11171c; }
.profession-skill-bonuses { min-width:0; font-size:12px; }
.profession-skill-bonuses strong { color:#e8dbaa; }
.profession-skill-bonuses p { margin:4px 0; line-height:1.4; }
.profession-skill-bonuses small { color:#a99a70; }
.profession-skill-cost .forgotten-upgrade { margin:0; padding:8px; font-size:11px; }
.profession-skill-cost { display:flex; flex-direction:column; gap:4px; font-size:11px; color:#bbb6a6; }
.profession-skill-cost>strong { color:#d9c995; }
.profession-skill-cost>b { color:#eee4c7; }
#panel-forgotten .skill-navigation-layout { grid-template-columns:minmax(82px,110px) minmax(0,1fr); grid-template-rows:auto minmax(0,1fr); }
#l2-window-skills #panel-forgotten { display:flex !important; flex-direction:column; height:100%; min-height:0; }
#l2-window-skills #panel-forgotten>.skill-navigation-layout { flex:1; min-height:0; }
#forgotten-subcategories-nav { grid-column:1/-1; display:flex !important; flex-direction:row !important; justify-content:center; gap:6px; flex-wrap:wrap; }
#forgotten-subcategories-nav button { margin:0; }
.skill-menu-scroll #forgotten-skill-tabs { justify-content:flex-start !important; }
.skill-menu-scroll #forgotten-skill-tabs .forgotten-skill-tab { flex:0 0 auto !important; margin:0 !important; padding:4px 3px !important; gap:3px; min-height:0 !important; }
.skill-menu-scroll #forgotten-skill-tabs .forgotten-tab-icon { width:36px; height:36px; margin:0; }
.skill-menu-scroll #forgotten-skill-tabs .forgotten-tab-label { margin:0; padding:0; font-size:11px; line-height:1.2; }
.forgotten-level-dropdown-menu { --skill-level-row-height:calc(32px * var(--skill-scale,1)); max-height:calc(7 * var(--skill-level-row-height) + 6px) !important; overflow-y:scroll !important; scrollbar-width:none !important; }
.forgotten-level-dropdown-option { min-height:var(--skill-level-row-height,32px) !important; height:var(--skill-level-row-height,32px) !important; box-sizing:border-box; }
.forgotten-level-dropdown-menu::-webkit-scrollbar { width:0; display:none; }
#l2-window-skills .forgotten-level-dropdown-menu[popover] { position:fixed; margin:0; right:auto; bottom:auto; min-width:0; box-sizing:border-box; }
.forgotten-level-dropdown-menu[popover]::backdrop { background:transparent; pointer-events:none; }
.forgotten-level-dropdown-menu::-webkit-scrollbar-track { background:#151a20; }
.forgotten-level-dropdown-menu::-webkit-scrollbar-thumb { background:#b99d55; border:1px solid #151a20; border-radius:3px; }
.skill-level-scrollbar { position:absolute; width:6px; z-index:61; background:#151a20; border-radius:3px; cursor:pointer; touch-action:none; }
.skill-level-scrollbar-thumb { display:block; width:6px; background:#b99d55; border-radius:3px; }
.forgotten-level-dropdown:not(.is-open) .skill-level-scrollbar,.skill-level-scrollbar[hidden] { display:none; }
@media(max-width:650px) { .profession-skill-row { grid-template-columns:36px 90px minmax(0,1fr); } .profession-skill-icon { width:36px; height:36px; } .profession-skill-cost { grid-column:2/-1; } }

/* Narrow comparisons keep actions and results visible. Only the item pane
   and result contents scroll; the dialog itself remains fixed in the viewport. */
@media (max-width: 720px) {
    #comparison-modal .comparison-dialog {
        display: flex;
        flex-direction: column;
        height: calc(100dvh - 16px);
    }
    #comparison-modal .comparison-header,
    #comparison-modal .modal-footer { flex: 0 0 auto; }
    #comparison-modal .modal-body { flex: 1 1 auto; min-height: 0; overflow: hidden; }
    #comparison-modal .comparison-workspace {
        height: 100%;
        min-height: 0;
        grid-template-rows: minmax(0, 1.4fr) minmax(0, 1fr);
        align-items: stretch;
        gap: 10px;
    }
    #comparison-modal .comparison-items-pane,
    #comparison-modal .comparison-result-panel { min-height: 0; overflow-y: auto; overflow-x: hidden; }
    #comparison-modal .comp-columns-grid { height: auto; }
    #comparison-modal .modal-footer { flex-wrap: nowrap; min-height: 0; padding: 10px; }
    #comparison-modal .modal-footer button { flex: 1 1 0; min-width: 0; padding: 9px 6px; }
}

/* A separate delete action also remains available outside character-editor promotions. */
.profile-character-entry { position: relative; min-width: 0; }
.profile-character-entry > .profile-character-slot { width: 100%; height: 100%; padding-right: 34px; }
.profile-character-delete { position: absolute; top: 5px; right: 5px; width: 28px; height: 28px; border: 0; border-radius: 4px; background: rgba(30, 12, 15, .75); color: #fca5a5; font-size: 21px; cursor: pointer; }
.profile-character-delete:hover, .profile-character-delete:focus-visible { background: #632830; color: white; outline: 1px solid #fca5a5; }
