.bell-btn {
    position: relative;
    text-decoration: none;
}

.bell-count {
    position: absolute;
    top: 3px;
    right: 2px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.15rem;
    height: 1.15rem;
    padding: 0 .3rem;
    border-radius: 999px;
    background: var(--st-absent);
    color: #fff;
    font-size: .64rem;
    font-weight: 700;
    line-height: 1;
    box-shadow: 0 0 0 2px var(--ot-surface);
    pointer-events: none;
}

.bell-btn.is-active {
    background: var(--ot-primary-soft);
    color: var(--ot-primary);
}

.bell-btn.is-ringing .ic,
.sidenav__item--bell.is-ringing .ic {
    animation: bell-ring .4s ease-out;
    transform-origin: 50% 10%;
}

@keyframes bell-ring {
    0% { transform: rotate(0); }
    30% { transform: rotate(12deg); }
    60% { transform: rotate(-8deg); }
    100% { transform: rotate(0); }
}

@media (max-width: 991.98px) {
    .sidenav__item--bell {
        display: none;
    }
}

.notify-legend {
    display: none;
}

.notify-group {
    overflow: hidden;
}

.notify-group--admin {
    border-color: var(--ot-admin-border);
}

.notify-group__head {
    display: flex;
    align-items: flex-start;
    gap: .9rem;
    padding: 1.1rem 1.25rem;
    border-bottom: 1px solid var(--ot-border);
    background: linear-gradient(180deg, var(--ot-surface-alt), var(--ot-surface));
}

.notify-group__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--ot-primary-soft);
    color: var(--ot-primary);
}

.notify-group--admin .notify-group__icon {
    background: var(--ot-admin-bg);
    color: var(--ot-admin);
}

.notify-group__icon .ic {
    width: 1.1rem;
    height: 1.1rem;
}

.notify-group__titles {
    min-width: 0;
}

.notify-group__title {
    margin: 0 0 .2rem;
    font-size: 1.02rem;
    font-weight: 700;
}

.notify-group__hint {
    margin: 0;
    color: var(--ot-muted);
    font-size: .86rem;
    line-height: 1.5;
}

.notify-pref {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem 1.5rem;
    padding: 1rem 1.25rem;
}

.notify-pref + .notify-pref {
    border-top: 1px solid var(--ot-border);
}

.notify-pref__text {
    min-width: 0;
    flex: 1 1 auto;
}

.notify-pref__title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .35rem .6rem;
    font-weight: 600;
    line-height: 1.4;
}

.notify-pref__lock {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    padding: .1rem .5rem;
    border-radius: 999px;
    background: var(--st-not_required-bg);
    color: var(--ot-muted);
    font-size: .72rem;
    font-weight: 600;
}

.notify-pref__lock .ic {
    width: .75rem;
    height: .75rem;
}

.notify-pref__desc {
    margin-top: .2rem;
    color: var(--ot-muted);
    font-size: .88rem;
    line-height: 1.5;
}

.notify-pref__why {
    margin-top: .5rem;
    padding: .55rem .75rem;
    border-left: 3px solid var(--ot-border);
    border-radius: 0 8px 8px 0;
    background: var(--ot-surface-alt);
    color: var(--ot-muted);
    font-size: .82rem;
    line-height: 1.55;
}

.notify-pref__state {
    display: inline-block;
    margin-left: .2rem;
    color: var(--st-present);
    font-weight: 600;
}

.notify-pref__state--off {
    color: var(--ot-muted);
}

.notify-pref__switches {
    display: flex;
    flex: 0 0 auto;
    gap: .6rem;
}

.notify-switch {
    position: relative;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: .35rem;
    width: 88px;
    padding: .55rem .4rem .45rem;
    border: 1px solid var(--ot-border);
    border-radius: 12px;
    background: var(--ot-surface);
    cursor: pointer;
    transition: border-color .15s ease-out, background .15s ease-out;
}

.notify-switch:hover {
    border-color: var(--ot-primary);
}

.notify-switch.is-absent {
    cursor: default;
    background: transparent;
    border-style: dashed;
}

.notify-switch.is-absent:hover {
    border-color: var(--ot-border);
}

