/**
 * $NSS token widget — matches site noir (agent-pulse, filters, brass/cyan palette).
 */
.live-right-rail .token-widget {
    width: 100%;
    flex-shrink: 0;
}

.token-widget {
    position: relative;
    background: linear-gradient(165deg, rgba(22, 26, 34, 0.94) 0%, rgba(18, 20, 28, 0.97) 100%);
    border: 1px solid rgba(90, 82, 70, 0.45);
    border-radius: 14px;
    padding: 16px 14px 14px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.04),
        0 8px 28px rgba(0, 0, 0, 0.45);
    overflow: hidden;
    font-family: var(--font-ui, 'Source Sans 3', system-ui, sans-serif);
    font-size: 13px;
    color: #f5f0e6;
}

.token-widget__glow {
    position: absolute;
    inset: -35% -15%;
    background:
        radial-gradient(ellipse at 20% 0%, rgba(196, 163, 90, 0.12), transparent 55%),
        radial-gradient(ellipse at 80% 100%, rgba(61, 212, 232, 0.07), transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.token-widget__inner {
    position: relative;
    z-index: 1;
}

.token-widget__inner::before {
    content: '';
    display: block;
    height: 1px;
    margin: -4px 0 14px;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(196, 163, 90, 0.45) 20%,
        rgba(61, 212, 232, 0.35) 50%,
        rgba(196, 163, 90, 0.45) 80%,
        transparent
    );
    opacity: 0.85;
}

.token-widget__header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}

.token-widget__avatar {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    padding: 2px;
    border-radius: 12px;
    background: linear-gradient(145deg, rgba(196, 163, 90, 0.85) 0%, rgba(138, 112, 56, 0.9) 100%);
    box-shadow:
        0 0 14px rgba(196, 163, 90, 0.3),
        0 0 22px rgba(61, 212, 232, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.token-widget__avatar-img {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 10px;
    object-fit: cover;
    object-position: center 12%;
    background: #120e0c;
    border: 1px solid rgba(90, 82, 70, 0.55);
}

.token-widget__title-block {
    flex: 1;
    min-width: 0;
    padding-top: 2px;
}

.token-widget__name {
    margin: 0 0 4px;
    font-family: var(--font-title, 'Cinzel', Georgia, serif);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.25;
    color: #f5f0e6;
    letter-spacing: 0.02em;
    text-shadow: 0 0 14px rgba(255, 248, 231, 0.12), 0 1px 2px rgba(0, 0, 0, 0.75);
}

.token-widget__ticker {
    margin: 0;
    font-family: var(--font-mono, 'Share Tech Mono', monospace);
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 0.08em;
    color: #c4a35a;
    text-shadow: 0 0 12px rgba(196, 163, 90, 0.25);
}

.token-widget__badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
    padding: 4px 10px;
    border-radius: 999px;
    font-family: var(--font-mono, 'Share Tech Mono', monospace);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #86c9b1;
    background: rgba(18, 16, 14, 0.65);
    border: 1px solid rgba(90, 82, 70, 0.5);
    text-shadow: 0 0 10px rgba(61, 212, 232, 0.25);
}

.token-widget__badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #3dd4e8;
    box-shadow: 0 0 8px rgba(61, 212, 232, 0.65);
    animation: token-widget-pulse 2.4s ease-in-out infinite;
}

@keyframes token-widget-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.85); }
}

.token-widget__ca-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    padding: 8px 10px;
    background: rgba(18, 16, 14, 0.75);
    border: 1px solid rgba(90, 82, 70, 0.4);
    border-radius: 8px;
}

.token-widget__ca-label {
    flex-shrink: 0;
    font-family: var(--font-mono, 'Share Tech Mono', monospace);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #9a9080;
}

.token-widget__ca-value {
    flex: 1;
    min-width: 0;
    font-family: var(--font-mono, 'Share Tech Mono', monospace);
    font-size: 11px;
    color: #c9b896;
    letter-spacing: 0.03em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.token-widget__copy-btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid rgba(74, 64, 48, 0.55);
    border-radius: 8px;
    background: linear-gradient(180deg, #2a2418 0%, #1a1610 100%);
    color: #c4b8a8;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s, box-shadow 0.2s, transform 0.15s;
}

.token-widget__copy-btn:hover {
    border-color: rgba(196, 163, 90, 0.65);
    color: #f0ebe0;
    box-shadow: 0 0 12px rgba(196, 163, 90, 0.15);
}

.token-widget__copy-btn:active {
    transform: scale(0.94);
}

.token-widget__copy-btn:focus-visible {
    outline: none;
    border-color: rgba(196, 163, 90, 0.65);
    box-shadow: 0 0 0 2px rgba(196, 163, 90, 0.18);
}

.token-widget__copy-btn.is-copied {
    border-color: rgba(61, 212, 232, 0.5);
    background: rgba(61, 212, 232, 0.1);
    color: #3dd4e8;
    box-shadow: 0 0 14px rgba(61, 212, 232, 0.2);
}

.token-widget__copy-btn svg {
    width: 15px;
    height: 15px;
}

.token-widget__copy-btn .token-widget__icon-check {
    display: none;
}

.token-widget__copy-btn.is-copied .token-widget__icon-copy {
    display: none;
}

.token-widget__copy-btn.is-copied .token-widget__icon-check {
    display: block;
}

.token-widget__status {
    margin: 0 0 12px;
    font-size: 11px;
    line-height: 1.5;
    color: #a89f8e;
}

.token-widget__buy-heading {
    margin: 0 0 8px;
    font-family: var(--font-mono, 'Share Tech Mono', monospace);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #9a9080;
}

.token-widget__buy-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 12px;
}

