:root {
    --notification-bg: #090909;
    --notification-surface: #141414;
    --notification-elevated: #1C1C1C;
    --notification-gold: #E9AD32;
    --notification-orange: #F58A19;
    --notification-text: #F4F1EA;
    --notification-muted: #A5A5A5;
    --notification-border: #303030;
}

.notification-trigger {
    position: relative;
    display: inline-flex;
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid var(--notification-border);
    border-radius: 12px;
    background: var(--notification-surface);
    color: var(--notification-text);
    transition: border-color .16s ease, background-color .16s ease, color .16s ease;
}

.notification-trigger:hover,
.notification-trigger:focus-visible,
.notification-trigger[aria-expanded="true"] {
    border-color: rgba(233, 173, 50, .65);
    background: var(--notification-elevated);
    color: var(--notification-gold);
}

.notification-trigger:focus-visible,
.notification-close:focus-visible,
.notification-text-action:focus-visible,
.notification-filter:focus-visible,
.notification-item-action:focus-visible {
    outline: 2px solid var(--notification-gold);
    outline-offset: 2px;
}

.notification-trigger svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.7;
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    display: none;
    min-width: 18px;
    height: 18px;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    border: 2px solid var(--notification-bg);
    border-radius: 999px;
    background: var(--notification-gold);
    color: #17120A;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
}

.notification-badge.is-visible { display: inline-flex; }

.notification-overlay {
    position: fixed;
    z-index: 1085;
    inset: 0;
    display: block;
    background: transparent;
}

.notification-overlay[hidden] { display: none; }

.notification-panel {
    position: fixed;
    top: 68px;
    right: 20px;
    display: flex;
    width: min(390px, calc(100vw - 32px));
    max-height: min(650px, calc(100dvh - 88px));
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #35332E;
    border-radius: 16px;
    background: var(--notification-surface);
    color: var(--notification-text);
    box-shadow: 0 24px 70px rgba(0, 0, 0, .52);
}

.notification-panel-header,
.notification-panel-actions,
.notification-panel-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.notification-panel-header { padding: 20px 20px 14px; }
.notification-panel-header h2,
.notification-page-heading h1 {
    margin: 0;
    color: var(--notification-text);
    font-size: 20px;
    font-weight: 650;
    letter-spacing: -.025em;
}

.notification-eyebrow {
    margin: 0 0 5px;
    color: var(--notification-gold);
    font-size: 9px;
    font-weight: 750;
    letter-spacing: .14em;
}

.notification-unread-line {
    margin: 5px 0 0;
    color: var(--notification-muted);
    font-size: 12px;
}

.notification-unread-line span { color: var(--notification-gold); font-weight: 700; }

.notification-close {
    display: inline-flex;
    width: 36px;
    height: 36px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--notification-border);
    border-radius: 10px;
    background: transparent;
    color: var(--notification-muted);
}

.notification-close:hover { background: var(--notification-elevated); color: var(--notification-text); }
.notification-close svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-width: 1.7; }

.notification-panel-actions {
    min-height: 42px;
    padding: 0 20px;
    border-top: 1px solid var(--notification-border);
}

.notification-section-label {
    color: var(--notification-muted);
    font-size: 11px;
    font-weight: 600;
}

.notification-text-action {
    padding: 7px 0;
    border: 0;
    background: transparent;
    color: var(--notification-gold);
    font-size: 11px;
    font-weight: 600;
}

.notification-text-action:disabled { opacity: .55; cursor: wait; }

.notification-category-row {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 8px 16px 10px;
    border-bottom: 1px solid var(--notification-border);
    scrollbar-width: thin;
    scrollbar-color: #48443A transparent;
}

.notification-filter {
    flex: 0 0 auto;
    padding: 6px 9px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: transparent;
    color: var(--notification-muted);
    font-size: 10px;
    font-weight: 600;
    white-space: nowrap;
}

.notification-filter:hover,
.notification-filter.is-active {
    border-color: rgba(233, 173, 50, .32);
    background: rgba(233, 173, 50, .1);
    color: var(--notification-gold);
}

.notification-panel-content { min-height: 110px; overflow: auto; overscroll-behavior: contain; }
.notification-list { display: flex; flex-direction: column; }

.notification-state {
    display: none;
    margin: 0;
    padding: 24px 20px;
    color: var(--notification-muted);
    font-size: 13px;
    text-align: center;
}

.notification-state.is-visible { display: block; }
.notification-state.is-error { color: #F0A09A; }

.notification-item {
    position: relative;
    display: grid;
    grid-template-columns: 8px minmax(0, 1fr);
    gap: 11px;
    padding: 14px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, .055);
    color: var(--notification-text);
}

