.visually-hidden {
    position: absolute !important;
    clip-path: inset(50%) !important;
    overflow: hidden !important;
    width: 1px !important;
    height: 1px !important;
    margin: -1px !important;
    padding: 0 !important;
    border: 0 !important;
    white-space: nowrap !important;
}

.apple-notif-stack {
    position: fixed;
    top: 92px;
    right: 20px;
    width: 360px;
    max-width: calc(100vw - 24px);
    z-index: 1050;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.apple-notif-stack.is-empty,
.apple-notif-stack.is-hidden {
    display: none;
}

.apple-notif-empty {
    padding: 16px;
    border-radius: 16px;
    text-align: center;
    font-size: 0.8rem;
    font-weight: 500;
    color: #64748b;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.78);
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.08);
}

html.dark .apple-notif-empty {
    background: rgba(30, 41, 59, 0.86);
    border-color: rgba(255, 255, 255, 0.12);
    color: #94a3b8;
}

.apple-stack-header {
    pointer-events: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.7);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

html.dark .apple-stack-header,
html.dark .apple-notif-card {
    background: rgba(30, 41, 59, 0.86);
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

.apple-stack-title-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.apple-stack-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #f97316;
}

.apple-stack-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: #0f172a;
}

html.dark .apple-stack-title,
html.dark .apple-notif-title {
    color: #f8fafc;
}

.apple-stack-count {
    font-size: 0.72rem;
    font-weight: 700;
    color: #ea580c;
    background: rgba(249, 115, 22, 0.14);
    padding: 2px 8px;
    border-radius: 999px;
}

.apple-stack-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.apple-stack-btn,
.apple-stack-clear-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border: none;
    background: rgba(15, 23, 42, 0.06);
    color: #334155;
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 0.74rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease, transform 0.12s ease;
}

.apple-stack-btn {
    padding: 5px 7px;
}

.apple-stack-btn:hover {
    background: rgba(15, 23, 42, 0.12);
    color: #0f172a;
}

.apple-stack-clear-btn:hover {
    background: rgba(239, 68, 68, 0.12);
    color: #dc2626;
}

html.dark .apple-stack-btn,
html.dark .apple-stack-clear-btn,
html.dark .apple-notif-close {
    background: rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
}

html.dark .apple-stack-btn:hover,
html.dark .apple-notif-close:hover {
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
}

.apple-stack-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: calc(100vh - 170px);
    overflow-y: auto;
    padding: 2px 2px 8px 2px;
    pointer-events: auto;
}

.apple-stack-list.is-collapsed {
    display: none;
}

.apple-notif-card {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 34px 12px 12px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(22px) saturate(180%);
    -webkit-backdrop-filter: blur(22px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.78);
    box-shadow:
        0 12px 30px rgba(15, 23, 42, 0.1),
        0 2px 6px rgba(15, 23, 42, 0.04);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.apple-notif-card.is-entering {
    animation: appleCardSlideIn 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.apple-notif-card.is-clickable {
    cursor: pointer;
}

.apple-notif-card.is-clickable:hover {
    transform: translateY(-1px);
    box-shadow:
        0 16px 34px rgba(15, 23, 42, 0.14),
        0 4px 10px rgba(15, 23, 42, 0.06);
}

.apple-notif-card.is-failed {
    border-color: rgba(239, 68, 68, 0.3);
}

.apple-notif-media {
    flex-shrink: 0;
    width: 54px;
    height: 54px;
    border-radius: 12px;
    overflow: hidden;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
}

html.dark .apple-notif-media {
    background: #1e293b;
}

.apple-notif-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.apple-media-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.apple-media-placeholder.loading {
    background: rgba(14, 165, 233, 0.1);
    color: #0284c7;
}

.apple-media-placeholder.completed {
    background: rgba(16, 185, 129, 0.12);
    color: #10b981;
}

.apple-media-placeholder.failed {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
}

.apple-spinner {
    width: 20px;
    height: 20px;
    border: 2.5px solid rgba(14, 165, 233, 0.25);
    border-top-color: #0284c7;
    border-radius: 50%;
    animation: appleSpin 0.75s linear infinite;
}

.apple-notif-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.apple-notif-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.apple-notif-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

html.dark .apple-notif-status,
html.dark .apple-notif-loading {
    color: #cbd5e1;
}

.apple-notif-host {
    font-size: 0.7rem;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 110px;
}

.apple-notif-title {
    margin: 0;
    font-size: 0.87rem;
    font-weight: 600;
    color: #0f172a;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.apple-notif-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 2px;
}

.apple-notif-price {
    font-size: 0.84rem;
    font-weight: 700;
    color: #0284c7;
}

.apple-notif-price.muted {
    font-size: 0.75rem;
    font-weight: 500;
    color: #64748b;
}

.apple-notif-open {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.72rem;
    font-weight: 600;
    color: #64748b;
}

.apple-notif-stage {
    margin: 2px 0 0 0;
    font-size: 0.76rem;
    font-weight: 600;
    color: #0284c7;
}

html.dark .apple-notif-stage {
    color: #38bdf8;
}

.apple-notif-loading,
.apple-notif-error {
    margin: 0;
    font-size: 0.76rem;
    line-height: 1.35;
    color: #475569;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.apple-notif-error {
    color: #dc2626;
    white-space: normal;
    word-break: break-word;
    background: rgba(239, 68, 68, 0.08);
    border-radius: 8px;
    padding: 6px 8px;
    margin-top: 2px;
}

html.dark .apple-notif-error {
    color: #fca5a5;
    background: rgba(239, 68, 68, 0.16);
}

.apple-notif-url-sub {
    margin: 2px 0 0 0;
    font-size: 0.7rem;
    color: #94a3b8;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.apple-notif-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: none;
    background: rgba(15, 23, 42, 0.06);
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.15s ease, color 0.15s ease;
}

.apple-notif-close:hover {
    background: rgba(15, 23, 42, 0.14);
    color: #0f172a;
}

@keyframes appleCardSlideIn {
    from {
        opacity: 0;
        transform: translateX(24px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes appleSpin {
    to {
        transform: rotate(360deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .apple-notif-card {
        animation: none;
        transition: none;
    }
    .apple-spinner {
        animation: none;
    }
}

@media (max-width: 640px) {
    .apple-notif-stack {
        top: 84px;
        right: 12px;
        left: 12px;
        width: auto;
    }
}