.is-locked .notify-switch {
    cursor: not-allowed;
}

.is-locked .notify-switch:hover {
    border-color: var(--ot-border);
}

.notify-switch__input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}

.notify-switch__track {
    position: relative;
    display: block;
    width: 40px;
    height: 22px;
    border-radius: 999px;
    background: var(--st-unset);
    transition: background .2s ease-out;
}

.notify-switch__knob {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(16, 24, 40, .25);
    transition: transform .2s ease-out;
}

.notify-switch__input:checked + .notify-switch__track {
    background: var(--ot-primary);
}

.notify-switch__input:checked + .notify-switch__track .notify-switch__knob {
    transform: translateX(18px);
}

.notify-switch__input:focus-visible + .notify-switch__track {
    outline: 2px solid var(--ot-primary);
    outline-offset: 2px;
}

.notify-switch__input:disabled + .notify-switch__track {
    opacity: .55;
}

.notify-switch__none {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 22px;
    color: var(--ot-muted);
    font-weight: 600;
}

.notify-switch__label {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    color: var(--ot-muted);
    font-size: .72rem;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
}

.notify-switch__label .ic {
    width: .78rem;
    height: .78rem;
}

.notify-digest {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.25rem;
    padding: 1.15rem 1.25rem 1.3rem;
    border-top: 1px solid var(--ot-border);
    background: var(--ot-surface-alt);
}

.notify-digest__bar {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: .25rem 1rem;
}

.notify-digest__title {
    margin: 0 0 .6rem;
    font-size: .92rem;
    font-weight: 700;
}

.notify-digest__all {
    padding: 0;
    border: 0;
    background: none;
    color: var(--ot-primary);
    font-size: .82rem;
    font-weight: 600;
}

.notify-digest__all:hover {
    text-decoration: underline;
}

.notify-digest__empty {
    margin: 0;
    color: var(--ot-muted);
    font-size: .88rem;
    line-height: 1.55;
}

.notify-freq {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
    gap: .6rem;
}

.notify-freq__option {
    position: relative;
    display: block;
    cursor: pointer;
}

.notify-freq__option input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}

.notify-freq__card {
    display: flex;
    flex-direction: column;
    gap: .2rem;
    height: 100%;
    padding: .75rem .9rem .75rem 2.4rem;
    border: 1px solid var(--ot-border);
    border-radius: 12px;
    background: var(--ot-surface);
    transition: border-color .15s ease-out, box-shadow .15s ease-out;
}

.notify-freq__card::before {
    content: "";
    position: absolute;
    top: .95rem;
    left: .9rem;
    width: 1rem;
    height: 1rem;
    border: 2px solid var(--st-unset);
    border-radius: 50%;
    transition: border-color .15s ease-out, border-width .15s ease-out;
}

.notify-freq__option input:checked + .notify-freq__card {
    border-color: var(--ot-primary);
    box-shadow: 0 0 0 3px var(--ot-primary-soft);
}

.notify-freq__option input:checked + .notify-freq__card::before {
    border-color: var(--ot-primary);
    border-width: 5px;
}

.notify-freq__option input:focus-visible + .notify-freq__card {
    outline: 2px solid var(--ot-primary);
    outline-offset: 2px;
}

.notify-freq__name {
    font-weight: 600;
    line-height: 1.35;
}

.notify-freq__hint {
    color: var(--ot-muted);
    font-size: .8rem;
    line-height: 1.45;
}

.notify-tags {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
}

.notify-tag {
    position: relative;
    display: inline-flex;
    max-width: 100%;
    cursor: pointer;
}

.notify-tag input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}

.notify-tag__box {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    max-width: 100%;
    min-width: 0;
    overflow-wrap: anywhere;
    min-height: 34px;
    padding: .35rem .8rem .35rem .6rem;
    border: 1px solid var(--ot-border);
    border-radius: 999px;
    background: var(--ot-surface);
    color: var(--ot-text);
    font-size: .85rem;
    line-height: 1.3;
    transition: border-color .15s ease-out, background .15s ease-out, color .15s ease-out;
}

