/**
 * Zeneal Wallet - Progressive Web App Stylesheet
 * Authority: PRD 06 Brand & Design System, AppColors tokens
 */

:root {
    --primary: #2563EB;
    --primary-hover: #1D4ED8;
    --primary-dark: #1E40AF;
    --navy: #102A56;
    --pale-blue: #EFF6FF;
    --bg-dark: #0B1220;
    --surface-dark: #111C30;
    --surface-elevated: #18253D;
    --border-dark: #1E293B;
    --text-white: #FFFFFF;
    --text-muted: #94A3B8;
    --text-subtle: #64748B;
    --success: #10B981;
    --success-bg: rgba(16, 185, 129, 0.15);
    --warning: #F59E0B;
    --warning-bg: rgba(245, 158, 11, 0.15);
    --error: #EF4444;
    --error-bg: rgba(239, 68, 68, 0.15);
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
    -webkit-font-smoothing: antialiased;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-white);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    user-select: none;
    -webkit-user-select: none;
}

/* App Viewport Container */
#app-viewport {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    position: relative;
    background-color: var(--bg-dark);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
}

/* Screen Management */
.screen {
    display: none;
    flex: 1;
    flex-direction: column;
    padding-top: calc(var(--safe-top) + 1rem);
    padding-bottom: calc(var(--safe-bottom) + 5rem);
    padding-left: 1.25rem;
    padding-right: 1.25rem;
    animation: fadeIn 0.2s ease-out;
}

.screen.active {
    display: flex;
}

.screen.no-nav {
    padding-bottom: calc(var(--safe-bottom) + 1.5rem);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Header & Navigation Bar */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-dark);
}

.app-brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.app-brand img {
    width: 32px;
    height: 32px;
    border-radius: 8px;
}

.app-brand-name {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-white);
    letter-spacing: -0.02em;
}

.swiss-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: rgba(37, 99, 235, 0.15);
    border: 1px solid rgba(37, 99, 235, 0.3);
    color: #60A5FA;
    padding: 0.2rem 0.6rem;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.header-user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--surface-elevated);
    border: 1px solid var(--border-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    color: #60A5FA;
    cursor: pointer;
}

/* Portfolio Balance Card */
.portfolio-card {
    background: linear-gradient(135deg, #102A56 0%, #153A75 50%, #1E40AF 100%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 10px 25px -5px rgba(16, 42, 86, 0.5);
    position: relative;
    overflow: hidden;
}

.portfolio-card::after {
    content: '';
    position: absolute;
    right: -20px;
    bottom: -20px;
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.08) 0%, transparent 70%);
    border-radius: 50%;
}

.portfolio-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 0.5rem;
}

.portfolio-val,
.portfolio-amount {
    font-size: 2.15rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #FFFFFF;
    font-variant-numeric: tabular-nums;
    margin-bottom: 0.75rem;
}

.portfolio-subtext {
    display: none !important;
}

.portfolio-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: rgba(255, 255, 255, 0.15);
    padding: 0.25rem 0.65rem;
    border-radius: 6px;
    font-size: 0.75rem;
    color: #FFFFFF;
    font-weight: 500;
}

/* Action Button Grid (Send, Receive, History) */
/* Action Button Grid (Send, Receive, History) */
.action-grid,
.quick-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    width: 100%;
}

.action-btn {
    background: var(--surface-dark);
    border: 1px solid var(--border-dark);
    border-radius: 14px;
    padding: 0.95rem 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-white);
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s ease;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    font-family: inherit;
}

.action-btn:active {
    background: var(--surface-elevated);
    transform: scale(0.96);
}

.action-icon,
.action-btn-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s ease;
}

.action-icon.receive,
.action-btn-icon.receive {
    background: rgba(37, 99, 235, 0.2);
    color: #60A5FA;
}

.action-icon.send,
.action-btn-icon.send {
    background: rgba(16, 185, 129, 0.2);
    color: #34D399;
}

