.tfa-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto
}

.tfa-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px
}

.tfa-title {
    font-size: 28px;
    font-weight: 600;
    width: 100%
}

.tfa-header-actions {
    display: flex;
    gap: 12px;
    width: 100%;
    flex-wrap: wrap
}

.tfa-search {
    padding: 10px 16px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    flex: 1 1 auto;
    min-width: 0;
    max-width: 100%
}

.tfa-search:focus {
    outline: none;
    border-color: #2563eb
}

.tfa-add-button {
    background: #2563eb;
    color: #fff;
    border: none;
    padding: 12px 20px;
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0
}

.tfa-accounts .tfa-card {
    border: 1px solid #e5e7eb;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px
}

.tfa-card-info {
    flex: 1;
    min-width: 0
}

.tfa-card-name {
    font-weight: 600;
    margin-bottom: 4px
}

.tfa-code {
    font-size: 30px;
    font-family: monospace;
    color: #2563eb;
    word-break: break-all
}

.tfa-del {
    background: #dc2626;
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    flex-shrink: 0
}

.tfa-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999999
}

.tfa-modal-content {
    background: #fff;
    width: 560px;
    max-width: 95%;
    border-radius: 10px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .3)
}

.tfa-modal-header {
    padding: 18px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center
}

.tfa-modal-header h3 {
    margin: 0
}

.tfa-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #6b7280
}

.tfa-modal-footer {
    padding: 18px;
    border-top: 1px solid #e5e7eb;
    text-align: right
}

.tfa-modal-body {
    padding: 18px
}

.tfa-input-method {
    display: flex;
    gap: 12px;
    margin-bottom: 16px
}

.tfa-method-button {
    flex: 1;
    padding: 12px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    cursor: pointer
}

.tfa-method-active {
    border-color: #2563eb;
    background: #eff6ff;
    color: #2563eb
}

.tfa-method-content {
    display: none
}

.tfa-method-manual {
    display: block
}

.tfa-method-content input {
    width: 100%;
    padding: 12px;
    margin-bottom: 12px;
    border-radius: 6px;
    border: 1px solid #d1d5db;
    box-sizing: border-box
}

.tfa-qr-scanner {
    position: relative;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 4/3
}

.tfa-camera-preview {
    width: 100%;
    height: 100%;
    object-fit: cover
}

.tfa-qr-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none
}

.tfa-qr-frame {
    width: 250px;
    height: 250px;
    border: 3px solid #2563eb;
    border-radius: 12px;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5)
}

.tfa-qr-status {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    padding: 8px 16px;
    border-radius: 6px;
    white-space: nowrap
}

@media (max-width:768px) {
    .tfa-container {
        padding: 15px
    }

    .tfa-title {
        font-size: 24px
    }

    .tfa-header-actions {
        flex-direction: column
    }

    .tfa-search {
        width: 91%;
        flex: none
    }

    .tfa-add-button {
        width: 100%
    }

    .tfa-code {
        font-size: 24px
    }

    .tfa-card-info {
        width: 100%
    }

    .tfa-del {
        width: 100%;
        margin-top: 10px
    }

    .tfa-qr-frame {
        width: 200px;
        height: 200px
    }
}