.npc-repair-root {
    position: fixed;
    inset: 0;
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: max(8px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right))
        max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.18s ease;
}

.npc-repair-root.open {
    pointer-events: auto;
    opacity: 1;
}

.npc-repair-backdrop {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 40%, rgba(30, 30, 36, 0.72) 0%, rgba(0, 0, 0, 0.78) 70%);
}

.npc-repair-sheet {
    position: relative;
    width: min(96vw, 440px);
    max-height: min(88vh, 640px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 10px;
    background: linear-gradient(180deg, #2f2a25 0%, #1a1713 38%, #100e0b 100%);
}

.npc-repair-head,
.npc-repair-foot {
    padding: 10px 14px;
    border-color: rgba(0, 0, 0, 0.35);
    border-style: solid;
}

.npc-repair-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-width: 0 0 2px;
}

.npc-repair-title {
    margin: 0;
    color: var(--px-gold);
    font-size: var(--text-lg);
}

.npc-repair-gold {
    margin: 4px 0 0;
    font-size: var(--text-xs);
    color: #cfc2b1;
}

.npc-repair-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 10px 12px;
}

.npc-repair-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 8px;
}

.npc-repair-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 6px;
    border: 2px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.25);
    color: #eadfce;
    font-family: inherit;
    cursor: pointer;
}

.npc-repair-item.selected {
    border-color: rgba(255, 213, 79, 0.65);
    background: rgba(74, 52, 36, 0.35);
}

.npc-repair-item-name,
.npc-repair-item-dur {
    text-align: center;
    font-size: var(--text-xs);
}

.npc-repair-item-where {
    display: block;
    margin-top: 2px;
    color: #c9b896;
    font-size: 0.85em;
    opacity: 0.9;
}

.npc-repair-empty {
    grid-column: 1 / -1;
    text-align: center;
    color: #a89a8c;
}

.npc-repair-foot {
    border-width: 2px 0 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.npc-repair-info,
.npc-repair-cost,
.npc-repair-all-cost {
    margin: 0;
    font-size: var(--text-sm);
    color: #fff;
}

.npc-repair-cost {
    color: #ffe082;
}

.npc-repair-all-cost {
    color: #ffcc80;
}

.npc-repair-actions {
    display: flex;
    gap: 8px;
}

.npc-repair-confirm,
.npc-repair-all {
    flex: 1;
    width: auto;
}