.token-widget__buy-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 72px;
    padding: 10px 8px;
    border: 1px solid rgba(0, 0, 0, 0.35);
    border-radius: 10px;
    background: linear-gradient(180deg, #e8d49c 0%, #c4a35a 45%, #8a7038 100%);
    color: #1a1510 !important;
    -webkit-text-fill-color: #1a1510;
    font-family: var(--font-ui, 'Source Sans 3', system-ui, sans-serif);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-decoration: none;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
    cursor: pointer;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.35),
        0 4px 14px rgba(0, 0, 0, 0.32);
    transition: filter 0.2s, box-shadow 0.2s, transform 0.15s;
}

.token-widget__buy-icon {
    display: block;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    object-fit: cover;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.token-widget__buy-action {
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.12em;
    line-height: 1;
    text-align: center;
}

.token-widget__buy-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.04em;
    line-height: 1.2;
    text-align: center;
    opacity: 0.92;
}

.token-widget__buy-btn:hover {
    color: #1a1510 !important;
    -webkit-text-fill-color: #1a1510;
    filter: brightness(1.08);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.4),
        0 0 16px rgba(61, 212, 232, 0.18),
        0 4px 16px rgba(0, 0, 0, 0.38);
    transform: translateY(-1px);
}

.token-widget__buy-btn:active {
    transform: translateY(0);
}

.token-widget__buy-btn:focus-visible {
    outline: none;
    box-shadow:
        0 0 0 2px rgba(61, 212, 232, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.token-widget__cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 10px 14px;
    border: 1px solid rgba(0, 0, 0, 0.35);
    border-radius: 10px;
    background: linear-gradient(180deg, #e8d49c 0%, #c4a35a 45%, #8a7038 100%);
    color: #1a1510 !important;
    -webkit-text-fill-color: #1a1510;
    font-family: var(--font-ui, 'Source Sans 3', system-ui, sans-serif);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-decoration: none;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
    cursor: pointer;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.35),
        0 4px 16px rgba(0, 0, 0, 0.35);
    transition: filter 0.2s, box-shadow 0.2s, transform 0.15s;
}

.token-widget__cta svg {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    color: #1a1510;
    stroke: #1a1510;
}

.token-widget__cta:hover {
    color: #1a1510 !important;
    -webkit-text-fill-color: #1a1510;
    filter: brightness(1.08);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.4),
        0 0 16px rgba(61, 212, 232, 0.2),
        0 4px 18px rgba(0, 0, 0, 0.4);
    transform: translateY(-1px);
}

.token-widget__cta:active {
    transform: translateY(0);
}

.token-widget__cta:focus-visible {
    outline: none;
    box-shadow:
        0 0 0 2px rgba(61, 212, 232, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.token-widget__explorer {
    display: flex;
    justify-content: center;
    margin-top: 10px;
}

.token-widget__explorer-link {
    font-family: var(--font-mono, 'Share Tech Mono', monospace);
    font-size: 10px;
    letter-spacing: 0.04em;
    color: #9a9080;
    text-decoration: none;
    transition: color 0.2s;
}

.token-widget__explorer-link:hover {
    color: #3dd4e8;
    text-shadow: 0 0 10px rgba(61, 212, 232, 0.3);
}

.token-widget__toast {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    padding: 6px 12px;
    border-radius: 8px;
    font-family: var(--font-mono, 'Share Tech Mono', monospace);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #1a1510;
    background: linear-gradient(180deg, #e8d49c 0%, #c4a35a 100%);
    border: 1px solid rgba(0, 0, 0, 0.25);
    box-shadow: 0 4px 16px rgba(196, 163, 90, 0.35);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s;
    white-space: nowrap;
    z-index: 3;
}

.token-widget__toast.is-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

@media (max-width: 768px) {
    .token-widget {
        padding: 14px 12px 12px;
    }

    .token-widget__header {
        gap: 10px;
    }

    .token-widget__avatar {
        width: 48px;
        height: 48px;
    }

    .token-widget__name {
        font-size: 13px;
    }
}

/* Login page — widget below key form */
.login-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: sticky;
    top: 20px;
}

.login-sidebar .login-container {
    position: static;
}

.login-sidebar [data-nss-token-widget] .token-widget {
    width: 100%;
}