.action-icon.history,
.action-btn-icon.history {
    background: rgba(245, 158, 11, 0.2);
    color: #FBBF24;
}

.action-label,
.action-btn-label {
    font-size: 0.825rem;
    font-weight: 600;
    color: var(--text-white);
}

/* Section Titles & Header */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.85rem;
    width: 100%;
}

.section-title {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text-white);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-link {
    font-size: 0.8rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.refresh-link {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-dark);
    color: #60A5FA;
    font-size: 0.775rem;
    font-weight: 600;
    padding: 0.35rem 0.65rem;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    transition: all 0.15s ease;
}

.refresh-link:active {
    background: rgba(37, 99, 235, 0.2);
    transform: scale(0.96);
}

/* Asset Balance Items */
.asset-list {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    margin-bottom: 1.5rem;
}

.asset-card {
    background: var(--surface-dark);
    border: 1px solid var(--border-dark);
    border-radius: 14px;
    padding: 0.9rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: background 0.15s;
    margin-bottom: 0.65rem;
}

.asset-card:active {
    background: var(--surface-elevated);
}

.asset-info {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    flex: 1;
    min-width: 0;
}

.asset-info > div:last-child {
    min-width: 0;
}

.asset-name,
.asset-network {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.asset-symbol-icon {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 800;
    color: #FFFFFF;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.asset-symbol-icon.asset-symbol-icon:has(img) {
    background: transparent;
    overflow: visible;
}

.asset-symbol-icon:has(img) span {
    visibility: hidden;
}

.asset-symbol-icon img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.asset-symbol-icon.btc { background: #F59E0B; }
.asset-symbol-icon.eth { background: #6366F1; }
.asset-symbol-icon.usdt { background: #10B981; }
.asset-symbol-icon.usdc { background: #2775CA; }
.asset-symbol-icon.bnb { background: #F3BA2F; color: #1E293B; }
.asset-symbol-icon.sol { background: #8B5CF6; }
.asset-symbol-icon.trx { background: #EF0027; }
.asset-symbol-icon.arb { background: #2563EB; }
.asset-symbol-icon.pol { background: #7C3AED; }

.asset-name {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-white);
}

.asset-network {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.asset-balance-block {
    text-align: right;
    flex-shrink: 0;
    margin-left: 0.75rem;
}

.asset-balance-human {
    font-weight: 700;
    font-size: 0.95rem;
    font-variant-numeric: tabular-nums;
    color: var(--text-white);
    white-space: nowrap;
}

.asset-balance-usd {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

/* Bottom Tab Navigation Bar */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    background: rgba(17, 28, 48, 0.94);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--border-dark);
    display: flex;
    justify-content: space-around;
    padding-top: 0.5rem;
    padding-bottom: calc(var(--safe-bottom) + 0.5rem);
    z-index: 100;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    color: var(--text-subtle);
    background: none;
    border: none;
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0.35rem 0.75rem;
    transition: color 0.15s;
}

.nav-item.active {
    color: var(--primary);
}

.nav-item svg {
    width: 22px;
    height: 22px;
    stroke-width: 2;
}

/* Forms & Inputs */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.45rem;
}

.form-control {
    width: 100%;
    background: var(--surface-dark);
    border: 1px solid var(--border-dark);
    border-radius: 12px;
    padding: 0.85rem 1rem;
    font-size: 1rem;
    color: var(--text-white);
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    user-select: text;
    -webkit-user-select: text;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.input-with-button {
    display: flex;
    gap: 0.5rem;
}

.input-with-button .form-control {
    flex: 1;
}

.btn-inline {
    background: var(--surface-elevated);
    border: 1px solid var(--border-dark);
    color: #60A5FA;
    font-weight: 600;
    font-size: 0.8rem;
    padding: 0 0.85rem;
    border-radius: 10px;
    cursor: pointer;
    white-space: nowrap;
}

.btn-primary-pwa {
    width: 100%;
    background: var(--primary);
    color: #FFFFFF;
    font-weight: 600;
    font-size: 1rem;
    padding: 0.95rem 1.25rem;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: background 0.15s, transform 0.1s;
}

.btn-primary-pwa:hover {
    background: var(--primary-hover);
}

.btn-primary-pwa:active {
    transform: scale(0.98);
}

.btn-secondary-pwa {
    width: 100%;
    background: var(--surface-elevated);
    border: 1px solid var(--border-dark);
    color: var(--text-white);
    font-weight: 600;
    font-size: 1rem;
    padding: 0.95rem 1.25rem;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: background 0.15s;
}

.btn-secondary-pwa:active {
    background: rgba(255, 255, 255, 0.08);
}

.btn-danger-pwa {
    width: 100%;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #F87171;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.85rem 1.25rem;
    border-radius: 12px;
    cursor: pointer;
}

/* QR Code Display Container */
.qr-container {
    background: #FFFFFF;
    border-radius: 16px;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 1rem auto;
    width: 220px;
    height: 220px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.qr-container svg {
    width: 100%;
    height: 100%;
}

.qr-address-box,
.address-box {
    background: var(--surface-dark);
    border: 1px solid var(--border-dark);
    border-radius: 12px;
    padding: 0.85rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.qr-address-text,
.address-text {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.825rem;
    color: #60A5FA;
    word-break: break-all;
    user-select: all;
    -webkit-user-select: all;
}

.btn-copy-address,
.btn-copy {
    background: var(--surface-elevated);
    border: 1px solid var(--border-dark);
    color: var(--text-white);
    padding: 0.45rem 0.65rem;
    border-radius: 8px;
    font-size: 0.75rem;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none;
    align-items: flex-end;
    justify-content: center;
    z-index: 200;
}

.modal-overlay.active {
    display: flex;
}

.modal-sheet {
    background: var(--surface-dark);
    border-top: 1px solid var(--border-dark);
    border-radius: 24px 24px 0 0;
    width: 100%;
    max-width: 480px;
    padding: 1.5rem 1.25rem calc(var(--safe-bottom) + 1.5rem);
    animation: slideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    max-height: 85vh;
    overflow-y: auto;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.modal-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-white);
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
}

/* Toast Notification */
.toast-notice {
    position: fixed;
    top: calc(var(--safe-top) + 1rem);
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: #1E293B;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #FFFFFF;
    padding: 0.75rem 1.25rem;
    border-radius: 9999px;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    opacity: 0;
    pointer-events: none;
    transition: all 0.25s ease;
    z-index: 300;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.toast-notice.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast-notice.error {
    background: #7F1D1D;
    border-color: #EF4444;
}

.toast-notice.success {
    background: #064E3B;
    border-color: #10B981;
}

/* Shofly-style iOS Safari Add to Home Screen Banner */
.ios-install-banner {
    background: linear-gradient(135deg, #102A56 0%, #152C5B 100%);
    border: 1px solid rgba(37, 99, 235, 0.4);
    border-radius: 16px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    position: relative;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.ios-install-banner.hidden {
    display: none !important;
}

.ios-install-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.ios-install-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #FFFFFF;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ios-banner-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.25rem;
    cursor: pointer;
    line-height: 1;
    padding: 0.25rem;
}

.ios-step-guide {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    font-size: 0.825rem;
    color: #CBD5E1;
}

.ios-step-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ios-step-number {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary);
    color: #FFFFFF;
    font-size: 0.7rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ios-share-badge {
    background: rgba(255, 255, 255, 0.15);
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    font-weight: 600;
    color: #FFFFFF;
}

/* History Screen Cards */
.history-filters,
.history-filter-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-dark);
    padding-bottom: 0.5rem;
}

.filter-tab {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.4rem 0.75rem;
    border-radius: 8px;
    cursor: pointer;
}

.filter-tab.active {
    background: var(--surface-elevated);
    color: #60A5FA;
}

.tx-card {
    background: var(--surface-dark);
    border: 1px solid var(--border-dark);
    border-radius: 12px;
    padding: 0.85rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.65rem;
    cursor: pointer;
}

.tx-icon-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.tx-icon-circle.deposit {
    background: rgba(16, 185, 129, 0.15);
    color: #10B981;
}

.tx-icon-circle.withdrawal {
    background: rgba(239, 68, 68, 0.15);
    color: #EF4444;
}

.tx-badge {
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
}

.tx-badge.completed { background: rgba(16, 185, 129, 0.2); color: #34D399; }
.tx-badge.pending { background: rgba(245, 158, 11, 0.2); color: #FBBF24; }
.tx-badge.rejected { background: rgba(239, 68, 68, 0.2); color: #F87171; }

/* Disclosure and Security Info Card */
.security-card {
    background: var(--surface-dark);
    border: 1px solid var(--border-dark);
    border-radius: 14px;
    padding: 1.15rem;
    margin-bottom: 1.25rem;
}

.security-card-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-white);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.security-card-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* ==========================================================================
   PASSWORDLESS WALLET ONBOARDING, RECOVERY & PIN KEYPAD STYLES
   ========================================================================== */

/* 12-Word Recovery Phrase Display Grid */
.recovery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin: 1.25rem 0;
}

@media (max-width: 360px) {
    .recovery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.word-chip {
    background: var(--surface-dark);
    border: 1px solid var(--border-dark);
    border-radius: 10px;
    padding: 0.5rem 0.6rem;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.85rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    user-select: text;
    -webkit-user-select: text;
}

.word-index,
.word-num {
    color: #60A5FA;
    font-size: 0.7rem;
    font-weight: 700;
    min-width: 18px;
}

.word-text {
    color: var(--text-white);
    font-weight: 600;
    letter-spacing: 0.02em;
}

/* Warning & Acknowledgement Box */
.phrase-warning-box {
    background: rgba(37, 99, 235, 0.08);
    border: 1px solid rgba(37, 99, 235, 0.25);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1.25rem;
}

.phrase-warning-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #93C5FD;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 0.4rem;
}

.phrase-warning-text {
    font-size: 0.775rem;
    color: #94A3B8;
    line-height: 1.45;
}

/* Recovery Word Confirmation Box & Interactive Challenges */
.confirm-step-box {
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.7) 0%, rgba(15, 23, 42, 0.9) 100%);
    border: 1.5px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 1.15rem 1rem;
    margin-bottom: 1.15rem;
    box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.35);
    transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.2s ease;
    position: relative;
    overflow: hidden;
}

.confirm-step-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: transparent;
    transition: background 0.25s ease;
}

.confirm-step-box.answered {
    border-color: rgba(59, 130, 246, 0.4);
    box-shadow: 0 6px 24px -2px rgba(37, 99, 235, 0.15);
}

.confirm-step-box.answered::before {
    background: linear-gradient(90deg, #2563EB, #60A5FA);
}

.confirm-step-box.shake-error {
    animation: shake 0.45s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
    border-color: #EF4444 !important;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.35) !important;
}

.confirm-step-box.shake-error::before {
    background: #EF4444 !important;
}

.confirm-step-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.85rem;
    padding-bottom: 0.65rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.confirm-step-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.confirm-badge {
    display: inline-flex;
    align-items: center;
    background: rgba(37, 99, 235, 0.18);
    border: 1px solid rgba(59, 130, 246, 0.35);
    color: #93C5FD;
    padding: 0.25rem 0.6rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.confirm-hint {
    font-size: 0.775rem;
    color: #94A3B8;
    font-weight: 500;
}

.confirm-status-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748B;
    background: rgba(255, 255, 255, 0.04);
    padding: 0.25rem 0.6rem;
    border-radius: 9999px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: all 0.2s ease;
}

.confirm-status-tag .status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #64748B;
    transition: background 0.2s ease;
}

.confirm-status-tag.selected {
    color: #93C5FD;
    background: rgba(37, 99, 235, 0.2);
    border-color: rgba(59, 130, 246, 0.4);
}

.confirm-status-tag.selected .status-text {
    font-weight: 700;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.confirm-options-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.65rem;
    width: 100%;
}

.confirm-word-opt {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 50px;
    padding: 0.75rem 0.85rem;
    background: rgba(30, 41, 59, 0.85);
    border: 1.5px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    color: #F1F5F9;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    outline: none;
    box-sizing: border-box;
}

.confirm-word-opt:hover {
    background: rgba(51, 65, 85, 0.85);
    border-color: rgba(96, 165, 250, 0.4);
}

.confirm-word-opt:active {
    transform: scale(0.97);
}

.confirm-word-opt.selected {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.25) 0%, rgba(30, 58, 138, 0.45) 100%) !important;
    border-color: #3B82F6 !important;
    color: #FFFFFF !important;
    box-shadow: 0 0 16px rgba(59, 130, 246, 0.35), inset 0 0 12px rgba(59, 130, 246, 0.15) !important;
}

.confirm-word-num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
    color: #94A3B8;
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
    pointer-events: none;
    transition: all 0.18s ease;
}

.confirm-word-opt.selected .confirm-word-num {
    background: #2563EB;
    color: #FFFFFF;
}

.confirm-word-text {
    flex: 1;
    text-align: left;
    padding-left: 0.65rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.925rem;
    letter-spacing: 0.02em;
    color: inherit;
    pointer-events: none;
}

.confirm-word-check {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    opacity: 0;
    transform: scale(0.5);
    color: #60A5FA;
    flex-shrink: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.confirm-word-opt.selected .confirm-word-check {
    opacity: 1;
    transform: scale(1);
}

/* Fallback styling for prompt/num */
.confirm-target-prompt {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-white);
    margin-bottom: 0.75rem;
}

.confirm-target-num {
    display: inline-block;
    background: rgba(37, 99, 235, 0.2);
    color: #60A5FA;
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    font-weight: 700;
}

.word-options-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.65rem;
    margin-top: 0.75rem;
}

.word-option-btn {
    background: rgba(30, 41, 59, 0.85);
    border: 1.5px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 0.75rem 0.85rem;
    color: #F1F5F9;
    font-size: 0.925rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s ease;
}

.word-option-btn.selected {
    background: #2563EB;
    border-color: #60A5FA;
    color: #FFFFFF;
}

.btn-primary-pwa:disabled,
.btn-secondary-pwa:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
    transform: none !important;
}

.btn-primary-pwa:not(:disabled) {
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.4);
}

/* 4-Digit PIN Dots Indicator */
.pin-dots-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    margin: 1.5rem 0 2rem;
}

