/* ── Configure page ─────────────────────────────────────────────────────── */
.cfg-wrap {
    max-width: 760px;
    margin: 0 auto;
    padding: 3rem 1.5rem 5rem;
}

.cfg-step--hidden {
    display: none !important;
}

.cfg-title {
    font-family: 'Exo 2', sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: #d4d8e0;
    margin: 0 0 0.5rem;
}

.cfg-hint {
    color: rgba(212, 216, 224, 0.6);
    font-family: 'Rubik', sans-serif;
    font-size: 0.95rem;
    margin: 0 0 2rem;
}

.cfg-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1.8rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-family: 'Rubik', sans-serif;
    font-size: 1rem;
    font-weight: 500;
    background: #7390B9;
    color: white;
    transition: background 0.2s ease, transform 0.1s ease;
    text-decoration: none;
}

.cfg-btn:hover {
    background: #8aa4c8;
}

.cfg-btn:active {
    transform: scale(0.97);
}

.cfg-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
}

.cfg-btn--secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #d4d8e0;
}

.cfg-btn--secondary:hover {
    background: rgba(255, 255, 255, 0.18);
}

.cfg-btn--download {
    background: #4caf8a;
}

.cfg-btn--download:hover {
    background: #5fc49c;
}

.cfg-status {
    margin-top: 1rem;
    font-family: 'Rubik', sans-serif;
    font-size: 0.9rem;
    color: rgba(212, 216, 224, 0.65);
    min-height: 1.4em;
}

.cfg-status--error {
    color: #e07070;
}

.cfg-browser-note {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: rgba(212, 216, 224, 0.4);
    font-family: 'Rubik', sans-serif;
}

/* ── Key grid ───────────────────────────────────────────────────────────── */
.cfg-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 1.5rem 0 2.5rem;
}

.cfg-key {
    width: 90px;
    height: 90px;
    background: #E8D5B0;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 3px solid transparent;
    transition: background 0.15s ease, transform 0.12s ease, border-color 0.15s ease;
    user-select: none;
    gap: 5px;
}

.cfg-key:hover {
    background: #dfc89c;
    transform: translateY(-3px);
}

.cfg-key:active {
    transform: scale(0.93);
}

.cfg-key--set {
    border-color: #7390B9;
}

.cfg-key-num {
    font-family: 'Exo 2', sans-serif;
    font-size: 0.7rem;
    font-weight: 700;
    color: rgba(30, 50, 60, 0.45);
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.cfg-key-label {
    font-family: 'Rubik', sans-serif;
    font-size: 0.82rem;
    font-weight: 500;
    color: #1e3a40;
    text-align: center;
    padding: 0 5px;
    line-height: 1.25;
    word-break: break-word;
}

.cfg-key-empty {
    font-family: 'Rubik', sans-serif;
    font-size: 0.72rem;
    color: rgba(30, 50, 60, 0.38);
    text-align: center;
}

/* ── Build section ──────────────────────────────────────────────────────── */
.cfg-build-status {
    font-family: 'Rubik', sans-serif;
    font-size: 1rem;
    color: rgba(212, 216, 224, 0.75);
    margin: 0.75rem 0;
}

.cfg-spinner-wrap {
    display: flex;
    margin: 1.5rem 0 2rem;
}

.cfg-spinner {
    width: 36px;
    height: 36px;
    border: 4px solid rgba(115, 144, 185, 0.25);
    border-top-color: #7390B9;
    border-radius: 50%;
    animation: cfg-spin 0.8s linear infinite;
}

@keyframes cfg-spin {
    to { transform: rotate(360deg); }
}

.cfg-build-btns {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* ── Shortcut assignment modal ──────────────────────────────────────────── */
.cfg-modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(10, 20, 26, 0.82);
}

.cfg-modal-box {
    background: #1e3a40;
    border-radius: 14px;
    padding: 2rem 2.5rem;
    max-width: 380px;
    width: 90%;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.55);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.9rem;
    outline: none;
}

.cfg-modal-title {
    font-family: 'Rubik', sans-serif;
    font-size: 0.9rem;
    color: rgba(212, 216, 224, 0.55);
    margin: 0;
}

.cfg-modal-display {
    font-family: 'Exo 2', sans-serif;
    font-size: 2.2rem;
    font-weight: 700;
    color: #d4d8e0;
    min-height: 2.8rem;
    text-align: center;
    line-height: 1.1;
}

.cfg-modal-zmk {
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    color: rgba(212, 216, 224, 0.42);
    margin: 0;
    min-height: 1.2em;
}

.cfg-modal-btns {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.4rem;
}

/* ── Mobile tweaks ──────────────────────────────────────────────────────── */
@media (max-width: 600px) {
    .cfg-key {
        width: 76px;
        height: 76px;
    }

    .cfg-title {
        font-size: 1.4rem;
    }

    .cfg-modal-box {
        padding: 1.5rem 1.5rem;
    }

    .cfg-modal-display {
        font-size: 1.8rem;
    }
}
