/* Address book — 2RX Wallet buy page */

.ab-field {
    position: relative;
    display: flex;
    align-items: stretch;
    gap: 0.4rem;
    width: 100%;
    min-width: 0;
}

.ab-field .form-control,
.ab-field input[type="text"] {
    flex: 1 1 auto;
    min-width: 0;
}

.ab-actions {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.ab-save {
    appearance: none;
    border: 1px solid rgba(102, 126, 234, 0.45);
    background: rgba(102, 126, 234, 0.1);
    color: #5a67d8;
    border-radius: 10px;
    padding: 0 0.75rem;
    min-height: 46px;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}

.ab-save:hover {
    background: rgba(102, 126, 234, 0.18);
}

.ab-save.ab-save-ok {
    border-color: rgba(72, 187, 120, 0.55);
    color: #22543d;
    background: #c6f6d5;
}

.ab-save.ab-save-err {
    border-color: rgba(245, 101, 101, 0.55);
    color: #c53030;
    background: #fed7d7;
}

.ab-suggest {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 40;
    max-height: 220px;
    overflow: auto;
    border-radius: 12px;
    border: 2px solid rgba(102, 126, 234, 0.25);
    background: #fff;
    box-shadow: 0 12px 28px rgba(102, 126, 234, 0.18);
}

.ab-suggest.is-open {
    display: flex;
    flex-direction: column;
    padding: 0.3rem;
    gap: 0.15rem;
}

.ab-suggest-item {
    appearance: none;
    border: 0;
    background: transparent;
    color: #2d3748;
    text-align: left;
    border-radius: 8px;
    padding: 0.55rem 0.65rem;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.ab-suggest-item:hover,
.ab-suggest-item:focus {
    background: rgba(102, 126, 234, 0.1);
    outline: none;
}

.ab-suggest-title {
    font-size: 0.86rem;
    font-weight: 650;
}

.ab-suggest-sub {
    font-size: 0.72rem;
    color: #718096;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    word-break: break-all;
}

.ab-toolbar-slot {
    margin-bottom: 0.5rem;
}

.ab-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.55rem 0.85rem;
    margin: 0 0 0.65rem;
}

.ab-toolbar-hint {
    font-size: 0.78rem;
    color: #718096;
}

.ab-open-book {
    appearance: none;
    border: 2px solid rgba(102, 126, 234, 0.35);
    background: rgba(102, 126, 234, 0.08);
    color: #5a67d8;
    border-radius: 10px;
    padding: 0.35rem 0.75rem;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
}

.ab-open-book:hover {
    background: rgba(102, 126, 234, 0.15);
}

.ab-manager {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.55);
}

.ab-manager[hidden] {
    display: none !important;
}

.ab-manager-card {
    width: min(520px, 100%);
    max-height: min(80vh, 640px);
    overflow: auto;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    background: #fff;
    padding: 1rem 1.1rem 1.15rem;
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.2);
}

.ab-manager-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.ab-manager-head h3 {
    margin: 0;
    font-size: 1.05rem;
    color: #2d3748;
}

.ab-manager-close {
    appearance: none;
    border: 0;
    background: transparent;
    color: #718096;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    padding: 0.1rem 0.35rem;
}

.ab-manager-sub {
    margin: 0.45rem 0 0.9rem;
    font-size: 0.8rem;
    color: #718096;
    line-height: 1.45;
}

.ab-manager-empty {
    margin: 0;
    font-size: 0.86rem;
    color: #718096;
}

.ab-manager-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem 0.75rem;
    justify-content: space-between;
    align-items: flex-start;
    padding: 0.7rem 0;
    border-top: 1px solid #edf2f7;
}

.ab-manager-meta {
    display: grid;
    gap: 0.2rem;
    min-width: 0;
    flex: 1 1 220px;
}

.ab-manager-meta strong {
    font-size: 0.9rem;
    color: #2d3748;
}

.ab-manager-meta code {
    font-size: 0.72rem;
    color: #718096;
    word-break: break-all;
}

.ab-manager-coin {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #667eea;
}

.ab-manager-row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.ab-manager-row-actions .btn.ghost.sm,
.ab-manager-clear {
    appearance: none;
    border: 1px solid #e2e8f0;
    background: #f7fafc;
    color: #4a5568;
    border-radius: 8px;
    padding: 0.3rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
}

.ab-manager-foot {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #edf2f7;
}

@media (max-width: 640px) {
    .ab-toolbar-hint {
        width: 100%;
    }
}