.pin-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid #334155;
    background: transparent;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

.pin-dot.filled {
    border-color: var(--primary);
    background: var(--primary);
    box-shadow: 0 0 12px rgba(37, 99, 235, 0.6);
    transform: scale(1.1);
}

.pin-dot.error {
    border-color: var(--error);
    background: var(--error);
    animation: shake 0.3s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}

/* Numeric Touch Keypad */
.numeric-keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.85rem;
    max-width: 300px;
    margin: 0 auto 1.5rem;
    width: 100%;
}

.keypad-btn {
    aspect-ratio: 1;
    border-radius: 50%;
    background: var(--surface-dark);
    border: 1px solid var(--border-dark);
    color: var(--text-white);
    font-size: 1.4rem;
    font-weight: 600;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    transition: all 0.1s ease;
    user-select: none;
    -webkit-user-select: none;
}

.keypad-btn:active {
    background: var(--surface-elevated);
    border-color: #60A5FA;
    transform: scale(0.92);
}

.keypad-subtext {
    font-size: 0.55rem;
    color: #64748B;
    letter-spacing: 0.1em;
    margin-top: 1px;
}

.keypad-btn.action {
    background: none;
    border: none;
    box-shadow: none;
    color: var(--text-muted);
}

.keypad-btn.action:active {
    background: rgba(255, 255, 255, 0.05);
    transform: scale(0.92);
}