.notify-tag__box .ic {
    flex: 0 0 .9rem;
    width: .9rem;
    height: .9rem;
    color: var(--st-unset);
    transition: color .15s ease-out;
}

.notify-tag input:checked + .notify-tag__box {
    border-color: var(--ot-primary);
    background: var(--ot-primary-soft);
    color: var(--ot-primary);
    font-weight: 600;
}

.notify-tag input:checked + .notify-tag__box .ic {
    color: var(--ot-primary);
}

.notify-tag input:focus-visible + .notify-tag__box {
    outline: 2px solid var(--ot-primary);
    outline-offset: 2px;
}

.notify-tag__name {
    min-width: 0;
    overflow-wrap: anywhere;
}

.notify-savebar {
    position: sticky;
    bottom: 12px;
    z-index: 5;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .75rem 1.25rem;
    margin: 0 0 1.5rem;
    padding: .9rem 1.1rem;
    border: 1px solid var(--ot-border);
    border-radius: 14px;
    background: color-mix(in srgb, var(--ot-surface) 92%, transparent);
    box-shadow: var(--sh-2);
    backdrop-filter: blur(6px);
}

.notify-savebar__text {
    display: flex;
    flex-direction: column;
    gap: .15rem;
    min-width: 0;
}

.notify-savebar__title {
    font-weight: 600;
    line-height: 1.35;
}

.notify-savebar__hint {
    color: var(--ot-muted);
    font-size: .82rem;
    line-height: 1.4;
}

