.d4-nfc {
    position: relative;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    padding: 14px;
    background: var(--bs-body-bg, #fff);
}

.d4-nfc .nfc-panel {
    border-radius: 10px;
    transition: background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.d4-nfc.nfc-scanning .nfc-panel {
    background: rgba(64, 81, 137, 0.06);
    border: 1px solid rgba(64, 81, 137, 0.35);
    box-shadow: 0 0 0 3px rgba(64, 81, 137, 0.12);
}

.d4-nfc .nfc-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.d4-nfc .nfc-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 999px;
    background: rgba(64, 81, 137, 0.08);
    border: 1px solid rgba(64, 81, 137, 0.18);
    color: #405189;
    font-weight: 600;
    line-height: 1;
}

.d4-nfc .nfc-badge .nfc-icon {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #405189;
    color: #fff;
    flex: 0 0 auto;
}

.d4-nfc .nfc-badge-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    min-width: 0;
}

.d4-nfc .nfc-badge .nfc-code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 13px;
    letter-spacing: 0.2px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.d4-nfc .nfc-badge .nfc-tag-name {
    font-family: var(--bs-body-font-family, system-ui, sans-serif);
    font-size: 12px;
    font-weight: 600;
    color: rgba(64, 81, 137, 0.92);
    line-height: 1.25;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    white-space: normal;
}

.d4-nfc.nfc-empty .nfc-badge .nfc-tag-name {
    color: rgba(0, 0, 0, 0.5);
}

.d4-nfc .nfc-meta {
    margin-top: 10px;
    color: var(--bs-secondary-color, #6c757d);
    font-size: 12px;
}

.d4-nfc .nfc-actions {
    display: inline-flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.d4-nfc .nfc-empty .nfc-badge {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.08);
    color: rgba(0, 0, 0, 0.55);
}

.d4-nfc .nfc-empty .nfc-badge .nfc-icon {
    background: rgba(0, 0, 0, 0.35);
}

.d4-nfc.readonly .nfc-actions,
.d4-nfc.disabled .nfc-actions {
    display: none;
}

.d4-nfc-scan-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2050;
    background: rgba(15, 23, 42, 0.28);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
}

.d4-nfc-scan-overlay.is-active {
    display: flex;
}

.d4-nfc-scan-sheet {
    width: min(100%, 22rem);
    background: #fff;
    border-radius: 1.5rem;
    padding: 2rem 1.5rem 1.35rem;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.9) inset,
        0 24px 48px -12px rgba(15, 23, 42, 0.22);
    text-align: center;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.d4-nfc-scan-visual {
    display: flex;
    justify-content: center;
    margin: 0 0 1.1rem;
}

.d4-nfc-scan-icon-ring {
    width: 4.5rem;
    height: 4.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(148, 163, 184, 0.55);
    background: #fafbfc;
    color: #405189;
    font-size: 1.65rem;
    line-height: 1;
}

.d4-nfc-scan-title {
    font-size: 1.05rem;
    font-weight: 650;
    letter-spacing: -0.02em;
    margin: 0 0 0.5rem;
    color: #0f172a;
    line-height: 1.25;
}

.d4-nfc-scan-hint {
    font-size: 0.8125rem;
    line-height: 1.45;
    color: #64748b;
    margin: 0 0 1.35rem;
}

.d4-nfc-scan-cancel {
    width: 100%;
    box-sizing: border-box;
    margin: 0;
    padding: 0.65rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #64748b;
    background: rgba(248, 250, 252, 0.98);
    border: 1px solid rgba(148, 163, 184, 0.45);
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.d4-nfc-scan-cancel:hover {
    background: #fff;
    border-color: rgba(100, 116, 139, 0.55);
    color: #475569;
}