/* Restore 12-Word Input Grid */
.restore-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    margin: 1.25rem 0;
}

.restore-field-box,
.restore-input-group {
    display: flex;
    align-items: center;
    background: var(--surface-dark);
    border: 1px solid var(--border-dark);
    border-radius: 10px;
    padding: 0.35rem 0.5rem;
    gap: 0.35rem;
}

.restore-field-box:focus-within,
.restore-input-group:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.restore-field-num,
.restore-word-num {
    color: #64748B;
    font-size: 0.7rem;
    font-weight: 700;
    min-width: 18px;
}

.restore-word-input,
.restore-word-field {
    background: none;
    border: none;
    outline: none;
    color: var(--text-white);
    font-size: 0.85rem;
    font-weight: 600;
    width: 100%;
}

/* Enrolled Devices List in Profile */
.device-card {
    background: var(--surface-dark);
    border: 1px solid var(--border-dark);
    border-radius: 12px;
    padding: 0.85rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.65rem;
}

.device-info-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-white);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.device-info-meta {
    font-size: 0.725rem;
    color: #64748B;
    margin-top: 0.2rem;
}

.device-badge-current {
    background: rgba(16, 185, 129, 0.15);
    color: #10B981;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
}

.btn-revoke-device,
.btn-revoke {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #EF4444;
    font-size: 0.725rem;
    font-weight: 600;
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    cursor: pointer;
}