.notification-item:hover { background: rgba(255, 255, 255, .025); }
.notification-item.is-unread { background: rgba(233, 173, 50, .035); }
.notification-item-indicator { width: 7px; height: 7px; margin-top: 5px; border-radius: 50%; background: transparent; }
.notification-item.is-unread .notification-item-indicator { background: var(--notification-gold); }
.notification-item-body { min-width: 0; }
.notification-item-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.notification-item-title { margin: 0; color: var(--notification-text); font-size: 12px; font-weight: 650; line-height: 1.45; overflow-wrap: anywhere; }
.notification-item-message { margin: 5px 0 0; color: var(--notification-muted); font-size: 11px; line-height: 1.55; overflow-wrap: anywhere; }
.notification-item-meta { display: flex; align-items: center; gap: 8px; margin-top: 8px; color: #777; font-size: 10px; }
.notification-item-category { color: var(--notification-gold); text-transform: capitalize; }
.notification-item-action { flex: 0 0 auto; padding: 2px 0; border: 0; background: transparent; color: var(--notification-muted); font-size: 10px; }
.notification-item-action:hover { color: var(--notification-gold); }
.notification-item-link { display: inline-block; margin-top: 8px; color: var(--notification-gold); font-size: 11px; font-weight: 600; text-decoration: none; }
.notification-item-link:hover { color: var(--notification-orange); text-decoration: underline; }

.notification-panel-footer {
    min-height: 48px;
    justify-content: center;
    border-top: 1px solid var(--notification-border);
}

.notification-panel-footer a { color: var(--notification-text); font-size: 11px; font-weight: 600; text-decoration: none; }
.notification-panel-footer a span { margin-left: 4px; color: var(--notification-gold); }
.notification-panel-footer a:hover { color: var(--notification-gold); }

.notification-page { max-width: 1040px; margin: 0 auto 48px; }
.notification-page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.notification-page-heading p { margin: 8px 0 0; color: var(--notification-muted); font-size: 14px; }
.notification-page-count { color: var(--notification-gold); font-size: 13px; font-weight: 650; }
.notification-history-card { overflow: hidden; border: 1px solid var(--notification-border); border-radius: 16px; background: var(--notification-surface); }
.notification-history-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 16px; border-bottom: 1px solid var(--notification-border); }
.notification-status-filters { display: flex; gap: 5px; }
.notification-status-filters .notification-filter { font-size: 12px; }
.notification-search { display: flex; width: min(280px, 100%); gap: 8px; }
.notification-search input { min-width: 0; flex: 1; border-color: var(--notification-border); background: var(--notification-bg); color: var(--notification-text); font-size: 13px; }
.notification-search input:focus { border-color: var(--notification-gold); box-shadow: 0 0 0 .2rem rgba(233, 173, 50, .12); }
.notification-search button { border: 1px solid var(--notification-border); background: var(--notification-elevated); color: var(--notification-text); font-size: 12px; }
.notification-history-card .notification-category-row { padding: 10px 14px; }
.notification-history-card .notification-item { grid-template-columns: 8px minmax(0, 1fr); padding: 18px 20px; }
.notification-history-card .notification-item-title { font-size: 14px; }
.notification-history-card .notification-item-message { font-size: 13px; }
.notification-history-card .notification-item-meta { font-size: 11px; }
.notification-pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-top: 1px solid var(--notification-border); color: var(--notification-muted); font-size: 12px; }
.notification-pagination button { border: 1px solid var(--notification-border); border-radius: 8px; background: var(--notification-elevated); color: var(--notification-text); font-size: 12px; }
.notification-pagination button:disabled { opacity: .4; cursor: not-allowed; }

@media (max-width: 991.98px) {
    .notification-panel { top: auto; right: 0; bottom: 0; left: 0; width: 100%; max-height: min(82dvh, 720px); border-right: 0; border-bottom: 0; border-left: 0; border-radius: 18px 18px 0 0; padding-bottom: env(safe-area-inset-bottom); }
    .notification-overlay { background: rgba(0, 0, 0, .62); }
}

@media (max-width: 575.98px) {
    .notification-page { margin-bottom: 28px; }
    .notification-page-heading { align-items: flex-start; flex-direction: column; margin-bottom: 18px; }
    .notification-history-toolbar { align-items: stretch; }
    .notification-search { width: 100%; }
    .notification-history-card .notification-item { padding: 15px 14px; }
    .notification-pagination { padding: 12px; }
}

@media (prefers-reduced-motion: reduce) {
    .notification-trigger { transition: none; }
}