.notify-savebar__actions {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

@media (max-width: 767.98px) {
    .notify-pref {
        flex-direction: column;
        align-items: stretch;
    }

    .notify-pref__switches {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        justify-content: stretch;
        max-width: 22rem;
    }

    .notify-switch {
        width: auto;
        min-width: 0;
    }

    .notify-digest {
        padding: 1rem .85rem 1.1rem;
    }

    .notify-switch__label {
        flex-wrap: wrap;
        justify-content: center;
        max-width: 100%;
        text-align: center;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .notify-savebar {
        padding: .6rem;
    }

    .notify-savebar__text {
        display: none;
    }

    .notify-savebar__actions,
    .notify-savebar__actions .btn {
        width: 100%;
    }
}

.auth-wrap {
    display: flex;
    justify-content: center;
    padding: 1rem 0 2.5rem;
}

.auth-wrap--inline {
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 1.5rem;
    padding-top: 0;
}

.auth-tips {
    flex: 1 1 280px;
    max-width: 440px;
    padding: 1.4rem 1.5rem;
    border: 1px dashed var(--ot-border);
    border-radius: 18px;
    background: var(--ot-surface-alt);
}

.auth-tips__title {
    margin: 0 0 .9rem;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.35;
}

.auth-tips .auth-steps {
    margin-bottom: 1rem;
}

.auth-tips__note {
    margin: 0;
    color: var(--ot-muted);
    font-size: .84rem;
    line-height: 1.55;
}

.auth-card {
    position: relative;
    width: 100%;
    max-width: 460px;
    padding: 2rem 1.75rem 1.6rem;
    border: 1px solid var(--ot-border);
    border-radius: 18px;
    background:
        radial-gradient(420px 160px at 50% -40px, var(--ot-primary-soft), transparent 70%),
        var(--ot-surface);
    box-shadow: var(--sh-2);
    animation: auth-rise .32s ease-out both;
}

.auth-card--wide {
    max-width: 560px;
}

@keyframes auth-rise {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

.auth-card__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    margin-bottom: 1rem;
    border-radius: 18px;
    background: var(--ot-primary);
    color: var(--ot-on-primary);
    box-shadow: 0 8px 22px color-mix(in srgb, var(--ot-primary) 35%, transparent);
}

.auth-card__badge .ic {
    width: 1.5rem;
    height: 1.5rem;
}

.auth-card__badge--success {
    background: var(--st-present);
    box-shadow: 0 8px 22px color-mix(in srgb, var(--st-present) 30%, transparent);
}

.auth-card__badge--danger {
    background: var(--st-absent);
    box-shadow: 0 8px 22px color-mix(in srgb, var(--st-absent) 30%, transparent);
}

[data-bs-theme="dark"] .auth-card__badge--success,
[data-bs-theme="dark"] .auth-card__badge--danger {
    color: #0B1218;
}

.auth-card__title {
    margin: 0 0 .6rem;
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.auth-card__hint {
    margin: 0 0 1.25rem;
    color: var(--ot-muted);
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.auth-card__hint strong {
    color: var(--ot-text);
}

.auth-card__flash {
    margin: 0 0 1rem;
    padding: .65rem .85rem;
    border-radius: 10px;
    background: var(--st-present-bg);
    color: var(--st-present);
    font-weight: 600;
    line-height: 1.45;
}

.auth-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: .6rem;
    margin: 0;
}

.auth-card__note {
    margin: 1rem 0 0;
    color: var(--ot-muted);
    font-size: .82rem;
    line-height: 1.55;
}

.auth-card__links {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: .5rem 1rem;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--ot-border);
    font-size: .88rem;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.auth-form__field .form-label {
    font-weight: 600;
    margin-bottom: .35rem;
}

.auth-form__error {
    padding: .65rem .85rem;
    border-radius: 10px;
    background: var(--st-absent-bg);
    color: var(--st-absent);
    font-size: .88rem;
    line-height: 1.5;
}

.auth-form__trap {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
}

.auth-steps {
    display: grid;
    gap: .5rem;
    margin: 0 0 1.4rem;
    padding: 0;
    list-style: none;
}

.auth-steps li {
    position: relative;
    padding-left: 1.4rem;
    color: var(--ot-text);
    font-size: .9rem;
    line-height: 1.5;
}

.auth-steps li::before {
    content: "";
    position: absolute;
    top: .55rem;
    left: .3rem;
    width: .45rem;
    height: .45rem;
    border-radius: 50%;
    background: var(--ot-primary);
}

.unsub-summary {
    display: grid;
    margin: 0 0 1.25rem;
    border: 1px solid var(--ot-border);
    border-radius: 12px;
    background: var(--ot-surface-alt);
}

.unsub-summary__row {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: .2rem 1rem;
    padding: .65rem .9rem;
}

.unsub-summary__row + .unsub-summary__row {
    border-top: 1px solid var(--ot-border);
}

.unsub-summary__label {
    color: var(--ot-muted);
    font-size: .86rem;
}

.unsub-summary__value {
    font-size: .9rem;
    font-weight: 600;
    text-align: right;
    overflow-wrap: anywhere;
}

.login-forgot {
    margin: -.35rem 0 1rem;
    text-align: right;
    font-size: .88rem;
}

.profile-links {
    display: grid;
    gap: .5rem;
}

.profile-link {
    display: flex;
    align-items: center;
    gap: .8rem;
    padding: .75rem .85rem;
    border: 1px solid var(--ot-border);
    border-radius: 12px;
    color: var(--ot-text);
    text-decoration: none;
    transition: border-color .15s ease-out, background .15s ease-out;
}

.profile-link:hover,
.profile-link:focus-visible {
    border-color: var(--ot-primary);
    background: var(--ot-primary-soft);
    color: var(--ot-text);
}

.profile-link__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--ot-primary-soft);
    color: var(--ot-primary);
}

.profile-link__icon .ic {
    width: 1rem;
    height: 1rem;
}

.profile-link__text {
    display: flex;
    flex-direction: column;
    gap: .15rem;
    min-width: 0;
    flex: 1 1 auto;
}

.profile-link__title {
    font-weight: 600;
    line-height: 1.35;
}

.profile-link__hint {
    color: var(--ot-muted);
    font-size: .8rem;
    line-height: 1.45;
}

.profile-link__arrow {
    flex: 0 0 auto;
    width: .9rem;
    height: .9rem;
    color: var(--ot-muted);
}

@media (max-width: 575.98px) {
    .auth-card {
        padding: 1.6rem 1.2rem 1.3rem;
        border-radius: 16px;
    }

    .auth-card__actions .btn {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-card,
    .bell-btn.is-ringing .ic,
    .sidenav__item--bell.is-ringing .ic {
        animation: none;
        transition: none;
    }
}