.btn-revoke:hover {
    background: rgba(239, 68, 68, 0.25);
}


/* ---- Styles for markup classes that previously had no rule ---- */
.eye-toggle {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #FFFFFF;
    width: 34px;
    height: 34px;
    padding: 0;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
}

.eye-toggle:active {
    background: rgba(255, 255, 255, 0.22);
    transform: scale(0.94);
}

.portfolio-subtext {
    margin-top: 0.25rem;
}

.qr-card {
    background: var(--surface-dark);
    border: 1px solid var(--border-dark);
    border-radius: 16px;
    padding: 1.25rem 1rem;
    margin-bottom: 1.25rem;
    text-align: center;
}

.qr-address-box {
    text-align: left;
    margin-bottom: 0.75rem;
    flex-direction: column;
    align-items: flex-start;
}

.qr-address-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748B;
}

.btn-copy-address {
    width: 100%;
    justify-content: center;
    padding: 0.7rem 0.85rem;
    font-size: 0.85rem;
    font-weight: 600;
}

.btn-max-amount {
    background: rgba(37, 99, 235, 0.18);
    border: 1px solid rgba(96, 165, 250, 0.35);
    color: #60A5FA;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 0.3rem 0.6rem;
    border-radius: 8px;
    cursor: pointer;
}

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

