.ww-modal-header h3 .ri-lightbulb-line {
    flex-shrink: 0;
    font-size: 1em;
    line-height: 1;
    color: #666;
}

#role-modal,
#basic-modal,
#text-import-modal,
#guide-modal,
#feedback-modal,
#valuation-feedback-modal,
#rec-results-modal,
#rec-detail-modal,
#rec-feedback-modal,
#wx-qr-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0, 0, 0, 0.48);
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

#error-dialog {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 100001;
    background: rgba(0, 0, 0, 0.48);
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

#role-modal.active,
#basic-modal.active,
#text-import-modal.active,
#guide-modal.active,
#error-dialog.active,
#feedback-modal.active,
#valuation-feedback-modal.active,
#rec-results-modal.active,
#rec-detail-modal.active,
#rec-feedback-modal.active,
#wx-qr-modal.active {
    display: flex !important;
}

#guide-modal .ww-guide-modal-content {
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 0.4s ease;
}

#guide-modal.ww-guide-flying .ww-guide-modal-content {
    opacity: 0.95;
}

#guide-modal.ww-guide-flying .ww-modal-close,
#guide-modal.ww-guide-flying .ww-modal-footer {
    pointer-events: none;
    opacity: 0;
}

#guide-modal .ww-guide-modal-content {
    transform: translate(0, 0) scale(1);
}

#guide-modal.ww-guide-flying .ww-guide-modal-content.ww-guide-fly-to-button {
    transform: translate(var(--fly-x, 0), var(--fly-y, 0)) scale(0);
}

.ww-modal-content {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 1.5rem;
    padding: 2rem;
    max-width: 64rem;
    width: 100%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
    position: relative;
}

.ww-modal-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4a4a4a;
    cursor: pointer;
    transition: all 0.2s;
}

.ww-modal-close:hover {
    background: rgba(0, 0, 0, 0.08);
}

.ww-modal-header {
    margin-bottom: 1.5rem;
}

.ww-modal-header h3 {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 0.5rem;
}

.ww-modal-header p {
    font-size: 0.875rem;
    color: #666;
}

.ww-modal-body {
    flex: 1;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.ww-modal-body .ww-label {
    display: block;
    margin-bottom: 0.5rem;
}

.ww-textarea {
    resize: none;
    min-height: 10rem;
}

.ww-textarea-hint {
    font-size: 0.75rem;
    color: #666;
    margin-top: 0.5rem;
}

.ww-modal-hint {
    font-size: 0.75rem;
    color: #666;
}

.ww-modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    flex-wrap: wrap;
    gap: 1rem;
}

.ww-modal-actions {
    display: flex;
    gap: 0.75rem;
}

.ww-modal-actions .ww-btn-outline,
.ww-modal-actions .ww-btn-primary {
    justify-content: center;
    white-space: nowrap;
    height: 2.5rem;
    padding: 0 1.6rem;
}

.selection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
    padding: 0.5rem 0;
}

.selection-tile {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 1rem;
    padding: 1rem 0.75rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.18s ease-out;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    position: relative;
}

.selection-tile .tile-card-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    width: 100%;
    margin: 0 auto;
    text-align: center;
}

.selection-tile:has(.ww-select.open) {
    z-index: 30;
}

.selection-tile:hover {
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.12);
}

.selection-tile.selected {
    background: rgba(0, 0, 0, 0.04);
    border-color: #1a1a1a;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

.tile-icon,
.weapon-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.selection-tile .character-icon {
    width: 2.7rem;
    height: 2.7rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    color: #4a4a4a;
    overflow: hidden;
    flex-shrink: 0;
    margin: 0 auto;
}

.selection-tile .character-head-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.character-icon {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    color: #4a4a4a;
    overflow: hidden;
}

.character-head-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0.5rem;
}

.weapon-icon {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    color: #4a4a4a;
}

.selection-tile .tile-name {
    display: block;
    width: 100%;
    margin: 0 auto;
    font-size: 0.78rem;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.2;
    text-align: center;
}

.tile-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.2;
}

.tile-left {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.selection-tile .tile-refinement {
    width: 100%;
    margin-top: 0.15rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.tile-refinement {
    width: 100%;
    margin-top: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.tile-refinement.hidden {
    display: none !important;
}

.selection-tile .refinement-group {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    width: 100%;
}

.selection-tile .refinement-top-label {
    font-size: 0.7rem;
    color: #666;
    flex-shrink: 0;
    width: auto;
}


.selection-tile .refinement-group .ww-select-mini {
    flex: 0 0 auto;
    width: 4.5rem;
    min-width: 4.5rem;
    max-width: 4.5rem;
}

.selection-tile .refinement-desc {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
}

.selection-tile .refinement-weapon-name {
    font-size: 0.7rem;
    color: #555;
    flex-shrink: 0;
    max-width: 5em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.refinement-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.refinement-label {
    font-size: 0.7rem;
    color: #666;
    min-width: 2rem;
}

.weapon-info {
    flex: 1;
    min-width: 0;
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 0.6rem;
    padding: 0.375rem 0.6rem;
    display: flex;
    align-items: center;
}

.weapon-name {
    font-size: 0.75rem;
    color: #1a1a1a;
    font-weight: 500;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: left;
    flex: 1;
}

.refinement-select {
    flex: 1;
    padding: 0.375rem 0.5rem;
    font-size: 0.75rem;
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 0.5rem;
    color: #1a1a1a;
    cursor: pointer;
}

.tile-check {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    background: #22c55e;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.2s;
}

.selection-tile.selected .tile-check {
    opacity: 1;
}

.tile-check i {
    font-size: 0.875rem;
    color: white;
}

#selection-count {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1a1a1a;
}

.ww-modal-body::-webkit-scrollbar {
    width: 6px;
}

.ww-modal-body::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.04);
    border-radius: 3px;
}

.ww-modal-body::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 3px;
}

.ww-modal-body::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.25);
}
