.nd-widget {
    border-radius: 12px;
    padding: 16px 18px;
    margin: 24px 0;
    background: linear-gradient(135deg, #fdfbfb 0%, #ebedee 100%);
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
}

.nd-widget__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.nd-widget__title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
}

.nd-widget__body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.nd-widget__filters {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 4px;
}

.nd-filter-pill {
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.5);
    padding: 4px 10px;
    font-size: 0.78rem;
    background: rgba(255, 255, 255, 0.9);
    cursor: pointer;
}

.nd-filter-pill--active {
    background: #6366f1;
    color: #fff;
    border-color: #6366f1;
}

.nd-widget .nd-filter-pill {
    color: #0f172a !important;
    font-weight: 600;
}

.nd-widget .nd-filter-pill.nd-filter-pill--active {
    color: #ffffff !important;
}

.nd-filter-row {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    padding-bottom: 2px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.nd-widget__label {
    display: block;
}

.nd-widget__label-text {
    display: block;
    margin-bottom: 4px;
    font-size: 0.9rem;
    opacity: 0.8;
}

.nd-widget__input {
    width: 100%;
    padding: 10px 12px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.6);
    font-size: 1rem;
}

.nd-widget__input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.25);
}

.nd-widget__results {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
}

.nd-widget__empty {
    margin: 0;
    font-size: 0.9rem;
    opacity: 0.8;
}

.nd-style-card {
    border-radius: 10px;
    padding: 10px 12px;
    background: #fff;
    border: 1px solid rgba(148, 163, 184, 0.25);
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.nd-variant-strip {
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 8px;
    padding: 2px 0 4px;
}

.nd-variant {
    background: #f9fafb;
    border-radius: 8px;
    padding: 6px 8px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    display: flex;
    flex-direction: column;
    gap: 4px;
    animation: nd-fade-in 0.18s ease-out;
}

.nd-variant-label {
    font-size: 0.8rem;
    color: #0f172a;
    font-weight: 500;
}

.nd-widget .nd-style-card__name {
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    opacity: 1;
    color: #f9fafb !important;
    background: #4f46e5 !important;
    padding: 3px 12px;
    border-radius: 999px;
    align-self: flex-start;
    margin-bottom: 2px;
}

.nd-style-card__value {
    font-size: 1rem;
    white-space: pre-wrap;
    word-break: normal;
    margin-bottom: 4px;
}

.nd-style-card__actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
}

.nd-style-card__favorite {
    border: none;
    background: transparent;
    font-size: 0.9rem;
    cursor: pointer;
    padding: 0;
}

.nd-style-card__copy {
    border-radius: 999px;
    border: none;
    padding: 4px 10px;
    font-size: 0.8rem;
    background: #6366f1;
    color: #fff;
    cursor: pointer;
}

.nd-style-card__copy:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.25);
}

.nd-style-card__more {
    margin-top: 4px;
    align-self: flex-start;
    border-radius: 999px;
    border: none;
    padding: 4px 10px;
    font-size: 0.78rem;
    background: rgba(148, 163, 184, 0.2);
    color: #111827;
    cursor: pointer;
}

.nd-style-card__pager {
    display: flex;
    gap: 4px;
    margin-top: 4px;
}

.nd-style-card__pager-dot {
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.7);
}

.nd-style-card__pager-dot--active {
    width: 14px;
    background: #6366f1;
}

@media (min-width: 768px) {
    .nd-variant-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@keyframes nd-fade-in {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.nd-footer-trigger {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 9999;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    border: none;
    background: #111827;
    color: #f9fafb;
    cursor: pointer;
    font-size: 0.9rem;
}

.nd-footer-trigger__icon {
    font-size: 1.1rem;
}

.nd-modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease-out;
}

.nd-modal.is-open {
    opacity: 1;
    pointer-events: auto;
}

.nd-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
}

.nd-modal__dialog {
    position: relative;
    max-width: 640px;
    width: 92%;
    max-height: 90vh;
    overflow: auto;
    background: #f9fafb;
    border-radius: 18px;
    padding: 16px 18px 20px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.4);
}

.nd-modal__close {
    position: absolute;
    top: 8px;
    inset-inline-end: 10px;
    border: none;
    background: transparent;
    font-size: 1.4rem;
    cursor: pointer;
}

html[dir="rtl"] .nd-widget__header {
    flex-direction: row-reverse;
}

html[dir="rtl"] .nd-footer-trigger {
    right: auto;
    left: 16px;
}

html[dir="rtl"] .nd-widget {
    text-align: right;
}

html[dir="rtl"] .nd-widget__label-text {
    text-align: right;
}

html[dir="rtl"] .nd-style-card__actions {
    flex-direction: row-reverse;
}