.shake {
    animation: shake 0.45s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

/* Settings (profile) */
.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    background: var(--surface-dark);
    border: 1px solid var(--border-dark);
    border-radius: 12px;
    padding: 0.85rem 1rem;
    margin-bottom: 0.65rem;
    color: var(--text-white);
}

.settings-row-title {
    font-size: 0.875rem;
    font-weight: 600;
}

.settings-row-sub {
    font-size: 0.72rem;
    color: #64748B;
    margin-top: 0.15rem;
}

.settings-select {
    background: var(--surface-elevated);
    border: 1px solid var(--border-dark);
    color: var(--text-white);
    border-radius: 8px;
    padding: 0.4rem 0.5rem;
    font-size: 0.8rem;
    font-family: inherit;
}

.settings-btn {
    background: rgba(37, 99, 235, 0.18);
    border: 1px solid rgba(96, 165, 250, 0.35);
    color: #60A5FA;
    border-radius: 8px;
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}

/* Responsive Desktop & Tablet Web Wallet Experience */
@media (min-width: 768px) {
    body {
        background: radial-gradient(circle at top, #132238 0%, #0B1220 100%);
    }

    #app-viewport {
        max-width: 860px;
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
        border-left: 1px solid var(--border-dark);
        border-right: 1px solid var(--border-dark);
    }

    .screen {
        padding-left: 2.5rem;
        padding-right: 2.5rem;
    }

    /* Auth, PIN, and Mnemonic setup screens stay centered and focused */
    #screen-welcome,
    #screen-display-phrase,
    #screen-confirm-phrase,
    #screen-create-pin,
    #screen-confirm-pin,
    #screen-lock,
    #screen-restore {
        max-width: 500px;
        margin: 0 auto;
        width: 100%;
    }

    /* Dashboard Grid Expansion */
    .portfolio-card {
        padding: 2rem;
        border-radius: 20px;
    }

    .portfolio-val {
        font-size: 2.75rem;
    }

    .quick-actions-row {
        gap: 1.5rem;
        margin: 1.5rem 0 2rem;
    }

    .quick-action-btn {
        padding: 1.15rem 1rem;
        font-size: 0.95rem;
        border-radius: 14px;
    }

    .asset-item {
        padding: 1rem 1.25rem;
        border-radius: 14px;
        transition: background 0.15s ease, transform 0.15s ease;
    }

    .asset-item:hover {
        background: var(--surface-elevated);
        transform: translateY(-1px);
    }

    .transaction-item {
        padding: 1rem 1.25rem;
        border-radius: 14px;
    }

    .modal-sheet {
        max-width: 520px;
        border-radius: 24px;
        margin-bottom: 2rem;
    }
}

@media (min-width: 1024px) {
    #app-viewport {
        max-width: 960px;
    }
}

/* Biometric / WebAuthn Prompt Button Styling */
.biometric-prompt-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.85rem 1rem;
    background: rgba(37, 99, 235, 0.15);
    border: 1px solid rgba(96, 165, 250, 0.4);
    border-radius: 12px;
    color: #60A5FA;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 1.25rem;
    font-family: inherit;
}

.biometric-prompt-btn:hover {
    background: rgba(37, 99, 235, 0.25);
    border-color: #60A5FA;
}

.bell-btn {
    position: relative;
    background: none;
    border: none;
    color: #94A3B8;
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
}

.bell-badge {
    position: absolute;
    top: -2px;
    right: -4px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    background: #EF4444;
    color: #FFFFFF;
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
}

.notif-card {
    padding: 0.85rem 1rem;
    margin-bottom: 0.6rem;
    border: 1px solid var(--border-dark);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    cursor: pointer;
}

.notif-card.unread {
    border-color: rgba(96, 165, 250, 0.45);
    background: rgba(96, 165, 250, 0.08);
}

.tx-detail-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-dark);
}

.tx-detail-row span:first-child { color: #94A3B8; flex-shrink: 0; }
.tx-detail-row strong { color: #FFFFFF; text-align: right; word-break: break-all; }
.tx-card { cursor: pointer; }

/* Coin / network pickers (bottom sheet) */
.picker-field {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    background: var(--surface-dark);
    border: 1px solid var(--border-dark);
    border-radius: 12px;
    padding: 0.7rem 1rem;
    min-height: 3.4rem;
    color: var(--text-white);
    font-size: 1rem;
    text-align: left;
    cursor: pointer;
}

.picker-field:active { background: var(--surface-elevated); }
.picker-field[disabled] { cursor: default; opacity: 0.85; }
.picker-field-main { display: flex; align-items: center; gap: 0.75rem; min-width: 0; }
.picker-field-text { min-width: 0; }
.picker-field-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.picker-field-sub { font-size: 0.75rem; color: var(--text-muted); }
.picker-chevron { flex: none; color: var(--text-muted); }

.sheet-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    align-items: flex-end;
    justify-content: center;
    z-index: 1000;
}

.sheet-backdrop.active { display: flex; }

.sheet {
    width: 100%;
    max-width: 520px;
    height: 85vh;
    background: var(--bg-dark);
    border-radius: 20px 20px 0 0;
    border: 1px solid var(--border-dark);
    display: flex;
    flex-direction: column;
    padding: 1rem 1rem calc(0.5rem + var(--safe-bottom));
    animation: sheet-up 0.22s ease-out;
}

@keyframes sheet-up {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.sheet-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.75rem; }
.sheet-title { font-size: 1.1rem; font-weight: 700; }
.sheet-close { background: none; border: none; color: var(--text-muted); font-size: 1.8rem; line-height: 1; cursor: pointer; padding: 0 0.25rem; }
.sheet-search { margin-bottom: 0.5rem; }
.sheet-list { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; }

.sheet-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.8rem 0.5rem;
    cursor: pointer;
    border-radius: 12px;
}

.sheet-row:active, .sheet-row.selected { background: var(--surface-dark); }
.sheet-row-left { display: flex; align-items: center; gap: 0.85rem; min-width: 0; }
.sheet-row-title { font-weight: 600; font-size: 1rem; }
.sheet-row-title small { font-weight: 400; color: var(--text-muted); margin-left: 0.35rem; font-size: 0.8rem; }
.sheet-row-sub { font-size: 0.78rem; color: var(--text-muted); }
.sheet-row-right { text-align: right; flex: none; font-size: 0.85rem; }
.sheet-empty { text-align: center; color: var(--text-subtle); padding: 2rem 0; }

/* Withdrawal progress tracker */
.wd-processing { text-align:center; padding:1.5rem 0 1rem; color:#E2E8F0; }
.wd-spinner { width:44px; height:44px; margin:0 auto 1rem; border:4px solid rgba(96,165,250,0.25); border-top-color:#60A5FA; border-radius:50%; animation:wd-spin 0.9s linear infinite; }
@keyframes wd-spin { to { transform:rotate(360deg); } }
.wd-processing-title { font-weight:700; font-size:1.05rem; color:#FFFFFF; }
.wd-processing-sub { font-size:0.8rem; color:#94A3B8; margin-top:0.35rem; }
.wd-steps { list-style:none; margin:1rem 0; padding:0; }
.wd-step { display:flex; gap:0.75rem; position:relative; padding-bottom:1rem; }
.wd-step:last-child { padding-bottom:0; }
.wd-step::before { content:''; position:absolute; left:11px; top:24px; bottom:0; width:2px; background:rgba(148,163,184,0.25); }
.wd-step:last-child::before { display:none; }
.wd-step.done::before { background:#10B981; }
.wd-dot { flex:0 0 24px; height:24px; border-radius:50%; border:2px solid rgba(148,163,184,0.4); display:flex; align-items:center; justify-content:center; font-size:0.7rem; color:#fff; background:transparent; z-index:1; }
.wd-step.done .wd-dot { background:#10B981; border-color:#10B981; }
.wd-step.current .wd-dot { border-color:#60A5FA; background:rgba(96,165,250,0.2); animation:wd-pulse 1.4s ease-in-out infinite; }
.wd-step.error .wd-dot { background:#EF4444; border-color:#EF4444; }
@keyframes wd-pulse { 50% { box-shadow:0 0 0 6px rgba(96,165,250,0.15); } }
.wd-label { font-size:0.9rem; font-weight:600; color:#94A3B8; }
.wd-step.done .wd-label, .wd-step.current .wd-label { color:#FFFFFF; }
.wd-step.error .wd-label { color:#FCA5A5; }
.wd-sub { font-size:0.75rem; color:#64748B; margin-top:0.1rem; }
